From d0e3cbd1804d7cdf98f66a30a24c72a904196ba8 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Tue, 2 Apr 2024 12:11:48 +0200 Subject: [PATCH] chore: use notempty instead notzero --- e2e/tests/interchain_accounts/base_test.go | 8 ++++---- e2e/tests/interchain_accounts/localhost_test.go | 12 ++++++------ e2e/tests/interchain_accounts/params_test.go | 2 +- e2e/tests/interchain_accounts/query_test.go | 2 +- e2e/tests/interchain_accounts/upgrades_test.go | 2 +- e2e/tests/upgrades/genesis_test.go | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/e2e/tests/interchain_accounts/base_test.go b/e2e/tests/interchain_accounts/base_test.go index 69e25617992..e9ee29cf446 100644 --- a/e2e/tests/interchain_accounts/base_test.go +++ b/e2e/tests/interchain_accounts/base_test.go @@ -90,7 +90,7 @@ func (s *InterchainAccountsTestSuite) testMsgSendTxSuccessfulTransfer(order chan var err error hostAccount, err = s.QueryInterchainAccount(ctx, chainA, controllerAddress, ibctesting.FirstConnectionID) s.Require().NoError(err) - s.Require().NotZero(len(hostAccount)) + s.Require().NotEmpty(hostAccount) channels, err := relayer.GetChannels(ctx, s.GetRelayerExecReporter(), chainA.Config().ChainID) s.Require().NoError(err) @@ -189,7 +189,7 @@ func (s *InterchainAccountsTestSuite) TestMsgSendTx_FailedTransfer_InsufficientF var err error hostAccount, err = s.QueryInterchainAccount(ctx, chainA, controllerAddress, ibctesting.FirstConnectionID) s.Require().NoError(err) - s.Require().NotZero(len(hostAccount)) + s.Require().NotEmpty(hostAccount) channels, err := relayer.GetChannels(ctx, s.GetRelayerExecReporter(), chainA.Config().ChainID) s.Require().NoError(err) @@ -287,7 +287,7 @@ func (s *InterchainAccountsTestSuite) TestMsgSendTx_SuccessfulTransfer_AfterReop var err error hostAccount, err = s.QueryInterchainAccount(ctx, chainA, controllerAddress, ibctesting.FirstConnectionID) s.Require().NoError(err) - s.Require().NotZero(len(hostAccount)) + s.Require().NotEmpty(hostAccount) _, err = s.QueryChannel(ctx, chainA, portID, initialChannelID) s.Require().NoError(err) @@ -467,7 +467,7 @@ func (s *InterchainAccountsTestSuite) testMsgSendTxSuccessfulGovProposal(order c var err error hostAccount, err = s.QueryInterchainAccount(ctx, chainA, controllerAddress, ibctesting.FirstConnectionID) s.Require().NoError(err) - s.Require().NotZero(len(hostAccount)) + s.Require().NotEmpty(hostAccount) channels, err := relayer.GetChannels(ctx, s.GetRelayerExecReporter(), chainA.Config().ChainID) s.Require().NoError(err) diff --git a/e2e/tests/interchain_accounts/localhost_test.go b/e2e/tests/interchain_accounts/localhost_test.go index fdd875686e4..e7d9ad19078 100644 --- a/e2e/tests/interchain_accounts/localhost_test.go +++ b/e2e/tests/interchain_accounts/localhost_test.go @@ -122,7 +122,7 @@ func (s *LocalhostInterchainAccountsTestSuite) TestInterchainAccounts_Localhost( t.Run("verify interchain account registration and deposit funds", func(t *testing.T) { interchainAccAddress, err := s.QueryInterchainAccount(ctx, chainA, userAWallet.FormattedAddress(), exported.LocalhostConnectionID) s.Require().NoError(err) - s.Require().NotZero(len(interchainAccAddress)) + s.Require().NotEmpty(interchainAccAddress) walletAmount := ibc.WalletAmount{ Address: interchainAccAddress, @@ -136,7 +136,7 @@ func (s *LocalhostInterchainAccountsTestSuite) TestInterchainAccounts_Localhost( t.Run("send packet localhost interchain accounts", func(t *testing.T) { interchainAccAddress, err := s.QueryInterchainAccount(ctx, chainA, userAWallet.FormattedAddress(), exported.LocalhostConnectionID) s.Require().NoError(err) - s.Require().NotZero(len(interchainAccAddress)) + s.Require().NotEmpty(interchainAccAddress) msgSend := &banktypes.MsgSend{ FromAddress: interchainAccAddress, @@ -277,7 +277,7 @@ func (s *LocalhostInterchainAccountsTestSuite) TestInterchainAccounts_ReopenChan t.Run("verify interchain account registration and deposit funds", func(t *testing.T) { interchainAccAddress, err := s.QueryInterchainAccount(ctx, chainA, userAWallet.FormattedAddress(), exported.LocalhostConnectionID) s.Require().NoError(err) - s.Require().NotZero(len(interchainAccAddress)) + s.Require().NotEmpty(interchainAccAddress) walletAmount := ibc.WalletAmount{ Address: interchainAccAddress, @@ -291,7 +291,7 @@ func (s *LocalhostInterchainAccountsTestSuite) TestInterchainAccounts_ReopenChan t.Run("send localhost interchain accounts packet with timeout", func(t *testing.T) { interchainAccAddress, err := s.QueryInterchainAccount(ctx, chainA, userAWallet.FormattedAddress(), exported.LocalhostConnectionID) s.Require().NoError(err) - s.Require().NotZero(len(interchainAccAddress)) + s.Require().NotEmpty(interchainAccAddress) msgSend := &banktypes.MsgSend{ FromAddress: interchainAccAddress, @@ -407,7 +407,7 @@ func (s *LocalhostInterchainAccountsTestSuite) TestInterchainAccounts_ReopenChan t.Run("verify interchain account and existing balance", func(t *testing.T) { interchainAccAddress, err := s.QueryInterchainAccount(ctx, chainA, userAWallet.FormattedAddress(), exported.LocalhostConnectionID) s.Require().NoError(err) - s.Require().NotZero(len(interchainAccAddress)) + s.Require().NotEmpty(interchainAccAddress) balance, err := s.QueryBalance(ctx, chainA, interchainAccAddress, chainADenom) s.Require().NoError(err) @@ -419,7 +419,7 @@ func (s *LocalhostInterchainAccountsTestSuite) TestInterchainAccounts_ReopenChan t.Run("send packet localhost interchain accounts", func(t *testing.T) { interchainAccAddress, err := s.QueryInterchainAccount(ctx, chainA, userAWallet.FormattedAddress(), exported.LocalhostConnectionID) s.Require().NoError(err) - s.Require().NotZero(len(interchainAccAddress)) + s.Require().NotEmpty(interchainAccAddress) msgSend := &banktypes.MsgSend{ FromAddress: interchainAccAddress, diff --git a/e2e/tests/interchain_accounts/params_test.go b/e2e/tests/interchain_accounts/params_test.go index 4cd18c0c063..866ef71ebcb 100644 --- a/e2e/tests/interchain_accounts/params_test.go +++ b/e2e/tests/interchain_accounts/params_test.go @@ -155,7 +155,7 @@ func (s *InterchainAccountsParamsTestSuite) TestHostEnabledParam() { var err error hostAccount, err = s.QueryInterchainAccount(ctx, chainA, controllerAddress, ibctesting.FirstConnectionID) s.Require().NoError(err) - s.Require().NotZero(len(hostAccount)) + s.Require().NotEmpty(hostAccount) channels, err := relayer.GetChannels(ctx, s.GetRelayerExecReporter(), chainA.Config().ChainID) s.Require().NoError(err) diff --git a/e2e/tests/interchain_accounts/query_test.go b/e2e/tests/interchain_accounts/query_test.go index b8db5f067a6..789f5d7b891 100644 --- a/e2e/tests/interchain_accounts/query_test.go +++ b/e2e/tests/interchain_accounts/query_test.go @@ -66,7 +66,7 @@ func (s *InterchainAccountsQueryTestSuite) TestInterchainAccountsQuery() { var err error hostAccount, err = s.QueryInterchainAccount(ctx, chainA, controllerAddress, ibctesting.FirstConnectionID) s.Require().NoError(err) - s.Require().NotZero(len(hostAccount)) + s.Require().NotEmpty(hostAccount) channels, err := relayer.GetChannels(ctx, s.GetRelayerExecReporter(), chainA.Config().ChainID) s.Require().NoError(err) diff --git a/e2e/tests/interchain_accounts/upgrades_test.go b/e2e/tests/interchain_accounts/upgrades_test.go index ddfe321f2ef..bd27e276f0f 100644 --- a/e2e/tests/interchain_accounts/upgrades_test.go +++ b/e2e/tests/interchain_accounts/upgrades_test.go @@ -80,7 +80,7 @@ func (s *InterchainAccountsChannelUpgradesTestSuite) TestMsgSendTx_SuccessfulTra var err error hostAccount, err = s.QueryInterchainAccount(ctx, chainA, controllerAddress, ibctesting.FirstConnectionID) s.Require().NoError(err) - s.Require().NotZero(len(hostAccount)) + s.Require().NotEmpty(hostAccount) _, err = s.QueryChannel(ctx, chainA, portID, initialChannelID) s.Require().NoError(err) diff --git a/e2e/tests/upgrades/genesis_test.go b/e2e/tests/upgrades/genesis_test.go index 3a39f041aae..2e2d1850e03 100644 --- a/e2e/tests/upgrades/genesis_test.go +++ b/e2e/tests/upgrades/genesis_test.go @@ -115,7 +115,7 @@ func (s *GenesisTestSuite) TestIBCGenesis() { var err error hostAccount, err = s.QueryInterchainAccount(ctx, chainA, controllerAddress, ibctesting.FirstConnectionID) s.Require().NoError(err) - s.Require().NotZero(len(hostAccount)) + s.Require().NotEmpty(hostAccount) channels, err := relayer.GetChannels(ctx, s.GetRelayerExecReporter(), chainA.Config().ChainID) s.Require().NoError(err)