From 8225c4d875e704b71b1ee597024b2fa669cca9da Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 11 Mar 2024 16:52:34 +0100 Subject: [PATCH] chore: make all keeper testsuite vars pointer receivers --- modules/core/02-client/keeper/keeper_test.go | 10 +++++----- modules/core/03-connection/keeper/keeper_test.go | 4 ++-- modules/core/04-channel/keeper/keeper_test.go | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/core/02-client/keeper/keeper_test.go b/modules/core/02-client/keeper/keeper_test.go index c879cdd0920..8b958e4af4a 100644 --- a/modules/core/02-client/keeper/keeper_test.go +++ b/modules/core/02-client/keeper/keeper_test.go @@ -229,7 +229,7 @@ func (suite *KeeperTestSuite) TestValidateSelfClient() { } } -func (suite KeeperTestSuite) TestGetAllGenesisClients() { //nolint:govet // this is a test, we are okay with copying locks +func (suite *KeeperTestSuite) TestGetAllGenesisClients() { clientIDs := []string{ exported.LocalhostClientID, testClientID2, testClientID3, testClientID, } @@ -252,7 +252,7 @@ func (suite KeeperTestSuite) TestGetAllGenesisClients() { //nolint:govet // this suite.Require().Equal(expGenClients.Sort(), genClients) } -func (suite KeeperTestSuite) TestGetAllGenesisMetadata() { //nolint:govet // this is a test, we are okay with copying locks +func (suite *KeeperTestSuite) TestGetAllGenesisMetadata() { clientA, clientB := "07-tendermint-1", "clientB" // create some starting state @@ -308,7 +308,7 @@ func (suite KeeperTestSuite) TestGetAllGenesisMetadata() { //nolint:govet // thi }) } -func (suite KeeperTestSuite) TestGetConsensusState() { //nolint:govet // this is a test, we are okay with copying locks +func (suite *KeeperTestSuite) TestGetConsensusState() { suite.ctx = suite.ctx.WithBlockHeight(10) cases := []struct { name string @@ -336,7 +336,7 @@ func (suite KeeperTestSuite) TestGetConsensusState() { //nolint:govet // this is // 2 clients in total are created on chainA. The first client is updated so it contains an initial consensus state // and a consensus state at the update height. -func (suite KeeperTestSuite) TestGetAllConsensusStates() { //nolint:govet // this is a test, we are okay with copying locks +func (suite *KeeperTestSuite) TestGetAllConsensusStates() { path := ibctesting.NewPath(suite.chainA, suite.chainB) path.SetupClients() @@ -385,7 +385,7 @@ func (suite KeeperTestSuite) TestGetAllConsensusStates() { //nolint:govet // thi suite.Require().Equal(expConsensusStates, consStates, "%s \n\n%s", expConsensusStates, consStates) } -func (suite KeeperTestSuite) TestIterateClientStates() { //nolint:govet // this is a test, we are okay with copying locks +func (suite *KeeperTestSuite) TestIterateClientStates() { paths := []*ibctesting.Path{ ibctesting.NewPath(suite.chainA, suite.chainB), ibctesting.NewPath(suite.chainA, suite.chainB), diff --git a/modules/core/03-connection/keeper/keeper_test.go b/modules/core/03-connection/keeper/keeper_test.go index 8cd9b157839..07d2d74b40a 100644 --- a/modules/core/03-connection/keeper/keeper_test.go +++ b/modules/core/03-connection/keeper/keeper_test.go @@ -61,7 +61,7 @@ func (suite *KeeperTestSuite) TestSetAndGetClientConnectionPaths() { } // create 2 connections: A0 - B0, A1 - B1 -func (suite KeeperTestSuite) TestGetAllConnections() { //nolint:govet // this is a test, we are okay with copying locks +func (suite *KeeperTestSuite) TestGetAllConnections() { path1 := ibctesting.NewPath(suite.chainA, suite.chainB) path1.SetupConnections() @@ -93,7 +93,7 @@ func (suite KeeperTestSuite) TestGetAllConnections() { //nolint:govet // this is // the test creates 2 clients path.EndpointA.ClientID0 and path.EndpointA.ClientID1. path.EndpointA.ClientID0 has a single // connection and path.EndpointA.ClientID1 has 2 connections. -func (suite KeeperTestSuite) TestGetAllClientConnectionPaths() { //nolint:govet // this is a test, we are okay with copying locks +func (suite *KeeperTestSuite) TestGetAllClientConnectionPaths() { path1 := ibctesting.NewPath(suite.chainA, suite.chainB) path2 := ibctesting.NewPath(suite.chainA, suite.chainB) path1.SetupConnections() diff --git a/modules/core/04-channel/keeper/keeper_test.go b/modules/core/04-channel/keeper/keeper_test.go index 9020f6b8d3c..146c87c45aa 100644 --- a/modules/core/04-channel/keeper/keeper_test.go +++ b/modules/core/04-channel/keeper/keeper_test.go @@ -170,7 +170,7 @@ func containsAll(expected, actual []types.IdentifiedChannel) bool { // TestGetAllChannels creates multiple channels on chain A through various connections // and tests their retrieval. 2 channels are on connA0 and 1 channel is on connA1 -func (suite KeeperTestSuite) TestGetAllChannels() { //nolint:govet // this is a test, we are okay with copying locks +func (suite *KeeperTestSuite) TestGetAllChannels() { path := ibctesting.NewPath(suite.chainA, suite.chainB) path.Setup() // channel0 on first connection on chainA @@ -234,7 +234,7 @@ func (suite KeeperTestSuite) TestGetAllChannels() { //nolint:govet // this is a // TestGetAllSequences sets all packet sequences for two different channels on chain A and // tests their retrieval. -func (suite KeeperTestSuite) TestGetAllSequences() { //nolint:govet // this is a test, we are okay with copying locks +func (suite *KeeperTestSuite) TestGetAllSequences() { path := ibctesting.NewPath(suite.chainA, suite.chainB) path.Setup() @@ -276,7 +276,7 @@ func (suite KeeperTestSuite) TestGetAllSequences() { //nolint:govet // this is a // TestGetAllPacketState creates a set of acks, packet commitments, and receipts on two different // channels on chain A and tests their retrieval. -func (suite KeeperTestSuite) TestGetAllPacketState() { //nolint:govet // this is a test, we are okay with copying locks +func (suite *KeeperTestSuite) TestGetAllPacketState() { path := ibctesting.NewPath(suite.chainA, suite.chainB) path.Setup()