mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 14:52:17 +00:00
post rebase fix
This commit is contained in:
parent
39299e5cc1
commit
6e9433c7a8
@ -74,6 +74,7 @@ type RoundState struct {
|
|||||||
CommitRound int //
|
CommitRound int //
|
||||||
LastCommit *types.VoteSet // Last precommits at Height-1
|
LastCommit *types.VoteSet // Last precommits at Height-1
|
||||||
LastValidators *types.ValidatorSet
|
LastValidators *types.ValidatorSet
|
||||||
|
Evidence types.Evidences
|
||||||
}
|
}
|
||||||
|
|
||||||
// RoundStateEvent returns the H/R/S of the RoundState as an event.
|
// RoundStateEvent returns the H/R/S of the RoundState as an event.
|
||||||
@ -107,8 +108,9 @@ func (rs *RoundState) StringIndented(indent string) string {
|
|||||||
%s LockedRound: %v
|
%s LockedRound: %v
|
||||||
%s LockedBlock: %v %v
|
%s LockedBlock: %v %v
|
||||||
%s Votes: %v
|
%s Votes: %v
|
||||||
%s LastCommit: %v
|
%s LastCommit: %v
|
||||||
%s LastValidators: %v
|
%s LastValidators:%v
|
||||||
|
%s Evidence: %v
|
||||||
%s}`,
|
%s}`,
|
||||||
indent, rs.Height, rs.Round, rs.Step,
|
indent, rs.Height, rs.Round, rs.Step,
|
||||||
indent, rs.StartTime,
|
indent, rs.StartTime,
|
||||||
@ -121,6 +123,7 @@ func (rs *RoundState) StringIndented(indent string) string {
|
|||||||
indent, rs.Votes.StringIndented(indent+" "),
|
indent, rs.Votes.StringIndented(indent+" "),
|
||||||
indent, rs.LastCommit.StringShort(),
|
indent, rs.LastCommit.StringShort(),
|
||||||
indent, rs.LastValidators.StringIndented(indent+" "),
|
indent, rs.LastValidators.StringIndented(indent+" "),
|
||||||
|
indent, rs.Evidence.String(),
|
||||||
indent)
|
indent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +53,14 @@ func (evs Evidences) Hash() []byte {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (evs Evidences) String() string {
|
||||||
|
s := ""
|
||||||
|
for _, e := range evs {
|
||||||
|
s += fmt.Sprintf("%s\t\t", e)
|
||||||
|
}
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
|
|
||||||
// DuplicateVoteEvidence contains evidence a validator signed two conflicting votes.
|
// DuplicateVoteEvidence contains evidence a validator signed two conflicting votes.
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
cmn "github.com/tendermint/tmlibs/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type voteData struct {
|
type voteData struct {
|
||||||
@ -12,7 +13,7 @@ type voteData struct {
|
|||||||
valid bool
|
valid bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeVote(val *PrivValidator, chainID string, valIndex, height, round, step int, blockID BlockID) *Vote {
|
func makeVote(val *PrivValidatorFS, chainID string, valIndex, height, round, step int, blockID BlockID) *Vote {
|
||||||
v := &Vote{
|
v := &Vote{
|
||||||
ValidatorAddress: val.PubKey.Address(),
|
ValidatorAddress: val.PubKey.Address(),
|
||||||
ValidatorIndex: valIndex,
|
ValidatorIndex: valIndex,
|
||||||
@ -39,8 +40,9 @@ func makeBlockID(hash string, partSetSize int, partSetHash string) BlockID {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestEvidence(t *testing.T) {
|
func TestEvidence(t *testing.T) {
|
||||||
val := GenPrivValidator()
|
_, tmpFilePath := cmn.Tempfile("priv_validator_")
|
||||||
val2 := GenPrivValidator()
|
val := GenPrivValidatorFS(tmpFilePath)
|
||||||
|
val2 := GenPrivValidatorFS(tmpFilePath)
|
||||||
blockID := makeBlockID("blockhash", 1000, "partshash")
|
blockID := makeBlockID("blockhash", 1000, "partshash")
|
||||||
blockID2 := makeBlockID("blockhash2", 1000, "partshash")
|
blockID2 := makeBlockID("blockhash2", 1000, "partshash")
|
||||||
blockID3 := makeBlockID("blockhash", 10000, "partshash")
|
blockID3 := makeBlockID("blockhash", 10000, "partshash")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user