Skip to content

Commit

Permalink
Fixing hex conversion of value when 0 (#1664)
Browse files Browse the repository at this point in the history
  • Loading branch information
slundqui committed Aug 22, 2024
1 parent 7feb75a commit 6c2e504
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/agent0/ethpy/base/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,14 +482,15 @@ def build_transaction(
# TODO new web3 version gas estimation seems to underestimate gas.
# We explicitly do an rpc call to estimate gas here to get an accurate gas estimate.
# RPC call to estimate gas

result = web3.provider.make_request(
method=RPCEndpoint("eth_estimateGas"),
params=[
{
"from": str(raw_txn["from"]),
"to": str(raw_txn["to"]),
# Convert integer to hex string
"value": HexBytes(raw_txn["value"]).hex(),
"value": hex(raw_txn["value"]),
"data": str(raw_txn["data"]),
}
],
Expand Down

0 comments on commit 6c2e504

Please sign in to comment.