You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
** (MatchError) no match of right hand side value: {:error, %{"code" => -32602, "message" => "invalid argument 0: json: cannot unmarshal hex string without 0x prefix into Go value of type hexutil.Bytes"}}
(eth 0.5.0) lib/eth/transaction.ex:88: ETH.Transaction.send_transaction!/2
This is the relevant code. The transaction is signed, then hex encoded.
def send_transaction(params, private_key) do
set_default_from(params, private_key)
|> build
|> sign_transaction(private_key)
|> Base.encode16()
|> send
end
By prepending 0x to the transaction, geth is happy.
Hi @thunef , thanks for bringing this up! I'm also not sure since every ethereum client seems to provide their own implementation, not sure if this is indicated in the yellow paper or EIP. Today I also read a PR regarding a similar mismatch: #18
When I built this library, it was the only option to send ethereum transactions from elixir, and most clients didnt provide a mature test environment to run code against their CLI.
I'm willing to have a complex github action/CI workflow that target mature ethereum clients as long as they provide testing environment. Lately parity provides one I suppose. Then we can fix these mismatches between ethereum clients. Please let me know if you would like to contribute, I can add you as a maintainer.
This function sends invalid data to the client:
This is the relevant code. The transaction is signed, then hex encoded.
By prepending
0x
to the transaction, geth is happy.Right now we are using an infura endpoint. The errors comes from geth in this case.
Are we doing something wrong, or infura, or is this a bug in this library?
We would be happy to supply a PR for the latter.
Thanks in advance!
The text was updated successfully, but these errors were encountered: