mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-10 10:06:20 +00:00
All units tests passing
This commit is contained in:
@@ -148,7 +148,7 @@ func TestValidatorSet_VerifyCommit_CheckAllSignatures(t *testing.T) {
|
||||
err = vals[3].SignVote("CentaurusA", v)
|
||||
require.NoError(t, err)
|
||||
vote.Signature = v.Signature
|
||||
vote.ExtendedSignature = v.ExtendedSignature
|
||||
vote.ExtensionSignature = v.ExtensionSignature
|
||||
commit.Signatures[3] = vote.CommitSig()
|
||||
|
||||
err = valSet.VerifyCommit(chainID, blockID, h, commit)
|
||||
@@ -175,7 +175,7 @@ func TestValidatorSet_VerifyCommitLight_ReturnsAsSoonAsMajorityOfVotingPowerSign
|
||||
err = vals[3].SignVote("CentaurusA", v)
|
||||
require.NoError(t, err)
|
||||
vote.Signature = v.Signature
|
||||
vote.ExtendedSignature = v.ExtendedSignature
|
||||
vote.ExtensionSignature = v.ExtensionSignature
|
||||
commit.Signatures[3] = vote.CommitSig()
|
||||
|
||||
err = valSet.VerifyCommitLight(chainID, blockID, h, commit)
|
||||
@@ -200,7 +200,7 @@ func TestValidatorSet_VerifyCommitLightTrusting_ReturnsAsSoonAsTrustLevelOfVotin
|
||||
err = vals[2].SignVote("CentaurusA", v)
|
||||
require.NoError(t, err)
|
||||
vote.Signature = v.Signature
|
||||
vote.ExtendedSignature = v.ExtendedSignature
|
||||
vote.ExtensionSignature = v.ExtensionSignature
|
||||
commit.Signatures[2] = vote.CommitSig()
|
||||
|
||||
err = valSet.VerifyCommitLightTrusting(chainID, commit, tmmath.Fraction{Numerator: 1, Denominator: 3})
|
||||
|
||||
+3
-7
@@ -1,7 +1,6 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -13,8 +12,8 @@ import (
|
||||
"github.com/tendermint/tendermint/crypto/ed25519"
|
||||
"github.com/tendermint/tendermint/crypto/tmhash"
|
||||
"github.com/tendermint/tendermint/libs/protoio"
|
||||
tmtime "github.com/tendermint/tendermint/libs/time"
|
||||
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
||||
tmtime "github.com/tendermint/tendermint/types/time"
|
||||
)
|
||||
|
||||
func examplePrevote() *Vote {
|
||||
@@ -203,9 +202,6 @@ func TestVoteVerifySignature(t *testing.T) {
|
||||
// TestVoteExtension tests that the vote verification behaves correctly in each case
|
||||
// of vote extension being set on the vote.
|
||||
func TestVoteExtension(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
testCases := []struct {
|
||||
name string
|
||||
extension []byte
|
||||
@@ -244,7 +240,7 @@ func TestVoteExtension(t *testing.T) {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
height, round := int64(1), int32(0)
|
||||
privVal := NewMockPV()
|
||||
pk, err := privVal.GetPubKey(ctx)
|
||||
pk, err := privVal.GetPubKey()
|
||||
require.NoError(t, err)
|
||||
blk := Block{}
|
||||
ps, err := blk.MakePartSet(BlockPartSizeBytes)
|
||||
@@ -260,7 +256,7 @@ func TestVoteExtension(t *testing.T) {
|
||||
}
|
||||
|
||||
v := vote.ToProto()
|
||||
err = privVal.SignVote(ctx, "test_chain_id", v)
|
||||
err = privVal.SignVote("test_chain_id", v)
|
||||
require.NoError(t, err)
|
||||
vote.Signature = v.Signature
|
||||
if tc.includeSignature {
|
||||
|
||||
Reference in New Issue
Block a user