From 375826259fe1dc850f1ab8114414f4d4ab5936c3 Mon Sep 17 00:00:00 2001 From: yito88 Date: Wed, 8 Nov 2023 09:36:46 +0100 Subject: [PATCH] add relaying tests --- e2e/namada-simple-transfers | 43 ++++++++++++++++++++++++++++++++ scripts/setup-namada-single-node | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/e2e/namada-simple-transfers b/e2e/namada-simple-transfers index afe19783ff..31a268a7d2 100755 --- a/e2e/namada-simple-transfers +++ b/e2e/namada-simple-transfers @@ -104,6 +104,7 @@ cargo run --bin hermes -- --config config_for_namada.toml \ echo "Balances on chain A" ${NAMADAC} --base-dir ${base_dir_a} balance \ + --token apfel \ --owner relayer \ --node ${LEDGER_ADDR_A} @@ -146,12 +147,54 @@ cargo run --bin hermes -- --config config_for_namada.toml \ echo "Balances on chain A" ${NAMADAC} --base-dir ${base_dir_a} balance \ + --token apfel \ + --owner relayer \ + --node ${LEDGER_ADDR_A} + +echo "Balances on chain B" +${NAMADAC} --base-dir ${base_dir_b} balance \ + --token ${received_token} \ + --owner relayer \ + --node ${LEDGER_ADDR_B} + +# Start Hermes +cargo run --bin hermes -- --config config_for_namada.toml \ + start > ${HERMES_DIR}/e2e/hermes.log 2>&1 & + +# transfer 300 apfel from chain_a to chain_b +${NAMADAC} --base-dir ${base_dir_a} ibc-transfer \ + --source relayer \ + --receiver ${receiver_b} \ + --token apfel \ + --amount 200 \ + --signing-keys relayer \ + --channel-id channel-0 \ + --node ${LEDGER_ADDR_A} + +# transfer 300 apfel from chain_a to chain_b twice +${NAMADAC} --base-dir ${base_dir_a} ibc-transfer \ + --source relayer \ + --receiver ${receiver_b} \ + --token apfel \ + --amount 300 \ + --signing-keys relayer \ + --channel-id channel-0 \ + --node ${LEDGER_ADDR_A} + +# wait for relaying +sleep 10 + +echo "Balances on chain A" +${NAMADAC} --base-dir ${base_dir_a} balance \ + --token apfel \ --owner relayer \ --node ${LEDGER_ADDR_A} echo "Balances on chain B" ${NAMADAC} --base-dir ${base_dir_b} balance \ + --token ${received_token} \ --owner relayer \ --node ${LEDGER_ADDR_B} +killall hermes killall namadan diff --git a/scripts/setup-namada-single-node b/scripts/setup-namada-single-node index 5145f9332b..3f71ebb1a4 100755 --- a/scripts/setup-namada-single-node +++ b/scripts/setup-namada-single-node @@ -99,8 +99,8 @@ function init_network() { ${base_dir}/pre-genesis/validator-0 \ --dont-prefetch-wasm - rm -rf ${base_dir}/${chain_id} # for non-validator + rm -rf ${base_dir}/${chain_id} NAMADA_NETWORK_CONFIGS_DIR=${base_dir}/genesis \ ${NAMADAC} --base-dir ${base_dir} \ utils join-network \