MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / ValidateBasic

Method ValidateBasic

consensus/reactor.go:1653–1667  ·  view source on GitHub ↗

ValidateBasic performs basic validation.

()

Source from the content-addressed store, hash-verified

1651
1652// ValidateBasic performs basic validation.
1653func (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.
1670func (m *ProposalPOLMessage) String() string {

Callers 1

Calls 1

SizeMethod · 0.65

Tested by 1