From fab40e46bfacc9328428d638a2f94795ab1da30a Mon Sep 17 00:00:00 2001 From: kienn6034 Date: Tue, 9 Jan 2024 15:58:13 +0700 Subject: [PATCH] test: ica integration test --- app/app.go | 2 +- scripts/tests/ica/delegate.sh | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/app.go b/app/app.go index eaf8cffb..132aa6a7 100644 --- a/app/app.go +++ b/app/app.go @@ -708,9 +708,9 @@ func NewMigalooApp( // Create static IBC router, add app routes, then set and seal it ibcRouter := ibcporttypes.NewRouter(). AddRoute(icacontrollertypes.SubModuleName, icaControllerStack). + AddRoute(icahosttypes.SubModuleName, icaHostStack). AddRoute(ibctransfertypes.ModuleName, *app.TransferStack). AddRoute(wasmtypes.ModuleName, wasmStack). - AddRoute(icahosttypes.SubModuleName, icaHostStack). AddRoute(icqtypes.ModuleName, icqStack) app.IBCKeeper.SetRouter(ibcRouter) diff --git a/scripts/tests/ica/delegate.sh b/scripts/tests/ica/delegate.sh index 0879b2e0..77230be9 100755 --- a/scripts/tests/ica/delegate.sh +++ b/scripts/tests/ica/delegate.sh @@ -43,18 +43,23 @@ GENERATED_PACKET=$($BINARY tx interchain-accounts host generate-packet-data '{ "delegator_address": "'"$ICS_TX_RESULT"'", "validator_address": "'"$VAL_ADDR_1"'", "amount": { - "denom": "$DENOM", + "denom": "'"$DENOM"'", "amount": "'"$ICS_ACCOUNT_BALANCE"'" } }') -$BINARY tx interchain-accounts controller send-tx connection-0 $GENERATED_PACKET --from $WALLET_1 --chain-id test-1 --home $CHAIN_DIR/test-1 --fees 3000000$DENOM --node tcp://localhost:16657 --keyring-backend test -y &> /dev/null -VALIDATOR_DELEGATIONS="" +SEND_TX_RESULT=$($BINARY tx interchain-accounts controller send-tx connection-0 $GENERATED_PACKET --from $WALLET_1 --chain-id test-1 --home $CHAIN_DIR/test-1 --fees 3000000$DENOM --node tcp://localhost:16657 --keyring-backend test -y) + +PRE_VALIDATOR_DELEGATIONS="" while [[ "$VALIDATOR_DELEGATIONS" != "$ICS_ACCOUNT_BALANCE" ]]; do sleep 2 echo "Waiting for the transaction '/cosmos.bank.v1beta1.MsgDelegate' to be relayed..." VALIDATOR_DELEGATIONS=$($BINARY query staking delegations-to $VAL_ADDR_1 --home $CHAIN_DIR/test-2 --node tcp://localhost:26657 -o json | jq -r '.delegation_responses[-1].balance.amount') + + # log the validator delegations, and ics account balance + echo "Validator Delegations: $VALIDATOR_DELEGATIONS" + echo "ICS Account Balance: $ICS_ACCOUNT_BALANCE" done echo ""