diff --git a/modules/apps/27-interchain-accounts/host/keeper/grpc_query_test.go b/modules/apps/27-interchain-accounts/host/keeper/grpc_query_test.go index adf21d65e5b..3bc07d789a8 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/grpc_query_test.go +++ b/modules/apps/27-interchain-accounts/host/keeper/grpc_query_test.go @@ -1,6 +1,8 @@ package keeper_test import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" ) diff --git a/modules/apps/27-interchain-accounts/host/keeper/relay_test.go b/modules/apps/27-interchain-accounts/host/keeper/relay_test.go index 2e4fdf2f17c..14034e5ec28 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/relay_test.go +++ b/modules/apps/27-interchain-accounts/host/keeper/relay_test.go @@ -53,11 +53,8 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { proposal, err := govv1.NewProposal([]sdk.Msg{proposalMsg}, govtypes.DefaultStartingProposalID, suite.chainA.GetContext().BlockTime(), suite.chainA.GetContext().BlockTime(), "test proposal", "title", "Description", sdk.AccAddress(interchainAccountAddr), false) suite.Require().NoError(err) - err = suite.chainB.GetSimApp().GovKeeper.SetProposal(suite.chainB.GetContext(), proposal) - suite.Require().NoError(err) - - err = suite.chainB.GetSimApp().GovKeeper.ActivateVotingPeriod(suite.chainB.GetContext(), proposal) - suite.Require().NoError(err) + suite.chainB.GetSimApp().GovKeeper.SetProposal(suite.chainB.GetContext(), proposal) + suite.chainB.GetSimApp().GovKeeper.ActivateVotingPeriod(suite.chainB.GetContext(), proposal) msg := &govtypes.MsgVote{ ProposalId: govtypes.DefaultStartingProposalID, @@ -222,11 +219,8 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { proposal, err := govv1.NewProposal([]sdk.Msg{proposalMsg}, govtypes.DefaultStartingProposalID, suite.chainA.GetContext().BlockTime(), suite.chainA.GetContext().BlockTime(), "test proposal", "title", "description", sdk.AccAddress(interchainAccountAddr), false) suite.Require().NoError(err) - err = suite.chainB.GetSimApp().GovKeeper.SetProposal(suite.chainB.GetContext(), proposal) - suite.Require().NoError(err) - - err = suite.chainB.GetSimApp().GovKeeper.ActivateVotingPeriod(suite.chainB.GetContext(), proposal) - suite.Require().NoError(err) + suite.chainB.GetSimApp().GovKeeper.SetProposal(suite.chainB.GetContext(), proposal) + suite.chainB.GetSimApp().GovKeeper.ActivateVotingPeriod(suite.chainB.GetContext(), proposal) msg := &govtypes.MsgVote{ ProposalId: govtypes.DefaultStartingProposalID, @@ -543,11 +537,8 @@ func (suite *KeeperTestSuite) TestJSONOnRecvPacket() { proposal, err := govv1.NewProposal([]sdk.Msg{proposalMsg}, govtypes.DefaultStartingProposalID, suite.chainA.GetContext().BlockTime(), suite.chainA.GetContext().BlockTime(), "test proposal", "title", "Description", sdk.AccAddress(interchainAccountAddr), false) suite.Require().NoError(err) - err = suite.chainB.GetSimApp().GovKeeper.SetProposal(suite.chainB.GetContext(), proposal) - suite.Require().NoError(err) - - err = suite.chainB.GetSimApp().GovKeeper.ActivateVotingPeriod(suite.chainB.GetContext(), proposal) - suite.Require().NoError(err) + suite.chainB.GetSimApp().GovKeeper.SetProposal(suite.chainB.GetContext(), proposal) + suite.chainB.GetSimApp().GovKeeper.ActivateVotingPeriod(suite.chainB.GetContext(), proposal) msgBytes := []byte(`{ "messages": [ @@ -642,11 +633,8 @@ func (suite *KeeperTestSuite) TestJSONOnRecvPacket() { proposal, err := govv1.NewProposal([]sdk.Msg{proposalMsg}, govtypes.DefaultStartingProposalID, suite.chainA.GetContext().BlockTime(), suite.chainA.GetContext().BlockTime(), "test proposal", "title", "description", sdk.AccAddress(interchainAccountAddr), false) suite.Require().NoError(err) - err = suite.chainB.GetSimApp().GovKeeper.SetProposal(suite.chainB.GetContext(), proposal) - suite.Require().NoError(err) - - err = suite.chainB.GetSimApp().GovKeeper.ActivateVotingPeriod(suite.chainB.GetContext(), proposal) - suite.Require().NoError(err) + suite.chainB.GetSimApp().GovKeeper.SetProposal(suite.chainB.GetContext(), proposal) + suite.chainB.GetSimApp().GovKeeper.ActivateVotingPeriod(suite.chainB.GetContext(), proposal) msgBytes := []byte(`{ "messages": [ diff --git a/modules/capability/capability_test.go b/modules/capability/capability_test.go index 1f12bceaf4f..3cb3d0e99cd 100644 --- a/modules/capability/capability_test.go +++ b/modules/capability/capability_test.go @@ -35,7 +35,7 @@ func (suite *CapabilityTestSuite) SetupTest() { cdc := app.AppCodec() // create new keeper so we can define custom scoping before init and seal - keeper := keeper.NewKeeper(cdc, app.GetKey(types.StoreKey), app.GetKey(types.MemStoreKey)) + keeper := keeper.NewKeeper(cdc, app.GetKey(types.StoreKey), app.GetMemKey(types.MemStoreKey)) suite.app = app suite.ctx = app.BaseApp.NewContext(checkTx) @@ -62,7 +62,7 @@ func (suite *CapabilityTestSuite) TestInitializeMemStore() { newKeeper.Seal() suite.Require().False(newKeeper.IsInitialized(ctx), "memstore initialized flag set before BeginBlock") - // Mock app beginblock and ensure that no gas has been consumed and memstore is initialized + // Mock app BeginBlock and ensure that no gas has been consumed and memstore is initialized ctx = suite.app.BaseApp.NewContext(false) prevBlockGas := ctx.BlockGasMeter().GasConsumed() @@ -81,8 +81,8 @@ func (suite *CapabilityTestSuite) TestInitializeMemStore() { // Mock the first transaction getting capability and subsequently failing // by using a cached context and discarding all cached writes. cacheCtx, _ := ctx.CacheContext() - capability, ok := newSk1.GetCapability(cacheCtx, "transfer") - suite.Require().NotNil(capability) + transferCapability, ok := newSk1.GetCapability(cacheCtx, "transfer") + suite.Require().NotNil(transferCapability) suite.Require().True(ok) // Ensure that the second transaction can still receive capability even if first tx fails. @@ -94,7 +94,8 @@ func (suite *CapabilityTestSuite) TestInitializeMemStore() { // Ensure the capabilities don't get reinitialized on next BeginBlock // by testing to see if capability returns same pointer // also check that initialized flag is still set - restartedModule.BeginBlock(ctx) + err = restartedModule.BeginBlock(ctx) + suite.Require().NoError(err) recap, ok := newSk1.GetCapability(ctx, "transfer") suite.Require().True(ok) suite.Require().Equal(cap1, recap, "capabilities got reinitialized after second BeginBlock") diff --git a/modules/capability/genesis.go b/modules/capability/genesis.go index 06c233027dc..b9a274d1023 100644 --- a/modules/capability/genesis.go +++ b/modules/capability/genesis.go @@ -26,7 +26,7 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) // ExportGenesis returns the capability module's exported genesis. func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { index := k.GetLatestIndex(ctx) - owners := []types.GenesisOwners{} + var owners []types.GenesisOwners for i := uint64(1); i < index; i++ { capabilityOwners, ok := k.GetOwners(ctx, i)