Skip to content

Commit

Permalink
test: ica integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
duvbell committed Jan 9, 2024
1 parent c50be27 commit 6e54384
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,9 +689,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)
Expand Down
11 changes: 8 additions & 3 deletions scripts/tests/ica/delegate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down

0 comments on commit 6e54384

Please sign in to comment.