mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 04:07:57 +00:00
Bridge zombienet tests - move all test scripts to the same folder (#3333)
Related to https://github.com/paritytech/polkadot-sdk/issues/3242
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
Description: User is able to transfer ROC from Rococo Asset Hub to Westend Asset Hub and back
|
||||
Network: ../../environments/rococo-westend/bridge_hub_westend_local_network.toml
|
||||
Creds: config
|
||||
|
||||
# send ROC to //Alice from Rococo AH to Westend AH
|
||||
asset-hub-westend-collator1: run ../../environments/rococo-westend/helper.sh with "reserve-transfer-assets-from-asset-hub-rococo-local" within 120 seconds
|
||||
|
||||
# check that //Alice received the ROC on Westend AH
|
||||
asset-hub-westend-collator1: js-script ../../js-helpers/wrapped-assets-balance.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,0,Rococo" within 300 seconds
|
||||
|
||||
# check that the relayer //Charlie is rewarded by Westend AH
|
||||
bridge-hub-westend-collator1: js-script ../../js-helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000002,0x6268726F,ThisChain,0" within 30 seconds
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
source "${BASH_SOURCE%/*}/../../utils/common.sh"
|
||||
source "${BASH_SOURCE%/*}/../../utils/zombienet.sh"
|
||||
|
||||
${BASH_SOURCE%/*}/../../environments/rococo-westend/spawn.sh --init --start-relayer &
|
||||
env_pid=$!
|
||||
|
||||
ensure_process_file $env_pid $TEST_DIR/rococo.env 400
|
||||
rococo_dir=`cat $TEST_DIR/rococo.env`
|
||||
echo
|
||||
|
||||
ensure_process_file $env_pid $TEST_DIR/westend.env 180
|
||||
westend_dir=`cat $TEST_DIR/westend.env`
|
||||
echo
|
||||
|
||||
run_zndsl ${BASH_SOURCE%/*}/roc-reaches-westend.zndsl $westend_dir
|
||||
run_zndsl ${BASH_SOURCE%/*}/wnd-reaches-rococo.zndsl $rococo_dir
|
||||
|
||||
run_zndsl ${BASH_SOURCE%/*}/wroc-reaches-rococo.zndsl $rococo_dir
|
||||
run_zndsl ${BASH_SOURCE%/*}/wwnd-reaches-westend.zndsl $westend_dir
|
||||
@@ -0,0 +1,12 @@
|
||||
Description: User is able to transfer WND from Westend Asset Hub to Rococo Asset Hub and back
|
||||
Network: ../../environments/rococo-westend/bridge_hub_rococo_local_network.toml
|
||||
Creds: config
|
||||
|
||||
# send WND to //Alice from Westend AH to Rococo AH
|
||||
asset-hub-rococo-collator1: run ../../environments/rococo-westend/helper.sh with "reserve-transfer-assets-from-asset-hub-westend-local" within 120 seconds
|
||||
|
||||
# check that //Alice received the WND on Rococo AH
|
||||
asset-hub-rococo-collator1: js-script ../../js-helpers/wrapped-assets-balance.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,0,Westend" within 300 seconds
|
||||
|
||||
# check that the relayer //Charlie is rewarded by Rococo AH
|
||||
bridge-hub-rococo-collator1: js-script ../../js-helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000002,0x62687764,ThisChain,0" within 30 seconds
|
||||
@@ -0,0 +1,10 @@
|
||||
Description: User is able to transfer ROC from Rococo Asset Hub to Westend Asset Hub and back
|
||||
Network: ../../environments/rococo-westend/bridge_hub_westend_local_network.toml
|
||||
Creds: config
|
||||
|
||||
# send wROC back to Alice from Westend AH to Rococo AH
|
||||
asset-hub-rococo-collator1: run ../../environments/rococo-westend/helper.sh with "withdraw-reserve-assets-from-asset-hub-westend-local" within 120 seconds
|
||||
|
||||
# check that //Alice received the wROC on Rococo AH
|
||||
# (we wait until //Alice account increases here - there are no other transactions that may increase it)
|
||||
asset-hub-rococo-collator1: js-script ../../js-helpers/native-assets-balance-increased.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" within 300 seconds
|
||||
@@ -0,0 +1,10 @@
|
||||
Description: User is able to transfer ROC from Rococo Asset Hub to Westend Asset Hub and back
|
||||
Network: ../../environments/rococo-westend/bridge_hub_westend_local_network.toml
|
||||
Creds: config
|
||||
|
||||
# send wWND back to Alice from Rococo AH to Westend AH
|
||||
asset-hub-westend-collator1: run ../../environments/rococo-westend/helper.sh with "withdraw-reserve-assets-from-asset-hub-rococo-local" within 120 seconds
|
||||
|
||||
# check that //Alice received the wWND on Westend AH
|
||||
# (we wait until //Alice account increases here - there are no other transactions that may increase it)
|
||||
asset-hub-westend-collator1: js-script ../../js-helpers/native-assets-balance-increased.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" within 300 seconds
|
||||
@@ -0,0 +1,8 @@
|
||||
Description: While relayer is idle, we only sync mandatory Rococo (and a single Rococo BH) headers to Westend BH.
|
||||
Network: ../../environments/rococo-westend/bridge_hub_westend_local_network.toml
|
||||
Creds: config
|
||||
|
||||
# ensure that relayer is only syncing mandatory headers while idle. This includes both headers that were
|
||||
# generated while relay was offline and those in the next 100 seconds while script is active.
|
||||
bridge-hub-westend-collator1: js-script ../../js-helpers/only-mandatory-headers-synced-when-idle.js with "300,rococo-at-westend" within 600 seconds
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
source "${BASH_SOURCE%/*}/../../utils/common.sh"
|
||||
source "${BASH_SOURCE%/*}/../../utils/zombienet.sh"
|
||||
|
||||
# We use `--relayer-delay` in order to sleep some time before starting relayer.
|
||||
# We want to sleep for at least 1 session, which is expected to be 60 seconds for test environment.
|
||||
${BASH_SOURCE%/*}/../../environments/rococo-westend/spawn.sh &
|
||||
env_pid=$!
|
||||
|
||||
ensure_process_file $env_pid $TEST_DIR/rococo.env 400
|
||||
rococo_dir=`cat $TEST_DIR/rococo.env`
|
||||
echo
|
||||
|
||||
ensure_process_file $env_pid $TEST_DIR/westend.env 180
|
||||
westend_dir=`cat $TEST_DIR/westend.env`
|
||||
echo
|
||||
|
||||
# Sleep for some time before starting the relayer. We want to sleep for at least 1 session,
|
||||
# which is expected to be 60 seconds for the test environment.
|
||||
echo -e "Sleeping 90s before starting relayer ...\n"
|
||||
sleep 90
|
||||
${BASH_SOURCE%/*}/../../environments/rococo-westend/start_relayer.sh $rococo_dir $westend_dir relayer_pid
|
||||
|
||||
# Sometimes the relayer syncs multiple parachain heads in the begining leading to test failures.
|
||||
# See issue: https://github.com/paritytech/parity-bridges-common/issues/2838.
|
||||
# TODO: Remove this sleep after the issue is fixed.
|
||||
echo -e "Sleeping 180s before runing the tests ...\n"
|
||||
sleep 180
|
||||
|
||||
run_zndsl ${BASH_SOURCE%/*}/rococo-to-westend.zndsl $westend_dir
|
||||
run_zndsl ${BASH_SOURCE%/*}/westend-to-rococo.zndsl $rococo_dir
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
Description: While relayer is idle, we only sync mandatory Westend (and a single Westend BH) headers to Rococo BH.
|
||||
Network: ../../environments/rococo-westend/bridge_hub_rococo_local_network.toml
|
||||
Creds: config
|
||||
|
||||
# ensure that relayer is only syncing mandatory headers while idle. This includes both headers that were
|
||||
# generated while relay was offline and those in the next 100 seconds while script is active.
|
||||
bridge-hub-rococo-collator1: js-script ../../js-helpers/only-mandatory-headers-synced-when-idle.js with "300,westend-at-rococo" within 600 seconds
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
Description: While relayer is active, we only sync mandatory and required Rococo (and Rococo BH) headers to Westend BH.
|
||||
Network: ../environments/rococo-westend/bridge_hub_westend_local_network.toml
|
||||
Creds: config
|
||||
|
||||
# step 1: initialize Westend AH
|
||||
asset-hub-westend-collator1: run ../scripts/invoke-script.sh with "init-asset-hub-westend-local" within 60 seconds
|
||||
|
||||
# step 2: initialize Westend bridge hub
|
||||
bridge-hub-westend-collator1: run ../scripts/invoke-script.sh with "init-bridge-hub-westend-local" within 60 seconds
|
||||
|
||||
# step 3: ensure that initialization has completed
|
||||
asset-hub-westend-collator1: js-script ../js-helpers/wait-hrmp-channel-opened.js with "1002" within 600 seconds
|
||||
|
||||
# step 4: send message from Westend to Rococo
|
||||
asset-hub-westend-collator1: run ../scripts/invoke-script.sh with "reserve-transfer-assets-from-asset-hub-westend-local" within 60 seconds
|
||||
|
||||
# step 5: start relayer
|
||||
# (we are starting it after sending the message to be sure that relayer won't relay messages before our js script
|
||||
# will be started at step 6)
|
||||
# (it is started by sibling 0003-required-headers-synced-while-active-westend-to-rococo.zndsl)
|
||||
|
||||
# step 6: ensure that relayer won't sync any extra headers while delivering messages and confirmations
|
||||
bridge-hub-westend-collator1: js-script ../js-helpers/only-required-headers-synced-when-active.js with "500,rococo-at-westend" within 600 seconds
|
||||
|
||||
# wait until other network test has completed OR exit with an error too
|
||||
asset-hub-westend-collator1: run ../scripts/sync-exit.sh within 600 seconds
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
Description: While relayer is active, we only sync mandatory and required Westend (and Westend BH) headers to Rococo BH.
|
||||
Network: ../environments/rococo-westend/bridge_hub_rococo_local_network.toml
|
||||
Creds: config
|
||||
|
||||
# step 1: initialize Rococo AH
|
||||
asset-hub-rococo-collator1: run ../scripts/invoke-script.sh with "init-asset-hub-rococo-local" within 60 seconds
|
||||
|
||||
# step 2: initialize Rococo bridge hub
|
||||
bridge-hub-rococo-collator1: run ../scripts/invoke-script.sh with "init-bridge-hub-rococo-local" within 60 seconds
|
||||
|
||||
# step 3: ensure that initialization has completed
|
||||
asset-hub-rococo-collator1: js-script ../js-helpers/wait-hrmp-channel-opened.js with "1013" within 600 seconds
|
||||
|
||||
# step 4: send message from Rococo to Westend
|
||||
asset-hub-rococo-collator1: run ../scripts/invoke-script.sh with "reserve-transfer-assets-from-asset-hub-rococo-local" within 60 seconds
|
||||
|
||||
# step 5: start relayer
|
||||
# (we are starting it after sending the message to be sure that relayer won't relay messages before our js script
|
||||
# will be started at step 6)
|
||||
bridge-hub-rococo-collator1: run ../scripts/start-relayer.sh within 60 seconds
|
||||
|
||||
# step 6: ensure that relayer won't sync any extra headers while delivering messages and confirmations
|
||||
bridge-hub-rococo-collator1: js-script ../js-helpers/only-required-headers-synced-when-active.js with "500,westend-at-rococo" within 600 seconds
|
||||
|
||||
# wait until other network test has completed OR exit with an error too
|
||||
asset-hub-rococo-collator1: run ../scripts/sync-exit.sh within 600 seconds
|
||||
Reference in New Issue
Block a user