parent
126c59a30d
commit
a82c8bd2a3
@ -1,22 +1,23 @@ |
||||
defmodule Explorer.Chain.ZkevmBatchTransaction do |
||||
defmodule Explorer.Chain.Zkevm.BatchTransaction do |
||||
@moduledoc "Models a list of transactions related to a batch for zkEVM." |
||||
|
||||
use Explorer.Schema |
||||
|
||||
alias Explorer.Chain.{Hash, Transaction, ZkevmTransactionBatch} |
||||
alias Explorer.Chain.{Hash, Transaction} |
||||
alias Explorer.Chain.Zkevm.TransactionBatch |
||||
|
||||
@required_attrs ~w(batch_number hash)a |
||||
|
||||
@type t :: %__MODULE__{ |
||||
batch_number: non_neg_integer(), |
||||
batch: %Ecto.Association.NotLoaded{} | ZkevmTransactionBatch.t() | nil, |
||||
batch: %Ecto.Association.NotLoaded{} | TransactionBatch.t() | nil, |
||||
hash: Hash.t(), |
||||
l2_transaction: %Ecto.Association.NotLoaded{} | Transaction.t() | nil |
||||
} |
||||
|
||||
@primary_key false |
||||
schema "zkevm_batch_l2_transactions" do |
||||
belongs_to(:batch, ZkevmTransactionBatch, foreign_key: :batch_number, references: :number, type: :integer) |
||||
belongs_to(:batch, TransactionBatch, foreign_key: :batch_number, references: :number, type: :integer) |
||||
belongs_to(:l2_transaction, Transaction, foreign_key: :hash, primary_key: true, references: :hash, type: Hash.Full) |
||||
|
||||
timestamps() |
Loading…
Reference in new issue