Don't reference Explorer types in EthereumJSONRPC

EthereumJSONRPC is not supposed to depend on Explorer at a code level,
it should at most cross reference it in docs.
pull/1302/head
Luke Imhoff 6 years ago
parent 40004fdb4b
commit 97ce8e838b
  1. 5
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc.ex
  2. 9
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/receipt.ex

@ -44,6 +44,11 @@ defmodule EthereumJSONRPC do
""" """
@type address :: String.t() @type address :: String.t()
@typedoc """
A block number as an Elixir `t:non_neg_integer/0` instead of `t:data/0`.
"""
@type block_number :: non_neg_integer()
@typedoc """ @typedoc """
Binary data encoded as a single hexadecimal number in a `String.t` Binary data encoded as a single hexadecimal number in a `String.t`
""" """

@ -7,7 +7,6 @@ defmodule EthereumJSONRPC.Receipt do
import EthereumJSONRPC, only: [quantity_to_integer: 1] import EthereumJSONRPC, only: [quantity_to_integer: 1]
alias EthereumJSONRPC.Logs alias EthereumJSONRPC.Logs
alias Explorer.Chain.Transaction.Status
@type elixir :: %{String.t() => String.t() | non_neg_integer} @type elixir :: %{String.t() => String.t() | non_neg_integer}
@ -39,6 +38,12 @@ defmodule EthereumJSONRPC.Receipt do
| nil | nil
} }
@typedoc """
* `:ok` - transaction succeeded
* `:error` - transaction failed
"""
@type status :: :ok | :error
@doc """ @doc """
Get `t:EthereumJSONRPC.Logs.elixir/0` from `t:elixir/0` Get `t:EthereumJSONRPC.Logs.elixir/0` from `t:elixir/0`
""" """
@ -110,7 +115,7 @@ defmodule EthereumJSONRPC.Receipt do
cumulative_gas_used: non_neg_integer, cumulative_gas_used: non_neg_integer,
gas_used: non_neg_integer, gas_used: non_neg_integer,
created_contract_address_hash: String.t() | nil, created_contract_address_hash: String.t() | nil,
status: Status.t(), status: status(),
transaction_hash: String.t(), transaction_hash: String.t(),
transaction_index: non_neg_integer() transaction_index: non_neg_integer()
} }

Loading…
Cancel
Save