HeaderByHash returns the block header with the given hash.
(ctx context.Context, hash common.Hash)
| 125 | |
| 126 | // HeaderByHash returns the block header with the given hash. |
| 127 | func (c *Client) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) { |
| 128 | var head *types.Header |
| 129 | err := c.c.CallContext(ctx, &head, "eth_getBlockByHash", hash, false) |
| 130 | if err == nil && head == nil { |
| 131 | err = cpchain.NotFound |
| 132 | } |
| 133 | return head, err |
| 134 | } |
| 135 | |
| 136 | // HeaderByNumber returns a block header from the current canonical chain. If number is |
| 137 | // nil, the latest known header is returned. |
nothing calls this directly
no test coverage detected