Skip to content

Commit

Permalink
test(consensus): apply rabbit feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Dec 11, 2024
1 parent 47c8da0 commit b1c915d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions internal/consensus/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3283,7 +3283,6 @@ func TestStateTryAddCommitPanicsOnClientError(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
config := configSetup(t)
t.Helper()

// setup some node and commit
genDoc, privVals := factory.RandGenesisDoc(1, factory.ConsensusParams())
Expand All @@ -3299,7 +3298,8 @@ func TestStateTryAddCommitPanicsOnClientError(t *testing.T) {
Once()

// create a new consensus state
proTxHash, _ := privVals[0].GetProTxHash(ctx)
proTxHash, err := privVals[0].GetProTxHash(ctx)
require.NoError(t, err)
ctx = dash.ContextWithProTxHash(ctx, proTxHash)
consensusState := newStateWithConfig(ctx, t, logger, config, state, privVals[0], app)

Expand Down Expand Up @@ -3346,10 +3346,11 @@ func TestStateTryAddCommitPanicsOnClientError(t *testing.T) {
PeerID: peerID,
ReceiveTime: time.Time{},
})

assert.Panics(t, func() {
_ = consensusState.ctrl.Dispatch(ctx, &TryAddCommitEvent{Commit: commit, PeerID: peerID}, &stateData)
})
assert.PanicsWithError(t,
"ABCI client stopped, Tenderdash needs to be restarted: ProcessProposal abci method: client has stopped",
func() {
_ = consensusState.ctrl.Dispatch(ctx, &TryAddCommitEvent{Commit: commit, PeerID: peerID}, &stateData)
})
}

// TestStateTimestamp_ProposalMatch tests that a validator prevotes a
Expand Down

0 comments on commit b1c915d

Please sign in to comment.