diff --git a/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations_test.go b/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations_test.go index f0aebd099e4..5c6ce64e154 100644 --- a/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations_test.go +++ b/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations_test.go @@ -95,7 +95,7 @@ func (suite *MigrationsTestSuite) TestMigrateICS27ChannelCapability() { suite.CreateMockCapabilities() // create and claim a new capability with ibc/mock for "channel-1" - // note: s.SetupPath() now claims the chanel capability using icacontroller for "channel-0" + // note: suite.SetupPath() now claims the chanel capability using icacontroller for "channel-0" capName := host.ChannelCapabilityPath(suite.path.EndpointA.ChannelConfig.PortID, channeltypes.FormatChannelIdentifier(1)) capability, err := suite.chainA.GetSimApp().ScopedIBCKeeper.NewCapability(suite.chainA.GetContext(), capName) diff --git a/modules/capability/genesis_test.go b/modules/capability/genesis_test.go index 659d89fd633..70812eefc2a 100644 --- a/modules/capability/genesis_test.go +++ b/modules/capability/genesis_test.go @@ -9,43 +9,43 @@ import ( "github.com/cosmos/ibc-go/modules/capability/types" ) -func (s *CapabilityTestSuite) TestGenesis() { +func (suite *CapabilityTestSuite) TestGenesis() { // InitGenesis must be called in order to set the intial index to 1. - capability.InitGenesis(s.ctx, *s.keeper, *types.DefaultGenesis()) + capability.InitGenesis(suite.ctx, *suite.keeper, *types.DefaultGenesis()) - sk1 := s.keeper.ScopeToModule(banktypes.ModuleName) - sk2 := s.keeper.ScopeToModule(stakingtypes.ModuleName) + sk1 := suite.keeper.ScopeToModule(banktypes.ModuleName) + sk2 := suite.keeper.ScopeToModule(stakingtypes.ModuleName) - cap1, err := sk1.NewCapability(s.ctx, "transfer") - s.Require().NoError(err) - s.Require().NotNil(cap1) + cap1, err := sk1.NewCapability(suite.ctx, "transfer") + suite.Require().NoError(err) + suite.Require().NotNil(cap1) - err = sk2.ClaimCapability(s.ctx, cap1, "transfer") - s.Require().NoError(err) + err = sk2.ClaimCapability(suite.ctx, cap1, "transfer") + suite.Require().NoError(err) - cap2, err := sk2.NewCapability(s.ctx, "ica") - s.Require().NoError(err) - s.Require().NotNil(cap2) + cap2, err := sk2.NewCapability(suite.ctx, "ica") + suite.Require().NoError(err) + suite.Require().NotNil(cap2) - genState := capability.ExportGenesis(s.ctx, *s.keeper) + genState := capability.ExportGenesis(suite.ctx, *suite.keeper) - newKeeper := keeper.NewKeeper(s.cdc, s.storeKey, s.memStoreKey) + newKeeper := keeper.NewKeeper(suite.cdc, suite.storeKey, suite.memStoreKey) newSk1 := newKeeper.ScopeToModule(banktypes.ModuleName) newSk2 := newKeeper.ScopeToModule(stakingtypes.ModuleName) - deliverCtx := s.NewTestContext() + deliverCtx := suite.NewTestContext() capability.InitGenesis(deliverCtx, *newKeeper, *genState) // check that all previous capabilities exist in new app after InitGenesis sk1Cap1, ok := newSk1.GetCapability(deliverCtx, "transfer") - s.Require().True(ok, "could not get first capability after genesis on first ScopedKeeper") - s.Require().Equal(*cap1, *sk1Cap1, "capability values not equal on first ScopedKeeper") + suite.Require().True(ok, "could not get first capability after genesis on first ScopedKeeper") + suite.Require().Equal(*cap1, *sk1Cap1, "capability values not equal on first ScopedKeeper") sk2Cap1, ok := newSk2.GetCapability(deliverCtx, "transfer") - s.Require().True(ok, "could not get first capability after genesis on first ScopedKeeper") - s.Require().Equal(*cap1, *sk2Cap1, "capability values not equal on first ScopedKeeper") + suite.Require().True(ok, "could not get first capability after genesis on first ScopedKeeper") + suite.Require().Equal(*cap1, *sk2Cap1, "capability values not equal on first ScopedKeeper") sk2Cap2, ok := newSk2.GetCapability(deliverCtx, "ica") - s.Require().True(ok, "could not get second capability after genesis on second ScopedKeeper") - s.Require().Equal(*cap2, *sk2Cap2, "capability values not equal on second ScopedKeeper") + suite.Require().True(ok, "could not get second capability after genesis on second ScopedKeeper") + suite.Require().Equal(*cap2, *sk2Cap2, "capability values not equal on second ScopedKeeper") } diff --git a/modules/core/02-client/keeper/client_test.go b/modules/core/02-client/keeper/client_test.go index d5e6c6d214c..99dcd861647 100644 --- a/modules/core/02-client/keeper/client_test.go +++ b/modules/core/02-client/keeper/client_test.go @@ -96,7 +96,7 @@ func (suite *KeeperTestSuite) TestUpdateClientTendermint() { updateHeader *ibctm.Header ) - // Must create header creation functions since s.header gets recreated on each test case + // Must create header creation functions since suite.header gets recreated on each test case createFutureUpdateFn := func(trustedHeight clienttypes.Height) *ibctm.Header { header, err := suite.chainA.ConstructUpdateTMClientHeaderWithTrustedHeight(path.EndpointB.Chain, path.EndpointA.ClientID, trustedHeight) suite.Require().NoError(err) @@ -144,7 +144,7 @@ func (suite *KeeperTestSuite) TestUpdateClientTendermint() { _, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientConsensusState(suite.chainA.GetContext(), path.EndpointA.ClientID, fillHeight) suite.Require().False(found) - // updateHeader will fill in consensus state between prevConsState and s.consState + // updateHeader will fill in consensus state between prevConsState and suite.consState // clientState should not be updated updateHeader = createPastUpdateFn(fillHeight, trustedHeight) }, true, false}, @@ -172,7 +172,7 @@ func (suite *KeeperTestSuite) TestUpdateClientTendermint() { path.EndpointA.SetClientState(clientState) height3 := clienttypes.NewHeight(1, 3) - // updateHeader will fill in consensus state between prevConsState and s.consState + // updateHeader will fill in consensus state between prevConsState and suite.consState // clientState should not be updated updateHeader = createPastUpdateFn(height3, height1) // set updateHeader's consensus state in store to create duplicate UpdateClient scenario @@ -198,7 +198,7 @@ func (suite *KeeperTestSuite) TestUpdateClientTendermint() { suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientConsensusState(suite.chainA.GetContext(), clientID, height5, nextConsState) height3 := clienttypes.NewHeight(1, 3) - // updateHeader will fill in consensus state between prevConsState and s.consState + // updateHeader will fill in consensus state between prevConsState and suite.consState // clientState should not be updated updateHeader = createPastUpdateFn(height3, height1) // set conflicting consensus state in store to create misbehaviour scenario diff --git a/modules/core/ante/ante_test.go b/modules/core/ante/ante_test.go index 217a082127f..649390d30f5 100644 --- a/modules/core/ante/ante_test.go +++ b/modules/core/ante/ante_test.go @@ -177,12 +177,12 @@ func (suite *AnteTestSuite) createUpdateClientMessage() sdk.Msg { func (suite *AnteTestSuite) TestAnteDecorator() { testCases := []struct { name string - malleate func(antesuite *AnteTestSuite) []sdk.Msg + malleate func(suite *AnteTestSuite) []sdk.Msg expPass bool }{ { "success on one new RecvPacket message", - func(anteantesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { // the RecvPacket message has not been submitted to the chain yet, so it will succeed return []sdk.Msg{suite.createRecvPacketMessage(false)} }, @@ -190,7 +190,7 @@ func (suite *AnteTestSuite) TestAnteDecorator() { }, { "success on one new Acknowledgement message", - func(anteantesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { // the Acknowledgement message has not been submitted to the chain yet, so it will succeed return []sdk.Msg{suite.createAcknowledgementMessage(false)} }, @@ -198,7 +198,7 @@ func (suite *AnteTestSuite) TestAnteDecorator() { }, { "success on one new Timeout message", - func(anteantesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { // the Timeout message has not been submitted to the chain yet, so it will succeed return []sdk.Msg{suite.createTimeoutMessage(false)} }, @@ -206,7 +206,7 @@ func (suite *AnteTestSuite) TestAnteDecorator() { }, { "success on one new TimeoutOnClose message", - func(anteantesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { // the TimeoutOnClose message has not been submitted to the chain yet, so it will succeed return []sdk.Msg{suite.createTimeoutOnCloseMessage(false)} }, @@ -214,7 +214,7 @@ func (suite *AnteTestSuite) TestAnteDecorator() { }, { "success on three new messages of each type", - func(antesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { var msgs []sdk.Msg // none of the messages of each type has been submitted to the chain yet, @@ -243,7 +243,7 @@ func (suite *AnteTestSuite) TestAnteDecorator() { }, { "success on three redundant messages of RecvPacket, Acknowledgement and TimeoutOnClose, and one new Timeout message", - func(antesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { var msgs []sdk.Msg // we pass three messages of RecvPacket, Acknowledgement and TimeoutOnClose that @@ -273,7 +273,7 @@ func (suite *AnteTestSuite) TestAnteDecorator() { }, { "success on one new message and two redundant messages of each type", - func(antesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { var msgs []sdk.Msg // For each type there is a new message and two messages that are redundant @@ -303,21 +303,21 @@ func (suite *AnteTestSuite) TestAnteDecorator() { }, { "success on one new UpdateClient message", - func(antesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { return []sdk.Msg{suite.createUpdateClientMessage()} }, true, }, { "success on three new UpdateClient messages", - func(antesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { return []sdk.Msg{suite.createUpdateClientMessage(), suite.createUpdateClientMessage(), suite.createUpdateClientMessage()} }, true, }, { "success on three new Updateclient messages and one new RecvPacket message", - func(antesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { return []sdk.Msg{ suite.createUpdateClientMessage(), suite.createUpdateClientMessage(), @@ -329,7 +329,7 @@ func (suite *AnteTestSuite) TestAnteDecorator() { }, { "success on three redundant RecvPacket messages and one SubmitMisbehaviour message", - func(antesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { msgs := []sdk.Msg{suite.createUpdateClientMessage()} for i := 1; i <= 3; i++ { @@ -344,14 +344,14 @@ func (suite *AnteTestSuite) TestAnteDecorator() { }, { "no success on one redundant RecvPacket message", - func(antesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { return []sdk.Msg{suite.createRecvPacketMessage(true)} }, false, }, { "no success on three redundant messages of each type", - func(antesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { var msgs []sdk.Msg // from A to B @@ -376,7 +376,7 @@ func (suite *AnteTestSuite) TestAnteDecorator() { }, { "no success on one new UpdateClient message and three redundant RecvPacket messages", - func(antesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { msgs := []sdk.Msg{&clienttypes.MsgUpdateClient{}} for i := 1; i <= 3; i++ { @@ -389,7 +389,7 @@ func (suite *AnteTestSuite) TestAnteDecorator() { }, { "no success on three new UpdateClient messages and three redundant messages of each type", - func(antesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { msgs := []sdk.Msg{suite.createUpdateClientMessage(), suite.createUpdateClientMessage(), suite.createUpdateClientMessage()} // from A to B @@ -414,7 +414,7 @@ func (suite *AnteTestSuite) TestAnteDecorator() { }, { "no success on one new message and one invalid message", - func(antesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { packet := channeltypes.NewPacket(ibctesting.MockPacketData, 2, suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, suite.path.EndpointB.ChannelConfig.PortID, suite.path.EndpointB.ChannelID, @@ -429,7 +429,7 @@ func (suite *AnteTestSuite) TestAnteDecorator() { }, { "no success on one new message and one redundant message in the same block", - func(antesuite *AnteTestSuite) []sdk.Msg { + func(suite *AnteTestSuite) []sdk.Msg { msg := suite.createRecvPacketMessage(false) // We want to be able to run check tx with the non-redundant message without diff --git a/modules/light-clients/07-tendermint/tendermint_test.go b/modules/light-clients/07-tendermint/tendermint_test.go index 14ca78dd2db..48887f8ab72 100644 --- a/modules/light-clients/07-tendermint/tendermint_test.go +++ b/modules/light-clients/07-tendermint/tendermint_test.go @@ -99,13 +99,13 @@ func getAltSigners(altVal *tmtypes.Validator, altPrivVal tmtypes.PrivValidator) return map[string]tmtypes.PrivValidator{altVal.Address.String(): altPrivVal} } -func getBothSigners(s *TendermintTestSuite, altVal *tmtypes.Validator, altPrivVal tmtypes.PrivValidator) (*tmtypes.ValidatorSet, map[string]tmtypes.PrivValidator) { +func getBothSigners(suite *TendermintTestSuite, altVal *tmtypes.Validator, altPrivVal tmtypes.PrivValidator) (*tmtypes.ValidatorSet, map[string]tmtypes.PrivValidator) { // Create bothValSet with both suite validator and altVal. Would be valid update - bothValSet := tmtypes.NewValidatorSet(append(s.valSet.Validators, altVal)) + bothValSet := tmtypes.NewValidatorSet(append(suite.valSet.Validators, altVal)) // Create signer array and ensure it is in same order as bothValSet - _, suiteVal := s.valSet.GetByIndex(0) + _, suiteVal := suite.valSet.GetByIndex(0) bothSigners := map[string]tmtypes.PrivValidator{ - suiteVal.Address.String(): s.privVal, + suiteVal.Address.String(): suite.privVal, altVal.Address.String(): altPrivVal, } return bothValSet, bothSigners