From 6f1061b25075755c0742821259ad5899dc023ae3 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Thu, 1 Feb 2024 00:53:19 -0700 Subject: [PATCH] fix seq num issue --- tests/e2e/auth/vesting/suite.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/e2e/auth/vesting/suite.go b/tests/e2e/auth/vesting/suite.go index b4ba549ba717..c96cdb496f3a 100644 --- a/tests/e2e/auth/vesting/suite.go +++ b/tests/e2e/auth/vesting/suite.go @@ -358,6 +358,12 @@ func (s *E2ETestSuite) TestNewMsgCreateClawbackVestingAccountCmd() { expectErr: true, }, } { + // Synchronize height between test runs, to ensure sequence numbers are + // properly updated. + height, err := s.network.LatestHeight() + s.Require().NoError(err, "Getting initial latest height") + s.T().Logf("Initial latest height: %d", height) + s.Run(tc.name, func() { clientCtx := val.ClientCtx @@ -372,6 +378,10 @@ func (s *E2ETestSuite) TestNewMsgCreateClawbackVestingAccountCmd() { s.Require().Equal(tc.expectedCode, txResp.Code) } }) + next, err := s.network.WaitForHeight(height + 1) + s.Require().NoError(err, "Waiting for height...") + height = next + s.T().Logf("Height now: %d", height) } } @@ -395,6 +405,16 @@ func (s *E2ETestSuite) TestNewMsgClawbackCmd() { }) s.Require().NoError(err) + // Synchronize height between test runs, to ensure sequence numbers are + // properly updated. + height, err := s.network.LatestHeight() + s.Require().NoError(err, "Getting initial latest height") + s.T().Logf("Initial latest height: %d", height) + next, err := s.network.WaitForHeight(height + 1) + s.Require().NoError(err, "Waiting for height...") + height = next + s.T().Logf("Height now: %d", height) + for _, tc := range []struct { name string args []string @@ -445,6 +465,12 @@ func (s *E2ETestSuite) TestNewMsgClawbackCmd() { respType: &sdk.TxResponse{}, }, } { + // Synchronize height between test runs, to ensure sequence numbers are + // properly updated. + height, err := s.network.LatestHeight() + s.Require().NoError(err, "Getting initial latest height") + s.T().Logf("Initial latest height: %d", height) + s.Run(tc.name, func() { clientCtx := val.ClientCtx @@ -459,5 +485,9 @@ func (s *E2ETestSuite) TestNewMsgClawbackCmd() { s.Require().Equal(tc.expectedCode, txResp.Code) } }) + next, err := s.network.WaitForHeight(height + 1) + s.Require().NoError(err, "Waiting for height...") + height = next + s.T().Logf("Height now: %d", height) } }