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

Method HashesTo

types/block.go:160–168  ·  view source on GitHub ↗

HashesTo is a convenience function that checks if a block hashes to the given argument. Returns false if the block is nil or the hash is empty.

(hash []byte)

Source from the content-addressed store, hash-verified

158// HashesTo is a convenience function that checks if a block hashes to the given argument.
159// Returns false if the block is nil or the hash is empty.
160func (b *Block) HashesTo(hash []byte) bool {
161 if len(hash) == 0 {
162 return false
163 }
164 if b == nil {
165 return false
166 }
167 return bytes.Equal(b.Hash(), hash)
168}
169
170// Size returns size of the block in bytes.
171func (b *Block) Size() int {

Callers 14

TestBasicPartSetFunction · 0.45
TestBlockHashesToFunction · 0.45
defaultEnterPrecommitFunction · 0.45
defaultReceivePrevoteFunction · 0.45
enterCommitMethod · 0.45
tryFinalizeCommitMethod · 0.45
finalizeCommitMethod · 0.45
addProposalBlockPartMethod · 0.45
enterPrecommitMethod · 0.45
enterCommitMethod · 0.45
tryFinalizeCommitMethod · 0.45
finalizeCommitMethod · 0.45

Calls 2

HashMethod · 0.95
EqualMethod · 0.65

Tested by 2

TestBasicPartSetFunction · 0.36
TestBlockHashesToFunction · 0.36