ethclient: added BlockNumber

This commit is contained in:
Pavel Makarenko 2018-01-17 10:34:04 +03:00
parent 216e584899
commit 60c8992b25

View file

@ -382,6 +382,13 @@ func (ec *Client) PendingBalanceAt(ctx context.Context, account common.Address)
return (*big.Int)(&result), err
}
// BlockNumber returns the number of most recent block.
func (ec *Client) BlockNumber(ctx context.Context) (*big.Int, error) {
var result hexutil.Big
err := ec.c.CallContext(ctx, &result, "eth_blockNumber")
return (*big.Int)(&result), err
}
// PendingStorageAt returns the value of key in the contract storage of the given account in the pending state.
func (ec *Client) PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error) {
var result hexutil.Bytes