Skip to content

Commit

Permalink
test: fix TestStateDoesntCrashOnInvalidVote (#4439)
Browse files Browse the repository at this point in the history
  • Loading branch information
melekes authored Nov 6, 2024
1 parent ce0949e commit d8980f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion consensus/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1949,7 +1949,12 @@ func TestStateDoesntCrashOnInvalidVote(t *testing.T) {

startTestRound(cs, height, round)

vote := signVote(vss[1], cmtproto.PrecommitType, nil, types.PartSetHeader{}, true)
_, propBlock := decideProposal(context.Background(), t, cs, vss[0], height, round)
propBlockParts, err := propBlock.MakePartSet(types.BlockPartSizeBytes)
assert.NoError(t, err)

vote := signVote(vss[1], cmtproto.PrecommitType, propBlock.Hash(), propBlockParts.Header(), true)

// Non-existent validator index
vote.ValidatorIndex = int32(len(vss))

Expand Down

0 comments on commit d8980f9

Please sign in to comment.