Skip to content

Commit d8980f9

Browse files
authored
test: fix TestStateDoesntCrashOnInvalidVote (#4439)
1 parent ce0949e commit d8980f9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

consensus/state_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,12 @@ func TestStateDoesntCrashOnInvalidVote(t *testing.T) {
19491949

19501950
startTestRound(cs, height, round)
19511951

1952-
vote := signVote(vss[1], cmtproto.PrecommitType, nil, types.PartSetHeader{}, true)
1952+
_, propBlock := decideProposal(context.Background(), t, cs, vss[0], height, round)
1953+
propBlockParts, err := propBlock.MakePartSet(types.BlockPartSizeBytes)
1954+
assert.NoError(t, err)
1955+
1956+
vote := signVote(vss[1], cmtproto.PrecommitType, propBlock.Hash(), propBlockParts.Header(), true)
1957+
19531958
// Non-existent validator index
19541959
vote.ValidatorIndex = int32(len(vss))
19551960

0 commit comments

Comments
 (0)