Merge branch 'master' into mobile-searchbar-uibug

pull/1012/head
Andrew Cravenho 6 years ago committed by GitHub
commit eee29cc2a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/receipt.ex
  2. 1
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/receipts.ex
  3. 4
      apps/ethereum_jsonrpc/test/ethereum_jsonrpc/receipts_test.exs
  4. 2
      apps/explorer/config/dev/ganache.exs
  5. 2
      apps/explorer/config/dev/geth.exs
  6. 10
      apps/explorer/config/dev/parity.exs
  7. 20
      apps/explorer/config/prod/ganache.exs
  8. 2
      apps/explorer/config/prod/geth.exs
  9. 10
      apps/explorer/config/prod/parity.exs
  10. 13
      apps/explorer/config/test/ganache.exs
  11. 2
      apps/indexer/config/dev/ganache.exs
  12. 2
      apps/indexer/config/dev/geth.exs
  13. 10
      apps/indexer/config/dev/parity.exs
  14. 20
      apps/indexer/config/prod/ganache.exs
  15. 2
      apps/indexer/config/prod/geth.exs
  16. 10
      apps/indexer/config/prod/parity.exs
  17. 7
      apps/indexer/lib/indexer/address_extraction.ex

@ -65,6 +65,7 @@ defmodule EthereumJSONRPC.Receipt do
...> }
...> )
%{
created_contract_address_hash: "0xffc87239eb0267bc3ca2cd51d12fbf278e02ccb4",
cumulative_gas_used: 269607,
gas_used: 269607,
status: :ok,
@ -97,6 +98,7 @@ defmodule EthereumJSONRPC.Receipt do
...> }
...> )
%{
created_contract_address_hash: nil,
cumulative_gas_used: 21001,
gas_used: 21001,
status: nil,
@ -108,6 +110,7 @@ defmodule EthereumJSONRPC.Receipt do
@spec elixir_to_params(elixir) :: %{
cumulative_gas_used: non_neg_integer,
gas_used: non_neg_integer,
created_contract_address_hash: String.t() | nil,
status: Status.t(),
transaction_hash: String.t(),
transaction_index: non_neg_integer()
@ -116,6 +119,7 @@ defmodule EthereumJSONRPC.Receipt do
%{
"cumulativeGasUsed" => cumulative_gas_used,
"gasUsed" => gas_used,
"contractAddress" => created_contract_address_hash,
"transactionHash" => transaction_hash,
"transactionIndex" => transaction_index
} = elixir
@ -125,6 +129,7 @@ defmodule EthereumJSONRPC.Receipt do
%{
cumulative_gas_used: cumulative_gas_used,
gas_used: gas_used,
created_contract_address_hash: created_contract_address_hash,
status: status,
transaction_hash: transaction_hash,
transaction_index: transaction_index

@ -97,6 +97,7 @@ defmodule EthereumJSONRPC.Receipts do
...> ])
[
%{
created_contract_address_hash: nil,
cumulative_gas_used: 50450,
gas_used: 50450,
status: :ok,

@ -14,6 +14,7 @@ defmodule EthereumJSONRPC.ReceiptsTest do
describe "fetch/2" do
test "with receipts and logs", %{json_rpc_named_arguments: json_rpc_named_arguments} do
%{
created_contract_address_hash: nil,
cumulative_gas_used: cumulative_gas_used,
gas_used: gas_used,
address_hash: address_hash,
@ -29,6 +30,7 @@ defmodule EthereumJSONRPC.ReceiptsTest do
case Keyword.fetch!(json_rpc_named_arguments, :variant) do
EthereumJSONRPC.Geth ->
%{
created_contract_address_hash: nil,
cumulative_gas_used: 884_322,
address_hash: "0x1e2fbe6be9eb39fc894d38be976111f332172d83",
block_number: 3_560_000,
@ -45,6 +47,7 @@ defmodule EthereumJSONRPC.ReceiptsTest do
EthereumJSONRPC.Parity ->
%{
created_contract_address_hash: nil,
cumulative_gas_used: 50450,
gas_used: 50450,
address_hash: "0x8bf38d4764929064f2d4d3a56520a76ab3df415b",
@ -73,6 +76,7 @@ defmodule EthereumJSONRPC.ReceiptsTest do
%{
id: 0,
result: %{
"contractAddress" => nil,
"cumulativeGasUsed" => integer_to_quantity(cumulative_gas_used),
"gasUsed" => integer_to_quantity(gas_used),
"logs" => [

@ -14,7 +14,7 @@ config :explorer,
transport: EthereumJSONRPC.WebSocket,
transport_options: [
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient,
url: System.get_env("ETHEREUM_JSONRPC_WEB_SOCKET_URL") || "ws://localhost:7545"
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") || "ws://localhost:7545"
],
variant: EthereumJSONRPC.Geth
]

@ -14,7 +14,7 @@ config :explorer,
transport: EthereumJSONRPC.WebSocket,
transport_options: [
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient,
url: System.get_env("ETHEREUM_JSONRPC_WEB_SOCKET_URL") || "wss://mainnet.infura.io/8lTvJTKmHPCHazkneJsY/ws"
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") || "wss://mainnet.infura.io/8lTvJTKmHPCHazkneJsY/ws"
],
variant: EthereumJSONRPC.Geth
]

@ -5,11 +5,11 @@ config :explorer,
transport: EthereumJSONRPC.HTTP,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: "https://sokol.poa.network",
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "https://sokol.poa.network",
method_to_url: [
eth_call: "https://sokol-trace.poa.network",
eth_getBalance: "https://sokol-trace.poa.network",
trace_replayTransaction: "https://sokol-trace.poa.network"
eth_call: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "https://sokol-trace.poa.network",
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "https://sokol-trace.poa.network",
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "https://sokol-trace.poa.network"
],
http_options: [recv_timeout: 60_000, timeout: 60_000, hackney: [pool: :ethereum_jsonrpc]]
],
@ -19,7 +19,7 @@ config :explorer,
transport: EthereumJSONRPC.WebSocket,
transport_options: [
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient,
url: "wss://sokol-ws.poa.network/ws"
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") || "wss://sokol-ws.poa.network/ws"
],
variant: EthereumJSONRPC.Parity
]

@ -0,0 +1,20 @@
use Mix.Config
config :explorer,
json_rpc_named_arguments: [
transport: EthereumJSONRPC.HTTP,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:7545",
http_options: [recv_timeout: 60_000, timeout: 60_000, hackney: [pool: :ethereum_jsonrpc]]
],
variant: EthereumJSONRPC.Geth
],
subscribe_named_arguments: [
transport: EthereumJSONRPC.WebSocket,
transport_options: [
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient,
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") || "ws://localhost:7545"
],
variant: EthereumJSONRPC.Geth
]

@ -14,7 +14,7 @@ config :explorer,
transport: EthereumJSONRPC.WebSocket,
transport_options: [
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "wss://mainnet.infura.io/8lTvJTKmHPCHazkneJsY/ws"
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") || "wss://mainnet.infura.io/8lTvJTKmHPCHazkneJsY/ws"
],
variant: EthereumJSONRPC.Geth
]

@ -5,11 +5,11 @@ config :explorer,
transport: EthereumJSONRPC.HTTP,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_URL") || "https://sokol.poa.network",
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "https://sokol.poa.network",
method_to_url: [
eth_call: System.get_env("TRACE_URL") || "https://sokol-trace.poa.network",
eth_getBalance: System.get_env("TRACE_URL") || "https://sokol-trace.poa.network",
trace_replayTransaction: System.get_env("TRACE_URL") || "https://sokol-trace.poa.network"
eth_call: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "https://sokol-trace.poa.network",
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "https://sokol-trace.poa.network",
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "https://sokol-trace.poa.network"
],
http_options: [recv_timeout: 60_000, timeout: 60_000, hackney: [pool: :ethereum_jsonrpc]]
],
@ -19,7 +19,7 @@ config :explorer,
transport: EthereumJSONRPC.WebSocket,
transport_options: [
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient,
url: System.get_env("WS_URL") || "wss://sokol-ws.poa.network/ws"
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") || "wss://sokol-ws.poa.network/ws"
],
variant: EthereumJSONRPC.Parity
]

@ -0,0 +1,13 @@
use Mix.Config
config :explorer,
json_rpc_named_arguments: [
transport: EthereumJSONRPC.Mox,
transport_options: [],
variant: EthereumJSONRPC.Geth
],
subscribe_named_arguments: [
transport: EthereumJSONRPC.Mox,
transport_options: [],
variant: EthereumJSONRPC.Geth
]

@ -15,6 +15,6 @@ config :indexer,
transport: EthereumJSONRPC.WebSocket,
transport_options: [
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient,
url: System.get_env("ETHEREUM_JSONRPC_WEB_SOCKET_URL") || "ws://localhost:7545"
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") || "ws://localhost:7545"
]
]

