Skip to content

Commit

Permalink
fix test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 committed Jul 1, 2024
1 parent 6d9c1af commit 30f468c
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 30 deletions.
45 changes: 23 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ tendermint-rpc = { version = "=0.36.0" }
tendermint-testgen = { version = "=0.36.0" }

# Namada dependencies
namada_ibc = { git = "https://github.com/anoma/namada", rev = "c74c583c7f11e0483088b034e721c7bee001f13c" }
namada_parameters = { git = "https://github.com/anoma/namada", rev = "c74c583c7f11e0483088b034e721c7bee001f13c" }
namada_sdk = { git = "https://github.com/anoma/namada", rev = "c74c583c7f11e0483088b034e721c7bee001f13c" }
namada_token = { git = "https://github.com/anoma/namada", rev = "c74c583c7f11e0483088b034e721c7bee001f13c" }
namada_ibc = { git = "https://github.com/anoma/namada", rev = "d6fc2f2e1472898b33b7072ef98312ce8b5e9d31" }
namada_parameters = { git = "https://github.com/anoma/namada", rev = "d6fc2f2e1472898b33b7072ef98312ce8b5e9d31" }
namada_sdk = { git = "https://github.com/anoma/namada", rev = "d6fc2f2e1472898b33b7072ef98312ce8b5e9d31" }
namada_token = { git = "https://github.com/anoma/namada", rev = "d6fc2f2e1472898b33b7072ef98312ce8b5e9d31" }

# Other dependencies
abscissa_core = "=0.6.0"
Expand Down
14 changes: 13 additions & 1 deletion e2e/namada-gaia-simple-transfers
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,22 @@ echo "==== Balances on Gaia ===="
balance=$(gaiad query bank balances ${gaia_user})
echo "${balance}"
balance=$(echo "${balance}" | grep ibc -B 1 | tr -d '\n')
if [[ "${balance}" != *"- amount: \"200\" denom: ibc/"* ]]; then
if [[ "${balance}" != *"- amount: \"200000000\" denom: ibc/"* ]]; then
echo "The balance on Gaia is wrong"
exit 1
fi

echo "~~ Generate the proof from Namada for the following transfer ~~"
resp=$(${NAMADAC} --base-dir ${base_dir} ibc-gen-shielding \
--output-folder-path ${base_dir} \
--target ${payment_addr_a} \
--token samoleans \
--amount 10 \
--port-id transfer \
--channel-id channel-0 \
--node ${NAMADA_LEDGER_ADDR})
memo_path=$(echo $resp | awk '{print $8}')

echo "~~ Shielding transfer 10 samoleans from Gaia to Namada ~~"
cargo run --bin hermes -- --config config_for_namada.toml \
tx ft-transfer \
Expand All @@ -243,6 +254,7 @@ cargo run --bin hermes -- --config config_for_namada.toml \
--receiver ${payment_addr_a} \
--denom samoleans \
--timeout-height-offset 1000 \
--memo $(cat ${memo_path})

# wait for relaying
sleep 40
Expand Down
8 changes: 5 additions & 3 deletions e2e/namada-simple-transfers
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,11 @@ fi
echo "==== Shielded transfer tests ===="

echo "~~ Generate the proof from chain_b for the following transfer ~~"
apfel_addr=$(${NAMADAW} --base-dir ${base_dir_a} find --alias apfel | awk '/"apfel":/{print $3}')
resp=$(${NAMADAC} --base-dir ${base_dir_b} ibc-gen-shielding \
--output-folder-path ${base_dir_b} \
--target ${payment_addr_b} \
--token apfel \
--token ${apfel_addr} \
--amount 100000000 \
--port-id transfer \
--channel-id channel-0 \
Expand Down Expand Up @@ -398,11 +399,12 @@ if [[ "${balance}" != *"${IBC_TOKEN}: 50000000" ]]; then
fi

echo "~~ Generate the proof from chain A for the following transfer ~~"
ibc_token="transfer/channel-0/${apfel_addr}"
resp=$(${NAMADAC} --base-dir ${base_dir_a} ibc-gen-shielding \
--output-folder-path ${base_dir_a} \
--target ${payment_addr_a} \
--token ${IBC_TOKEN} \
--amount 50000000 \
--token ${ibc_token} \
--amount 50 \
--port-id transfer \
--channel-id channel-0 \
--node ${LEDGER_ADDR_A})
Expand Down

0 comments on commit 30f468c

Please sign in to comment.