Skip to content

Commit

Permalink
add relaying tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 committed Nov 8, 2023
1 parent f08c280 commit 665cec3
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
43 changes: 43 additions & 0 deletions e2e/namada-simple-transfers
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion scripts/setup-namada-single-node
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 665cec3

Please sign in to comment.