@ -15,6 +15,6 @@ config :indexer,
transport: EthereumJSONRPC.WebSocket,
transport_options: [
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient,
url: System.get_env("ETHEREUM_JSONRPC_WEB_SOCKET_URL") || "wss://mainnet.infura.io/ws/8lTvJTKmHPCHazkneJsY"
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") || "wss://mainnet.infura.io/ws/8lTvJTKmHPCHazkneJsY"
]
]

@ -6,11 +6,11 @@ config :indexer,
transport: EthereumJSONRPC.HTTP,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: "https://sokol.poa.network",
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "https://sokol.poa.network",
method_to_url: [
eth_getBalance: "https://sokol-trace.poa.network",
trace_block: "https://sokol-trace.poa.network",
trace_replayTransaction: "https://sokol-trace.poa.network"
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "https://sokol-trace.poa.network",
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "https://sokol-trace.poa.network",
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "https://sokol-trace.poa.network"
],
http_options: [recv_timeout: 60_000, timeout: 60_000, hackney: [pool: :ethereum_jsonrpc]]
],
@ -20,6 +20,6 @@ config :indexer,
transport: EthereumJSONRPC.WebSocket,
transport_options: [
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient,
url: "wss://sokol-ws.poa.network/ws"
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") || "wss://sokol-ws.poa.network/ws"
]
]

