diff --git a/store/snapshots/store_test.go b/store/snapshots/store_test.go index ada6568d00d9..0b11d12ddca3 100644 --- a/store/snapshots/store_test.go +++ b/store/snapshots/store_test.go @@ -346,8 +346,7 @@ func TestStore_Save(t *testing.T) { assert.Equal(t, []uint64{7, 7}, gotErrHeights) } -type ReadCloserMock struct { -} +type ReadCloserMock struct{} func (r ReadCloserMock) Read(p []byte) (n int, err error) { return len(p), io.EOF diff --git a/tests/e2e/accounts/lockup/continous_lockup_test_suite.go b/tests/e2e/accounts/lockup/continous_lockup_test_suite.go index e331579cb6c4..dfb7ed1c76d8 100644 --- a/tests/e2e/accounts/lockup/continous_lockup_test_suite.go +++ b/tests/e2e/accounts/lockup/continous_lockup_test_suite.go @@ -131,7 +131,7 @@ func (s *E2ETestSuite) TestContinuousLockingAccount() { require.NotNil(t, del) // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(t, ctx, app, accountAddr) + lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) delLocking := lockupAccountInfoResponse.DelegatedLocking require.True(t, delLocking.AmountOf("stake").Equal(math.NewInt(100))) }) @@ -164,7 +164,7 @@ func (s *E2ETestSuite) TestContinuousLockingAccount() { require.Equal(t, len(ubd.Entries), 1) // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(t, ctx, app, accountAddr) + lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) delLocking := lockupAccountInfoResponse.DelegatedLocking require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) }) @@ -194,7 +194,7 @@ func (s *E2ETestSuite) TestContinuousLockingAccount() { require.NotNil(t, del) // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(t, ctx, app, accountAddr) + lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) delLocking := lockupAccountInfoResponse.DelegatedLocking require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) delFree := lockupAccountInfoResponse.DelegatedFree diff --git a/tests/e2e/accounts/lockup/delayed_lockup_test_suite.go b/tests/e2e/accounts/lockup/delayed_lockup_test_suite.go index 1b5a8784eeb7..4de723a49869 100644 --- a/tests/e2e/accounts/lockup/delayed_lockup_test_suite.go +++ b/tests/e2e/accounts/lockup/delayed_lockup_test_suite.go @@ -93,7 +93,7 @@ func (s *E2ETestSuite) TestDelayedLockingAccount() { require.NotNil(t, del) // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(t, ctx, app, accountAddr) + lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) delLocking := lockupAccountInfoResponse.DelegatedLocking require.True(t, delLocking.AmountOf("stake").Equal(math.NewInt(100))) }) @@ -126,7 +126,7 @@ func (s *E2ETestSuite) TestDelayedLockingAccount() { require.Equal(t, len(ubd.Entries), 1) // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(t, ctx, app, accountAddr) + lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) delLocking := lockupAccountInfoResponse.DelegatedLocking require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) }) diff --git a/tests/e2e/accounts/lockup/periodic_lockup_test_suite.go b/tests/e2e/accounts/lockup/periodic_lockup_test_suite.go index 33be5172452d..8e36befcc091 100644 --- a/tests/e2e/accounts/lockup/periodic_lockup_test_suite.go +++ b/tests/e2e/accounts/lockup/periodic_lockup_test_suite.go @@ -37,7 +37,8 @@ func (s *E2ETestSuite) TestPeriodicLockingAccount() { { Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(500))), Length: time.Minute, - }, { + }, + { Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(500))), Length: time.Minute, }, @@ -153,7 +154,7 @@ func (s *E2ETestSuite) TestPeriodicLockingAccount() { require.NotNil(t, del) // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(t, ctx, app, accountAddr) + lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) fmt.Println(lockupAccountInfoResponse) delLocking := lockupAccountInfoResponse.DelegatedLocking require.True(t, delLocking.AmountOf("stake").Equal(math.NewInt(100))) @@ -187,7 +188,7 @@ func (s *E2ETestSuite) TestPeriodicLockingAccount() { require.Equal(t, len(ubd.Entries), 1) // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(t, ctx, app, accountAddr) + lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) delLocking := lockupAccountInfoResponse.DelegatedLocking require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) }) @@ -217,7 +218,7 @@ func (s *E2ETestSuite) TestPeriodicLockingAccount() { require.NotNil(t, del) // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(t, ctx, app, accountAddr) + lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) delFree := lockupAccountInfoResponse.DelegatedFree require.True(t, delFree.AmountOf("stake").Equal(math.NewInt(100))) }) diff --git a/tests/e2e/accounts/lockup/permanent_lockup_test_suite.go b/tests/e2e/accounts/lockup/permanent_lockup_test_suite.go index 2ddec4ddf30b..225bc13caf98 100644 --- a/tests/e2e/accounts/lockup/permanent_lockup_test_suite.go +++ b/tests/e2e/accounts/lockup/permanent_lockup_test_suite.go @@ -77,7 +77,7 @@ func (s *E2ETestSuite) TestPermanentLockingAccount() { require.NotNil(t, del) // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(t, ctx, app, accountAddr) + lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) delLocking := lockupAccountInfoResponse.DelegatedLocking require.True(t, delLocking.AmountOf("stake").Equal(math.NewInt(100))) }) @@ -110,7 +110,7 @@ func (s *E2ETestSuite) TestPermanentLockingAccount() { require.Equal(t, len(ubd.Entries), 1) // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(t, ctx, app, accountAddr) + lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) delLocking := lockupAccountInfoResponse.DelegatedLocking require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) }) diff --git a/tests/e2e/accounts/lockup/utils.go b/tests/e2e/accounts/lockup/utils.go index f636459dd066..b1a90d7ece72 100644 --- a/tests/e2e/accounts/lockup/utils.go +++ b/tests/e2e/accounts/lockup/utils.go @@ -61,14 +61,14 @@ func (s *E2ETestSuite) fundAccount(app *simapp.SimApp, ctx sdk.Context, addr sdk require.NoError(s.T(), testutil.FundAccount(ctx, app.BankKeeper, addr, amt)) } -func (s *E2ETestSuite) queryLockupAccInfo(t *testing.T, ctx sdk.Context, app *simapp.SimApp, accAddr []byte) *types.QueryLockupAccountInfoResponse { +func (s *E2ETestSuite) queryLockupAccInfo(ctx sdk.Context, app *simapp.SimApp, accAddr []byte) *types.QueryLockupAccountInfoResponse { req := &types.QueryLockupAccountInfoRequest{} resp, err := s.queryAcc(ctx, req, app, accAddr) - require.NoError(t, err) - require.NotNil(t, resp) + require.NoError(s.T(), err) + require.NotNil(s.T(), resp) lockupAccountInfoResponse, ok := resp.(*types.QueryLockupAccountInfoResponse) - require.True(t, ok) + require.True(s.T(), ok) return lockupAccountInfoResponse }