Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use NotEmpty(x) instead NotZero(len(x)) #6076

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions e2e/tests/interchain_accounts/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions e2e/tests/interchain_accounts/localhost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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)
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/interchain_accounts/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/interchain_accounts/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/interchain_accounts/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/upgrades/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading