ValidateBasic performs basic validation.
()
| 1651 | |
| 1652 | // ValidateBasic performs basic validation. |
| 1653 | func (m *ProposalPOLMessage) ValidateBasic() error { |
| 1654 | if m.Height < 0 { |
| 1655 | return errors.New("negative Height") |
| 1656 | } |
| 1657 | if m.ProposalPOLRound < 0 { |
| 1658 | return errors.New("negative ProposalPOLRound") |
| 1659 | } |
| 1660 | if m.ProposalPOL.Size() == 0 { |
| 1661 | return errors.New("empty ProposalPOL bit array") |
| 1662 | } |
| 1663 | if m.ProposalPOL.Size() > types.MaxVotesCount { |
| 1664 | return fmt.Errorf("proposalPOL bit array is too big: %d, max: %d", m.ProposalPOL.Size(), types.MaxVotesCount) |
| 1665 | } |
| 1666 | return nil |
| 1667 | } |
| 1668 | |
| 1669 | // String returns a string representation. |
| 1670 | func (m *ProposalPOLMessage) String() string { |