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

Method BlockID

types/block.go:652–665  ·  view source on GitHub ↗

BlockID returns the Commit's BlockID if CommitSig indicates signing, otherwise - empty BlockID.

(commitBlockID BlockID)

Source from the content-addressed store, hash-verified

650// BlockID returns the Commit's BlockID if CommitSig indicates signing,
651// otherwise - empty BlockID.
652func (cs CommitSig) BlockID(commitBlockID BlockID) BlockID {
653 var blockID BlockID
654 switch cs.BlockIDFlag {
655 case BlockIDFlagAbsent:
656 blockID = BlockID{}
657 case BlockIDFlagCommit:
658 blockID = commitBlockID
659 case BlockIDFlagNil:
660 blockID = BlockID{}
661 default:
662 panic(fmt.Sprintf("Unknown BlockIDFlag: %v", cs.BlockIDFlag))
663 }
664 return blockID
665}
666
667// ValidateBasic performs basic validation.
668func (cs CommitSig) ValidateBasic() error {

Callers 1

GetVoteMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected