@@ -19,6 +19,8 @@ import (
19
19
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
20
20
tmversion "github.com/tendermint/tendermint/proto/tendermint/version"
21
21
22
+ vrf "github.com/oasisprotocol/curve25519-voi/primitives/ed25519/extra/ecvrf"
23
+
22
24
"github.com/Finschia/ostracon/crypto"
23
25
"github.com/Finschia/ostracon/crypto/merkle"
24
26
"github.com/Finschia/ostracon/crypto/tmhash"
@@ -27,7 +29,6 @@ import (
27
29
tmrand "github.com/Finschia/ostracon/libs/rand"
28
30
tmtime "github.com/Finschia/ostracon/types/time"
29
31
"github.com/Finschia/ostracon/version"
30
- vrf "github.com/oasisprotocol/curve25519-voi/primitives/ed25519/extra/ecvrf"
31
32
)
32
33
33
34
var TestConsensusVersion = tmversion.Consensus {
@@ -717,6 +718,21 @@ func TestCommitToVoteSet(t *testing.T) {
717
718
}
718
719
}
719
720
721
+ func TestCommitToVoteSetShouldPanicWhenInvalidVote (t * testing.T ) {
722
+ voteSet , valSet , _ := randVoteSet (1 , 1 , tmproto .PrecommitType , 10 , 1 )
723
+ chainID := voteSet .ChainID ()
724
+ commitWithInvalidVote := & Commit {
725
+ Height : 1 ,
726
+ Signatures : []CommitSig {{
727
+ BlockIDFlag : BlockIDFlagCommit ,
728
+ }},
729
+ }
730
+
731
+ assert .Panics (t , func () {
732
+ CommitToVoteSet (chainID , commitWithInvalidVote , valSet )
733
+ })
734
+ }
735
+
720
736
func TestCommitToVoteSetWithVotesForNilBlock (t * testing.T ) {
721
737
blockID := makeBlockID ([]byte ("blockhash" ), 1000 , []byte ("partshash" ))
722
738
0 commit comments