Skip to content

Commit fa0cc27

Browse files
committed
ethclient: use package hexutil for number encoding
1 parent 4cb29bd commit fa0cc27

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎ethclient/ethclient.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (ec *Client) getBlock(ctx context.Context, method string, args ...interface
112112
for i := range reqs {
113113
reqs[i] = rpc.BatchElem{
114114
Method: "eth_getUncleByBlockHashAndIndex",
115-
Args: []interface{}{body.Hash, fmt.Sprintf("%#x", i)},
115+
Args: []interface{}{body.Hash, hexutil.EncodeUint64(uint64(i))},
116116
Result: &uncles[i],
117117
}
118118
}
@@ -196,7 +196,7 @@ func toBlockNumArg(number *big.Int) string {
196196
if number == nil {
197197
return "latest"
198198
}
199-
return fmt.Sprintf("%#x", number)
199+
return hexutil.EncodeBig(number)
200200
}
201201

202202
type rpcProgress struct {

0 commit comments

Comments
 (0)