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

Method ValidateBasic

consensus/reactor.go:1762–1776  ·  view source on GitHub ↗

ValidateBasic performs basic validation.

()

Source from the content-addressed store, hash-verified

1760
1761// ValidateBasic performs basic validation.
1762func (m *VoteSetMaj23Message) ValidateBasic() error {
1763 if m.Height < 0 {
1764 return errors.New("negative Height")
1765 }
1766 if m.Round < 0 {
1767 return errors.New("negative Round")
1768 }
1769 if !types.IsVoteTypeValid(m.Type) {
1770 return errors.New("invalid Type")
1771 }
1772 if err := m.BlockID.ValidateBasic(); err != nil {
1773 return fmt.Errorf("wrong BlockID: %v", err)
1774 }
1775 return nil
1776}
1777
1778// String returns a string representation.
1779func (m *VoteSetMaj23Message) String() string {

Callers 1

Calls 2

IsVoteTypeValidFunction · 0.92
ValidateBasicMethod · 0.65

Tested by 1