POL tests

This commit is contained in:
Jae Kwon
2014-10-17 16:48:27 -07:00
parent 5c69736994
commit ca1d8a54be
4 changed files with 227 additions and 21 deletions

View File

@ -79,6 +79,9 @@ func (pol *POL) Verify(vset *state.ValidatorSet) error {
if val == nil {
return Errorf("Invalid validator for commit %v for POL %v", sig, pol)
}
if round >= pol.Round {
return Errorf("Invalid commit round %v for POL %v", round, pol)
}
commitDoc := BinaryBytes(&Vote{Height: pol.Height, Round: round,
Type: VoteTypeCommit, BlockHash: pol.BlockHash}) // TODO cache