|
|
|
@ -149,7 +149,8 @@ defmodule EthereumJSONRPC.Transaction do |
|
|
|
|
elixir_to_params(%{transaction | "input" => "0x"}) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def elixir_to_params(%{ |
|
|
|
|
def elixir_to_params( |
|
|
|
|
%{ |
|
|
|
|
"blockHash" => block_hash, |
|
|
|
|
"blockNumber" => block_number, |
|
|
|
|
"from" => from_address_hash, |
|
|
|
@ -164,8 +165,9 @@ defmodule EthereumJSONRPC.Transaction do |
|
|
|
|
"transactionIndex" => index, |
|
|
|
|
"v" => v, |
|
|
|
|
"value" => value |
|
|
|
|
}) do |
|
|
|
|
%{ |
|
|
|
|
} = transaction |
|
|
|
|
) do |
|
|
|
|
result = %{ |
|
|
|
|
block_hash: block_hash, |
|
|
|
|
block_number: block_number, |
|
|
|
|
from_address_hash: from_address_hash, |
|
|
|
@ -182,6 +184,12 @@ defmodule EthereumJSONRPC.Transaction do |
|
|
|
|
value: value, |
|
|
|
|
transaction_index: index |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if transaction["creates"] do |
|
|
|
|
Map.put(result, :created_contract_address_hash, transaction["creates"]) |
|
|
|
|
else |
|
|
|
|
result |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
# Ganache bug. it return `to: "0x0"` except of `to: null` |
|
|
|
|