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