diff options
author | Felix Lange <fjl@twurst.com> | 2016-11-29 20:59:00 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-12-05 02:45:55 +0800 |
commit | fa0cc274009670209fd71b1462dcdde3b431d64f (patch) | |
tree | 216655ccc8435b295102f15c5585499755ebc353 /ethclient | |
parent | 4cb29bde2e314fbef51773f2d39cd49dfc6c5033 (diff) | |
download | go-tangerine-fa0cc274009670209fd71b1462dcdde3b431d64f.tar go-tangerine-fa0cc274009670209fd71b1462dcdde3b431d64f.tar.gz go-tangerine-fa0cc274009670209fd71b1462dcdde3b431d64f.tar.bz2 go-tangerine-fa0cc274009670209fd71b1462dcdde3b431d64f.tar.lz go-tangerine-fa0cc274009670209fd71b1462dcdde3b431d64f.tar.xz go-tangerine-fa0cc274009670209fd71b1462dcdde3b431d64f.tar.zst go-tangerine-fa0cc274009670209fd71b1462dcdde3b431d64f.zip |
ethclient: use package hexutil for number encoding
Diffstat (limited to 'ethclient')
-rw-r--r-- | ethclient/ethclient.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index 8a25678d8..b23e9baa3 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -112,7 +112,7 @@ func (ec *Client) getBlock(ctx context.Context, method string, args ...interface for i := range reqs { reqs[i] = rpc.BatchElem{ Method: "eth_getUncleByBlockHashAndIndex", - Args: []interface{}{body.Hash, fmt.Sprintf("%#x", i)}, + Args: []interface{}{body.Hash, hexutil.EncodeUint64(uint64(i))}, Result: &uncles[i], } } @@ -196,7 +196,7 @@ func toBlockNumArg(number *big.Int) string { if number == nil { return "latest" } - return fmt.Sprintf("%#x", number) + return hexutil.EncodeBig(number) } type rpcProgress struct { |