@ -0,0 +1,20 @@
use Mix.Config
config :indexer,
block_interval: 5_000,
json_rpc_named_arguments: [
transport: EthereumJSONRPC.HTTP,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "http://localhost:7545",
http_options: [recv_timeout: 60_000, timeout: 60_000, hackney: [pool: :ethereum_jsonrpc]]
],
variant: EthereumJSONRPC.Geth
],
subscribe_named_arguments: [
transport: EthereumJSONRPC.WebSocket,
transport_options: [
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient,
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") || "ws://localhost:7545"
]
]

@ -15,6 +15,6 @@ config :indexer,
transport: EthereumJSONRPC.WebSocket,
transport_options: [
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient,
url: "wss://mainnet.infura.io/ws/8lTvJTKmHPCHazkneJsY"
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") || "wss://mainnet.infura.io/ws/8lTvJTKmHPCHazkneJsY"
]
]

@ -6,11 +6,11 @@ config :indexer,
transport: EthereumJSONRPC.HTTP,
transport_options: [
http: EthereumJSONRPC.HTTP.HTTPoison,
url: System.get_env("ETHEREUM_URL") || "https://sokol.poa.network",
url: System.get_env("ETHEREUM_JSONRPC_HTTP_URL") || "https://sokol.poa.network",
method_to_url: [
eth_getBalance: System.get_env("TRACE_URL") || "https://sokol-trace.poa.network",
trace_block: System.get_env("TRACE_URL") || "https://sokol-trace.poa.network",
trace_replayTransaction: System.get_env("TRACE_URL") || "https://sokol-trace.poa.network"
eth_getBalance: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "https://sokol-trace.poa.network",
trace_block: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "https://sokol-trace.poa.network",
trace_replayTransaction: System.get_env("ETHEREUM_JSONRPC_TRACE_URL") || "https://sokol-trace.poa.network"
],
http_options: [recv_timeout: 60_000, timeout: 60_000, hackney: [pool: :ethereum_jsonrpc]]
],
@ -20,6 +20,6 @@ config :indexer,
transport: EthereumJSONRPC.WebSocket,
transport_options: [
web_socket: EthereumJSONRPC.WebSocket.WebSocketClient,
url: System.get_env("WS_URL") || "wss://sokol-ws.poa.network/ws"
url: System.get_env("ETHEREUM_JSONRPC_WS_URL") || "wss://sokol-ws.poa.network/ws"
]
]

@ -78,6 +78,10 @@ defmodule Indexer.AddressExtraction do
]
],
transactions: [
[
%{from: :block_number, to: :fetched_coin_balance_block_number},
%{from: :created_contract_address_hash, to: :hash}
],
[
%{from: :block_number, to: :fetched_coin_balance_block_number},
%{from: :from_address_hash, to: :hash}
@ -362,7 +366,8 @@ defmodule Indexer.AddressExtraction do
%{
required(:block_number) => non_neg_integer(),
required(:from_address_hash) => String.t(),
optional(:to_address_hash) => String.t()
optional(:to_address_hash) => String.t(),
optional(:created_contract_address_hash) => String.t()
}
],
optional(:logs) => [

Loading…
Cancel
Save