mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-07 04:20:44 +00:00
WIP: exploring changes related to proposed ADR:
https://github.com/tendermint/tendermint/pull/2445 - still contains a lot of failing tests etc
This commit is contained in:
@@ -246,7 +246,7 @@ func getBeginBlockValidatorInfo(block *types.Block, lastValSet *types.ValidatorS
|
||||
// Collect the vote info (list of validators and whether or not they signed).
|
||||
voteInfos := make([]abci.VoteInfo, len(lastValSet.Validators))
|
||||
for i, val := range lastValSet.Validators {
|
||||
var vote *types.Vote
|
||||
var vote *types.UnsignedVote
|
||||
if i < len(block.LastCommit.Precommits) {
|
||||
vote = block.LastCommit.Precommits[i]
|
||||
}
|
||||
|
||||
@@ -64,17 +64,17 @@ func TestBeginBlockValidators(t *testing.T) {
|
||||
prevBlockID := types.BlockID{prevHash, prevParts}
|
||||
|
||||
now := tmtime.Now()
|
||||
vote0 := &types.Vote{ValidatorIndex: 0, Timestamp: now, Type: types.VoteTypePrecommit}
|
||||
vote1 := &types.Vote{ValidatorIndex: 1, Timestamp: now}
|
||||
vote0 := &types.UnsignedVote{ValidatorIndex: 0, Timestamp: now, Type: types.VoteTypePrecommit}
|
||||
vote1 := &types.UnsignedVote{ValidatorIndex: 1, Timestamp: now}
|
||||
|
||||
testCases := []struct {
|
||||
desc string
|
||||
lastCommitPrecommits []*types.Vote
|
||||
lastCommitPrecommits []*types.UnsignedVote
|
||||
expectedAbsentValidators []int
|
||||
}{
|
||||
{"none absent", []*types.Vote{vote0, vote1}, []int{}},
|
||||
{"one absent", []*types.Vote{vote0, nil}, []int{1}},
|
||||
{"multiple absent", []*types.Vote{nil, nil}, []int{0, 1}},
|
||||
{"none absent", []*types.UnsignedVote{vote0, vote1}, []int{}},
|
||||
{"one absent", []*types.UnsignedVote{vote0, nil}, []int{1}},
|
||||
{"multiple absent", []*types.UnsignedVote{nil, nil}, []int{0, 1}},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
@@ -135,9 +135,9 @@ func TestBeginBlockByzantineValidators(t *testing.T) {
|
||||
types.TM2PB.Evidence(ev2, valSet, now)}},
|
||||
}
|
||||
|
||||
vote0 := &types.Vote{ValidatorIndex: 0, Timestamp: now, Type: types.VoteTypePrecommit}
|
||||
vote1 := &types.Vote{ValidatorIndex: 1, Timestamp: now}
|
||||
votes := []*types.Vote{vote0, vote1}
|
||||
vote0 := &types.UnsignedVote{ValidatorIndex: 0, Timestamp: now, Type: types.VoteTypePrecommit}
|
||||
vote1 := &types.UnsignedVote{ValidatorIndex: 1, Timestamp: now}
|
||||
votes := []*types.UnsignedVote{vote0, vote1}
|
||||
lastCommit := &types.Commit{BlockID: prevBlockID, Precommits: votes}
|
||||
for _, tc := range testCases {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user