MCPcopy Create free account
hub / github.com/CPChain/chain / Hash

Method Hash

types/block.go:499–506  ·  view source on GitHub ↗

Hash returns the keccak256 hash of b's header. The hash is computed on the first call and cached thereafter.

()

Source from the content-addressed store, hash-verified

497// Hash returns the keccak256 hash of b's header.
498// The hash is computed on the first call and cached thereafter.
499func (b *Block) Hash() common.Hash {
500 if hash := b.hash.Load(); hash != nil {
501 return hash.(common.Hash)
502 }
503 v := b.header.Hash()
504 b.hash.Store(v)
505 return v
506}
507
508type Blocks []*Block
509

Callers 6

TestBlockEncodingFunction · 0.95
TestLookupStorageFunction · 0.95
Test_InsertChainFunction · 0.95

Calls 1

HashMethod · 0.65

Tested by 6

TestBlockEncodingFunction · 0.76
TestLookupStorageFunction · 0.76
Test_InsertChainFunction · 0.76