This function sends invalid data to the client:
** (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.
def send_transaction(params, private_key) do
set_default_from(params, private_key)
|> build
|> sign_transaction(private_key)
|> Base.encode16()
|> (fn transaction -> "0x" <> transaction end).()
|> send
end
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!
This function sends invalid data to the client:
This is the relevant code. The transaction is signed, then hex encoded.
By prepending
0xto 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!