Skip to content

Commit

Permalink
chore: fix ica test for address gen
Browse files Browse the repository at this point in the history
  • Loading branch information
damiannolan committed Nov 20, 2024
1 parent 0ec2d48 commit 37da9f5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/apps/27-interchain-accounts/host/ibc_module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

icahost "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/host"
"github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/host/types"
Expand Down Expand Up @@ -148,9 +149,10 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenTry() {
},
{
"account address generation is block dependent", func() {
icaHostAccount := icatypes.GenerateAddress(suite.chainB.GetContext(), path.EndpointB.ConnectionID, path.EndpointA.ChannelConfig.PortID)
err := suite.chainB.GetSimApp().BankKeeper.SendCoins(suite.chainB.GetContext(), suite.chainB.SenderAccount.GetAddress(), icaHostAccount, sdk.Coins{sdk.NewCoin("stake", sdkmath.NewInt(1))})
suite.Require().NoError(err)
interchainAccAddr := icatypes.GenerateAddress(suite.chainB.GetContext(), path.EndpointB.ConnectionID, path.EndpointA.ChannelConfig.PortID)
interchainAcc := icatypes.NewInterchainAccount(authtypes.NewBaseAccountWithAddress(interchainAccAddr), path.EndpointA.ChannelConfig.PortID)
suite.chainB.GetSimApp().AuthKeeper.NewAccount(suite.chainB.GetContext(), interchainAcc)
suite.chainB.GetSimApp().AuthKeeper.SetAccount(suite.chainB.GetContext(), interchainAcc)

// ensure account registration is simulated in a separate block
suite.chainB.NextBlock()
Expand Down

0 comments on commit 37da9f5

Please sign in to comment.