MCPcopy Create free account
hub / github.com/tendermint/tendermint / ValidateBasic

Method ValidateBasic

types/block.go:1196–1205  ·  view source on GitHub ↗

ValidateBasic performs basic validation.

()

Source from the content-addressed store, hash-verified

1194
1195// ValidateBasic performs basic validation.
1196func (blockID BlockID) ValidateBasic() error {
1197 // Hash can be empty in case of POLBlockID in Proposal.
1198 if err := ValidateHash(blockID.Hash); err != nil {
1199 return fmt.Errorf("wrong Hash: %w", err)
1200 }
1201 if err := blockID.PartSetHeader.ValidateBasic(); err != nil {
1202 return fmt.Errorf("wrong PartSetHeader: %w", err)
1203 }
1204 return nil
1205}
1206
1207// IsZero returns true if this is the BlockID of a nil block.
1208func (blockID BlockID) IsZero() bool {

Callers 1

TestBlockIDValidateBasicFunction · 0.95

Calls 2

ValidateHashFunction · 0.85
ValidateBasicMethod · 0.65

Tested by 1

TestBlockIDValidateBasicFunction · 0.76