Skip to content

Commit

Permalink
test(types): wrong quorum hash when verifying commits
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed May 20, 2024
1 parent b7699c3 commit a792f5a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions types/validation_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package types

import (
"bytes"
"context"
"testing"

Expand Down Expand Up @@ -101,6 +102,15 @@ func TestValidatorSet_VerifyCommit_All(t *testing.T) {
QuorumSigns: QuorumSigns{BlockSign: vote2.BlockSignature, VoteExtensionSignatures: vote2.VoteExtensions.GetSignatures()},
},
), true},
// quorum hash mismatch
{"wrong quorum hash", chainID, vote.BlockID, vote.Height,
NewCommit(vote.Height, vote.Round, vote.BlockID,
vote.VoteExtensions,
&CommitSigns{
QuorumHash: bytes.Repeat([]byte{0xaa}, crypto.QuorumHashSize),
QuorumSigns: QuorumSigns{BlockSign: vote2.BlockSignature, VoteExtensionSignatures: vote2.VoteExtensions.GetSignatures()},
},
), true},
}

for _, tc := range testCases {
Expand Down

0 comments on commit a792f5a

Please sign in to comment.