parent
2977740e3d
commit
e12b13bc5b
@ -1,13 +1,9 @@ |
||||
defmodule Explorer.BlockTransaction do |
||||
@moduledoc false |
||||
@moduledoc "Connects a Block to a Transaction" |
||||
|
||||
alias Explorer.BlockTransaction |
||||
import Ecto.Changeset |
||||
use Ecto.Schema |
||||
|
||||
@timestamps_opts [ |
||||
type: Timex.Ecto.DateTime, |
||||
autogenerate: {Timex.Ecto.DateTime, :autogenerate, []} |
||||
] |
||||
use Explorer.Schema |
||||
|
||||
@primary_key false |
||||
schema "block_transactions" do |
@ -1,13 +1,9 @@ |
||||
defmodule Explorer.FromAddress do |
||||
@moduledoc false |
||||
alias Explorer.FromAddress |
||||
import Ecto.Changeset |
||||
use Ecto.Schema |
||||
|
||||
@timestamps_opts [ |
||||
type: Timex.Ecto.DateTime, |
||||
autogenerate: {Timex.Ecto.DateTime, :autogenerate, []} |
||||
] |
||||
use Explorer.Schema |
||||
|
||||
alias Explorer.FromAddress |
||||
|
||||
@primary_key false |
||||
schema "from_addresses" do |
@ -1,19 +1,12 @@ |
||||
defmodule Explorer.InternalTransaction do |
||||
@moduledoc "Models internal transactions." |
||||
|
||||
use Ecto.Schema |
||||
|
||||
import Ecto.Changeset |
||||
use Explorer.Schema |
||||
|
||||
alias Explorer.InternalTransaction |
||||
alias Explorer.Transaction |
||||
alias Explorer.Address |
||||
|
||||
@timestamps_opts [ |
||||
type: Timex.Ecto.DateTime, |
||||
autogenerate: {Timex.Ecto.DateTime, :autogenerate, []} |
||||
] |
||||
|
||||
schema "internal_transactions" do |
||||
belongs_to(:transaction, Transaction) |
||||
belongs_to(:from_address, Address) |
@ -1,19 +1,12 @@ |
||||
defmodule Explorer.Log do |
||||
@moduledoc "Captures a Web3 log entry generated by a transaction" |
||||
|
||||
use Ecto.Schema |
||||
|
||||
import Ecto.Changeset |
||||
use Explorer.Schema |
||||
|
||||
alias Explorer.Address |
||||
alias Explorer.Log |
||||
alias Explorer.Receipt |
||||
|
||||
@timestamps_opts [ |
||||
type: Timex.Ecto.DateTime, |
||||
autogenerate: {Timex.Ecto.DateTime, :autogenerate, []} |
||||
] |
||||
|
||||
@required_attrs ~w(index data type)a |
||||
@optional_attrs ~w( |
||||
first_topic second_topic third_topic fourth_topic address_id |
@ -1,19 +1,12 @@ |
||||
defmodule Explorer.Receipt do |
||||
@moduledoc "Captures a Web3 Transaction Receipt." |
||||
|
||||
use Ecto.Schema |
||||
|
||||
import Ecto.Changeset |
||||
use Explorer.Schema |
||||
|
||||
alias Explorer.Transaction |
||||
alias Explorer.Log |
||||
alias Explorer.Receipt |
||||
|
||||
@timestamps_opts [ |
||||
type: Timex.Ecto.DateTime, |
||||
autogenerate: {Timex.Ecto.DateTime, :autogenerate, []} |
||||
] |
||||
|
||||
@required_attrs ~w(cumulative_gas_used gas_used status index)a |
||||
@optional_attrs ~w(transaction_id)a |
||||
|
@ -0,0 +1,15 @@ |
||||
defmodule Explorer.Schema do |
||||
defmacro __using__(_opts) do |
||||
quote do |
||||
use Ecto.Schema |
||||
|
||||
import Ecto.Changeset |
||||
import Ecto.Query |
||||
|
||||
@timestamps_opts [ |
||||
type: Timex.Ecto.DateTime, |
||||
autogenerate: {Timex.Ecto.DateTime, :autogenerate, []} |
||||
] |
||||
end |
||||
end |
||||
end |
@ -1,13 +1,8 @@ |
||||
defmodule Explorer.ToAddress do |
||||
@moduledoc false |
||||
alias Explorer.ToAddress |
||||
import Ecto.Changeset |
||||
use Ecto.Schema |
||||
|
||||
@timestamps_opts [ |
||||
type: Timex.Ecto.DateTime, |
||||
autogenerate: {Timex.Ecto.DateTime, :autogenerate, []} |
||||
] |
||||
use Explorer.Schema |
||||
|
||||
@primary_key false |
||||
schema "to_addresses" do |
Loading…
Reference in new issue