Skip to content

Commit 5dd7cd6

Browse files
author
lizekun
committed
check null result
1 parent 9050307 commit 5dd7cd6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

geth.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,14 @@ func (c *Client) GasPrice() (price *big.Int, err error) {
2020
err = c.call("proxy", "eth_gasPrice", param, price)
2121
return
2222
}
23+
24+
func (c *Client) EstimateGas(from, to string, value, gasPrice *big.Int) (limit uint64, err error) {
25+
param := M{
26+
"value": value.Text(16),
27+
"to": to,
28+
"form": from,
29+
"gasPrice": gasPrice.Text(16),
30+
}
31+
err = c.call("proxy", "eth_estimateGas", param, &limit)
32+
return
33+
}

0 commit comments

Comments
 (0)