Skip to content

Commit

Permalink
test: update test ica
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 committed Jan 23, 2024
1 parent b8130f5 commit 76455c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/tests/ibc-hooks/increment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ TX_HASH=$($BINARY tx wasm instantiate2 $CODE_ID '{"count": 0}' $RANDOM_HASH --no

echo "TX hash: $TX_HASH"
sleep 3
CONTRACT_ADDRESS=$($BINARY query tx $TX_HASH -o josn --chain-id test-2 --home $CHAIN_DIR/test-2 --node tcp://localhost:26657 | jq -r '.logs[0].events[1].attributes[0].value')
CONTRACT_ADDRESS=$($BINARY query tx $TX_HASH -o josn --chain-id test-2 --home $CHAIN_DIR/test-2 --node tcp://localhost:26657 | jq -r '.logs[0].events[0].attributes[0].value')
echo "Contract address: $CONTRACT_ADDRESS"

echo "Executing the IBC Hook to increment the counter"
# First execute an IBC transfer to create the entry in the smart contract with the sender address ...
IBC_HOOK_RES=$($BINARY tx ibc-transfer transfer transfer channel-0 $CONTRACT_ADDRESS 1uwhale --memo='{"wasm":{"contract": "'"$CONTRACT_ADDRESS"'" ,"msg": {"increment": {}}}}' --chain-id test-1 --home $CHAIN_DIR/test-1 --node tcp://localhost:16657 --keyring-backend test --from $WALLET_1 --fees 6000000$DENOM -y -o json)
Expand All @@ -48,6 +47,7 @@ COUNT_FUNDS_RES=""
while [ "$COUNT_RES" != "1" ] || [ "$COUNT_FUNDS_RES" != "2" ]; do
sleep 3
# Get count res
echo $CONTRACT_ADDRESS
RES=$($BINARY query wasm contract-state smart "$CONTRACT_ADDRESS" '{"get_count": {"addr": "'"$WALLET_1_WASM_SENDER"'"}}' --chain-id test-2 --home $CHAIN_DIR/test-2 --node tcp://localhost:26657 -o json)
echo "Query response: $RES"

Expand Down
1 change: 1 addition & 0 deletions scripts/tests/ica/delegate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ $BINARY tx bank send $WALLET_2 $ICS_TX_RESULT 10000000$DENOM --chain-id test-2 -
sleep 5
ICS_ACCOUNT_BALANCE=$($BINARY query bank balances $ICS_TX_RESULT --chain-id test-2 --node tcp://localhost:26657 -o json | jq -r '.balances[0].amount')

echo $($BINARY query bank balances $ICS_TX_RESULT --chain-id test-2 --node tcp://localhost:26657 -o json)
if [[ "$ICS_ACCOUNT_BALANCE" != "10000000" ]]; then
echo "Error: ICA Have not received tokens"
exit 1
Expand Down

0 comments on commit 76455c9

Please sign in to comment.