mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-24 22:32:15 +00:00
Fix TestBeginBlockValidators
This commit is contained in:
parent
2a1d0542f3
commit
5d3961d705
@ -64,7 +64,7 @@ func TestBeginBlockValidators(t *testing.T) {
|
|||||||
|
|
||||||
now := tmtime.Now()
|
now := tmtime.Now()
|
||||||
commitSig0 := (&types.Vote{ValidatorIndex: 0, Timestamp: now, Type: types.PrecommitType}).CommitSig()
|
commitSig0 := (&types.Vote{ValidatorIndex: 0, Timestamp: now, Type: types.PrecommitType}).CommitSig()
|
||||||
commitSig1 := (&types.Vote{ValidatorIndex: 1, Timestamp: now}).CommitSig()
|
commitSig1 := (&types.Vote{ValidatorIndex: 1, Timestamp: now, Type: types.PrecommitType}).CommitSig()
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
desc string
|
desc string
|
||||||
@ -97,7 +97,7 @@ func TestBeginBlockValidators(t *testing.T) {
|
|||||||
} else {
|
} else {
|
||||||
assert.True(t, v.SignedLastBlock)
|
assert.True(t, v.SignedLastBlock)
|
||||||
assert.NotNil(t, v.FullVote)
|
assert.NotNil(t, v.FullVote)
|
||||||
assert.Equal(t, *v.FullVote, types.Vote(*tc.lastCommitPrecommits[i]))
|
assert.Equal(t, v.FullVote, types.TM2PB.Vote(tc.lastCommitPrecommits[i]))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,6 +222,10 @@ func (pb2tm) ValidatorUpdates(vals []abci.ValidatorUpdate) ([]*Validator, error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (tm2pb) Vote(vote *CommitSig) *abci.Vote {
|
func (tm2pb) Vote(vote *CommitSig) *abci.Vote {
|
||||||
|
if vote == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
blockID := TM2PB.BlockID(vote.BlockID)
|
blockID := TM2PB.BlockID(vote.BlockID)
|
||||||
|
|
||||||
return &abci.Vote{
|
return &abci.Vote{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user