|
|
@ -1,6 +1,7 @@ |
|
|
|
package types |
|
|
|
|
|
|
|
import ( |
|
|
|
"math" |
|
|
|
"testing" |
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert" |
|
|
@ -95,13 +96,13 @@ func TestEvidenceList(t *testing.T) { |
|
|
|
|
|
|
|
func TestMaxEvidenceBytes(t *testing.T) { |
|
|
|
val := NewMockPV() |
|
|
|
blockID := makeBlockID(tmhash.Sum([]byte("blockhash")), 1000, tmhash.Sum([]byte("partshash"))) |
|
|
|
blockID2 := makeBlockID(tmhash.Sum([]byte("blockhash2")), 1000, tmhash.Sum([]byte("partshash"))) |
|
|
|
blockID := makeBlockID(tmhash.Sum([]byte("blockhash")), math.MaxInt64, tmhash.Sum([]byte("partshash"))) |
|
|
|
blockID2 := makeBlockID(tmhash.Sum([]byte("blockhash2")), math.MaxInt64, tmhash.Sum([]byte("partshash"))) |
|
|
|
const chainID = "mychain" |
|
|
|
ev := &DuplicateVoteEvidence{ |
|
|
|
PubKey: secp256k1.GenPrivKey().PubKey(), // use secp because it's pubkey is longer
|
|
|
|
VoteA: makeVote(val, chainID, 0, 10, 2, 1, blockID), |
|
|
|
VoteB: makeVote(val, chainID, 0, 10, 2, 1, blockID2), |
|
|
|
VoteA: makeVote(val, chainID, math.MaxInt64, math.MaxInt64, math.MaxInt64, math.MaxInt64, blockID), |
|
|
|
VoteB: makeVote(val, chainID, math.MaxInt64, math.MaxInt64, math.MaxInt64, math.MaxInt64, blockID2), |
|
|
|
} |
|
|
|
|
|
|
|
bz, err := cdc.MarshalBinary(ev) |
|
|
|