mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
Bridge zombienet tests: move all "framework" files under one folder (#3462)
Related to https://github.com/paritytech/polkadot-sdk/issues/3400 Moving all bridges testing "framework" files under one folder in order to be able to download the entire folder when we want to add tests in other repos No significant functional changes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# import common functions
|
||||
source "${BASH_SOURCE%/*}/../../utils/bridges.sh"
|
||||
source "$FRAMEWORK_PATH/utils/bridges.sh"
|
||||
|
||||
# Expected sovereign accounts.
|
||||
#
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
$POLKADOT_SDK_PATH/bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh "$@"
|
||||
$ENV_PATH/bridges_rococo_westend.sh "$@"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Description: User is able to transfer WND from Westend Asset Hub to Rococo Asset Hub and back
|
||||
Description: Check if the HRMP channel between Rococo BH and Rococo AH was opened successfully
|
||||
Network: ./bridge_hub_rococo_local_network.toml
|
||||
Creds: config
|
||||
|
||||
# ensure that initialization has completed
|
||||
asset-hub-rococo-collator1: js-script ../../js-helpers/wait-hrmp-channel-opened.js with "1013" within 300 seconds
|
||||
asset-hub-rococo-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/wait-hrmp-channel-opened.js with "1013" within 300 seconds
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Description: User is able to transfer WND from Westend Asset Hub to Rococo Asset Hub and back
|
||||
Description: Check if the with-Westend GRANPDA pallet was initialized at Rococo BH
|
||||
Network: ./bridge_hub_rococo_local_network.toml
|
||||
Creds: config
|
||||
|
||||
# relay is already started - let's wait until with-Westend GRANPDA pallet is initialized at Rococo
|
||||
bridge-hub-rococo-collator1: js-script ../../js-helpers/best-finalized-header-at-bridged-chain.js with "Westend,0" within 400 seconds
|
||||
bridge-hub-rococo-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/best-finalized-header-at-bridged-chain.js with "Westend,0" within 400 seconds
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ set -e
|
||||
|
||||
trap "trap - SIGTERM && kill -9 -$$" SIGINT SIGTERM EXIT
|
||||
|
||||
source "${BASH_SOURCE%/*}/../../utils/zombienet.sh"
|
||||
source "$FRAMEWORK_PATH/utils/zombienet.sh"
|
||||
|
||||
# whether to init the chains (open HRMP channels, set XCM version, create reserve assets, etc)
|
||||
init=0
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
set -e
|
||||
|
||||
source "${BASH_SOURCE%/*}/../../utils/common.sh"
|
||||
source "${BASH_SOURCE%/*}/../../utils/zombienet.sh"
|
||||
source "$FRAMEWORK_PATH/utils/common.sh"
|
||||
source "$FRAMEWORK_PATH/utils/zombienet.sh"
|
||||
|
||||
rococo_dir=$1
|
||||
westend_dir=$2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Description: User is able to transfer ROC from Rococo Asset Hub to Westend Asset Hub and back
|
||||
Description: Check if the HRMP channel between Westend BH and Westend AH was opened successfully
|
||||
Network: ./bridge_hub_westend_local_network.toml
|
||||
Creds: config
|
||||
|
||||
# ensure that initialization has completed
|
||||
asset-hub-westend-collator1: js-script ../../js-helpers/wait-hrmp-channel-opened.js with "1002" within 600 seconds
|
||||
asset-hub-westend-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/wait-hrmp-channel-opened.js with "1002" within 600 seconds
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Description: User is able to transfer ROC from Rococo Asset Hub to Westend Asset Hub and back
|
||||
Description: Check if the with-Rococo GRANPDA pallet was initialized at Westend BH
|
||||
Network: ./bridge_hub_westend_local_network.toml
|
||||
Creds: config
|
||||
|
||||
# relay is already started - let's wait until with-Rococo GRANPDA pallet is initialized at Westend
|
||||
bridge-hub-westend-collator1: js-script ../../js-helpers/best-finalized-header-at-bridged-chain.js with "Rococo,0" within 400 seconds
|
||||
bridge-hub-westend-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/best-finalized-header-at-bridged-chain.js with "Rococo,0" within 400 seconds
|
||||
|
||||
@@ -41,8 +41,8 @@ function ensure_polkadot_js_api() {
|
||||
echo ""
|
||||
echo ""
|
||||
echo "-------------------"
|
||||
echo "Installing (nodejs) sub module: $(dirname "$0")/generate_hex_encoded_call"
|
||||
pushd $(dirname "$0")/generate_hex_encoded_call
|
||||
echo "Installing (nodejs) sub module: ${BASH_SOURCE%/*}/generate_hex_encoded_call"
|
||||
pushd ${BASH_SOURCE%/*}/generate_hex_encoded_call
|
||||
npm install
|
||||
popd
|
||||
fi
|
||||
@@ -21,6 +21,7 @@ do
|
||||
done
|
||||
|
||||
export POLKADOT_SDK_PATH=`realpath ${BASH_SOURCE%/*}/../..`
|
||||
export FRAMEWORK_PATH=`realpath ${BASH_SOURCE%/*}/framework`
|
||||
|
||||
# set path to binaries
|
||||
if [ "$ZOMBIENET_DOCKER_PATHS" -eq 1 ]; then
|
||||
|
||||
@@ -1,12 +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
|
||||
Network: {{ENV_PATH}}/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
|
||||
asset-hub-westend-collator1: run {{ENV_PATH}}/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
|
||||
asset-hub-westend-collator1: js-script {{FRAMEWORK_PATH}}/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
|
||||
bridge-hub-westend-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000002,0x6268726F,ThisChain,0" within 30 seconds
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
|
||||
set -e
|
||||
|
||||
source "${BASH_SOURCE%/*}/../../utils/common.sh"
|
||||
source "${BASH_SOURCE%/*}/../../utils/zombienet.sh"
|
||||
source "${BASH_SOURCE%/*}/../../framework/utils/common.sh"
|
||||
source "${BASH_SOURCE%/*}/../../framework/utils/zombienet.sh"
|
||||
|
||||
${BASH_SOURCE%/*}/../../environments/rococo-westend/spawn.sh --init --start-relayer &
|
||||
export ENV_PATH=`realpath ${BASH_SOURCE%/*}/../../environments/rococo-westend`
|
||||
|
||||
$ENV_PATH/spawn.sh --init --start-relayer &
|
||||
env_pid=$!
|
||||
|
||||
ensure_process_file $env_pid $TEST_DIR/rococo.env 600
|
||||
|
||||
@@ -1,12 +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
|
||||
Network: {{ENV_PATH}}/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
|
||||
asset-hub-rococo-collator1: run {{ENV_PATH}}/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
|
||||
asset-hub-rococo-collator1: js-script {{FRAMEWORK_PATH}}/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
|
||||
bridge-hub-rococo-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000002,0x62687764,ThisChain,0" within 30 seconds
|
||||
|
||||
@@ -1,10 +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
|
||||
Network: {{ENV_PATH}}/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
|
||||
asset-hub-rococo-collator1: run {{ENV_PATH}}/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
|
||||
asset-hub-rococo-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/native-assets-balance-increased.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" within 300 seconds
|
||||
|
||||
@@ -1,10 +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
|
||||
Network: {{ENV_PATH}}/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
|
||||
asset-hub-westend-collator1: run {{ENV_PATH}}/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
|
||||
asset-hub-westend-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/native-assets-balance-increased.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" within 300 seconds
|
||||
|
||||
+2
-2
@@ -1,8 +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
|
||||
Network: {{ENV_PATH}}/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
|
||||
bridge-hub-westend-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/only-mandatory-headers-synced-when-idle.js with "300,rococo-at-westend" within 600 seconds
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
set -e
|
||||
|
||||
source "${BASH_SOURCE%/*}/../../utils/common.sh"
|
||||
source "${BASH_SOURCE%/*}/../../utils/zombienet.sh"
|
||||
source "${BASH_SOURCE%/*}/../../framework/utils/common.sh"
|
||||
source "${BASH_SOURCE%/*}/../../framework/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 &
|
||||
export ENV_PATH=`realpath ${BASH_SOURCE%/*}/../../environments/rococo-westend`
|
||||
|
||||
$ENV_PATH/spawn.sh &
|
||||
env_pid=$!
|
||||
|
||||
ensure_process_file $env_pid $TEST_DIR/rococo.env 600
|
||||
|
||||
+2
-2
@@ -1,7 +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
|
||||
Network: {{ENV_PATH}}/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
|
||||
bridge-hub-rococo-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/only-mandatory-headers-synced-when-idle.js with "300,westend-at-rococo" within 600 seconds
|
||||
|
||||
@@ -45,7 +45,7 @@ RUN mkdir -p /home/nonroot/bridges-polkadot-sdk
|
||||
COPY ./artifacts/bridges-polkadot-sdk /home/nonroot/bridges-polkadot-sdk
|
||||
# also prepare `generate_hex_encoded_call` for running
|
||||
RUN set -eux; \
|
||||
cd /home/nonroot/bridges-polkadot-sdk/bridges/testing/utils/generate_hex_encoded_call; \
|
||||
cd /home/nonroot/bridges-polkadot-sdk/bridges/testing/framework/utils/generate_hex_encoded_call; \
|
||||
npm install
|
||||
|
||||
# check if executable works in this container
|
||||
|
||||
Reference in New Issue
Block a user