Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Dec 15, 2023
1 parent bc793c4 commit 83f9482
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions crypto/quorum.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ func (i *SignItem) Validate() error {
return fmt.Errorf("invalid request ID size: %X", i.ReqID)
}
if len(i.Hash) != DefaultHashSize {
return fmt.Errorf("invalid hash size: %X", i.ReqID)
return fmt.Errorf("invalid hash size %d: %X", len(i.Hash), i.Hash)
}
if len(i.QuorumHash) != DefaultHashSize {
return fmt.Errorf("invalid quorum hash size: %X", i.ReqID)
return fmt.Errorf("invalid quorum hash size %d: %X", len(i.QuorumHash), i.QuorumHash)
}
if len(i.Raw) > 0 {
if !bytes.Equal(Checksum(i.Raw), i.Hash) {
Expand Down
4 changes: 2 additions & 2 deletions privval/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func TestSignVote(t *testing.T) {
}

for _, c := range cases {
assert.Error(t, privVal.SignVote(ctx, "mychainid", 0, crypto.QuorumHash{}, c.ToProto(), nil),
assert.Error(t, privVal.SignVote(ctx, "mychainid", 0, quorumHash, c.ToProto(), nil),
"expected error on signing conflicting vote")
}

Expand Down Expand Up @@ -289,7 +289,7 @@ func TestSignProposal(t *testing.T) {
}

for _, c := range cases {
_, err = privVal.SignProposal(ctx, "mychainid", 0, crypto.QuorumHash{}, c.ToProto())
_, err = privVal.SignProposal(ctx, "mychainid", 0, quorumHash, c.ToProto())
assert.Error(t, err, "expected error on signing conflicting proposal")
}
}
Expand Down
2 changes: 1 addition & 1 deletion types/evidence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func TestEvidenceVectors(t *testing.T) {
}{
{"duplicateVoteEvidence",
EvidenceList{&DuplicateVoteEvidence{VoteA: v2, VoteB: v}},
"87904f3525bfdb8474a18bc44fcadf76f63f0e7cabc3063f5eae8dcf0eb11d79",
"54b4c93161a227c5387bd5da81b533c399097877217d08d1f579038a9c527775",
},
}

Expand Down

0 comments on commit 83f9482

Please sign in to comment.