forked from cerc-io/laconicd-deprecated
change eth_estimateGas to return hexutil.Uint64 (#322)
* change eth_estimateGas to return hexutil.Uint64 * update test * Update rpc/eth_api.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
@@ -655,3 +655,19 @@ func TestEth_GetTransactionCount(t *testing.T) {
|
||||
post := getNonce(t)
|
||||
require.Equal(t, prev, post-1)
|
||||
}
|
||||
|
||||
func TestEth_EstimateGas(t *testing.T) {
|
||||
from := getAddress(t)
|
||||
param := make([]map[string]string, 1)
|
||||
param[0] = make(map[string]string)
|
||||
param[0]["from"] = "0x" + fmt.Sprintf("%x", from)
|
||||
param[0]["to"] = "0x1122334455667788990011223344556677889900"
|
||||
param[0]["value"] = "0x1"
|
||||
rpcRes := call(t, "eth_estimateGas", param)
|
||||
|
||||
var gas hexutil.Bytes
|
||||
err := json.Unmarshal(rpcRes.Result, &gas)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, hexutil.Bytes{0xf7, 0xa6}, gas)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user