From 418272ddc050a931addcc888238e40d26afdffa1 Mon Sep 17 00:00:00 2001 From: Sergio Mena Date: Tue, 29 Nov 2022 02:13:20 +0100 Subject: [PATCH] fixes1 --- consensus/reactor_test.go | 4 +--- consensus/state_test.go | 7 ++----- state/rollback_test.go | 6 +++--- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/consensus/reactor_test.go b/consensus/reactor_test.go index f38116688..114015b9c 100644 --- a/consensus/reactor_test.go +++ b/consensus/reactor_test.go @@ -356,9 +356,7 @@ func TestSwitchToConsensusVoteExtensions(t *testing.T) { }, } { t.Run(testCase.name, func(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), time.Second*15) - defer cancel() - cs, vs := makeState(ctx, t, makeStateArgs{validators: 1}) + cs, vs := randState(1) validator := vs[0] validator.Height = testCase.storedHeight diff --git a/consensus/state_test.go b/consensus/state_test.go index 0ef16fb36..032ca0af0 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -1796,10 +1796,6 @@ func TestVoteExtensionEnableHeight(t *testing.T) { }, } { t.Run(testCase.name, func(t *testing.T) { - config := configSetup(t) - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - numValidators := 3 m := abcimocks.NewApplication(t) m.On("ProcessProposal", mock.Anything, mock.Anything).Return(&abci.ResponseProcessProposal{ @@ -1818,7 +1814,8 @@ func TestVoteExtensionEnableHeight(t *testing.T) { m.On("Commit", mock.Anything).Return(&abci.ResponseCommit{}, nil).Maybe() c := test.ConsensusParams() c.ABCI.VoteExtensionsEnableHeight = testCase.enableHeight - cs1, vss := makeState(ctx, t, makeStateArgs{config: config, application: m, validators: numValidators, consensusParams: c}) + //consensusParams: c}) + cs1, vss := randStateWithApp(numValidators, m) cs1.state.ConsensusParams.ABCI.VoteExtensionsEnableHeight = testCase.enableHeight height, round := cs1.Height, cs1.Round diff --git a/state/rollback_test.go b/state/rollback_test.go index 3e8f33c82..9e2d03efc 100644 --- a/state/rollback_test.go +++ b/state/rollback_test.go @@ -118,7 +118,7 @@ func TestRollbackHard(t *testing.T) { partSet, err := block.MakePartSet(types.BlockPartSizeBytes) require.NoError(t, err) - blockStore.SaveBlock(block, partSet, &types.ExtendedCommit{Height: block.Height}) + blockStore.SaveBlock(block, partSet, &types.Commit{Height: block.Height}) currState := state.State{ Version: tmstate.Version{ @@ -160,7 +160,7 @@ func TestRollbackHard(t *testing.T) { nextPartSet, err := nextBlock.MakePartSet(types.BlockPartSizeBytes) require.NoError(t, err) - blockStore.SaveBlock(nextBlock, nextPartSet, &types.ExtendedCommit{Height: nextBlock.Height}) + blockStore.SaveBlock(nextBlock, nextPartSet, &types.Commit{Height: nextBlock.Height}) rollbackHeight, rollbackHash, err := state.Rollback(blockStore, stateStore, true) require.NoError(t, err) @@ -173,7 +173,7 @@ func TestRollbackHard(t *testing.T) { require.Equal(t, currState, loadedState) // resave the same block - blockStore.SaveBlock(nextBlock, nextPartSet, &types.ExtendedCommit{Height: nextBlock.Height}) + blockStore.SaveBlock(nextBlock, nextPartSet, &types.Commit{Height: nextBlock.Height}) params.Version.App = 11