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

Method BlockByHash

api/cpclient/cpclient.go:72–74  ·  view source on GitHub ↗

Blockchain Access BlockByHash returns the given full block. Note that loading full blocks requires two requests. Use HeaderByHash if you don't need all transactions or uncle headers.

(ctx context.Context, hash common.Hash)

Source from the content-addressed store, hash-verified

70// Note that loading full blocks requires two requests. Use HeaderByHash
71// if you don't need all transactions or uncle headers.
72func (c *Client) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) {
73 return c.getBlock(ctx, "eth_getBlockByHash", hash, true)
74}
75
76// BlockByNumber returns a block from the current canonical chain. If number is nil, the
77// latest known block is returned.

Callers

nothing calls this directly

Calls 1

getBlockMethod · 0.95

Tested by

no test coverage detected