forked from blockscout/blockscout
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shijiang/l1l2relation l1l2api (blockscout#88)
* l1 and l2 message deocde to db * change data logic and l1l2 api
- Loading branch information
1 parent
9890b5a
commit b1d6731
Showing
17 changed files
with
538 additions
and
36 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
apps/explorer/priv/repo/migrations/20230103023114_add_l1l2_status_to_transactions.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
defmodule Explorer.Repo.Migrations.AddL1l2StatusToTransactions do | ||
use Ecto.Migration | ||
|
||
def change do | ||
alter table(:transactions) do | ||
add(:l1l2_l1_token, :bytea, null: true) | ||
add(:l1l2_l2_token, :bytea, null: true) | ||
add(:l1l2_status, :integer, null: false, default: 0) # 0: wait transaction; 1: ready for Relay transaction; 2: Relayed transaction | ||
add(:l1l2_type, :integer, null: false, default: 0) # 0: normal transaction; 1: deposit transaction; 2: withdraw | ||
add(:l1l2_from, :bytea, null: true) | ||
add(:l1l2_to, :bytea, null: true) | ||
add(:l1l2_value, :numeric, precision: 100, null: false, default: 0) | ||
end | ||
end | ||
end |
14 changes: 14 additions & 0 deletions
14
...explorer/priv/repo/migrations/20230110111631_add_l1_message_to_l1_sent_message_events.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
defmodule Explorer.Repo.Migrations.AddL1MessageToL1SentMessageEvents do | ||
use Ecto.Migration | ||
|
||
def change do | ||
alter table(:l1_sent_message_events) do | ||
add(:l1_token, :bytea, null: true) | ||
add(:l2_token, :bytea, null: true) | ||
add(:from, :bytea, null: true) | ||
add(:to, :bytea, null: true) | ||
add(:type, :integer, null: false, default: 0) # 0: reward; 1: deposit | ||
add(:value, :numeric, precision: 100, null: false, default: 0) | ||
end | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
...explorer/priv/repo/migrations/20230110111646_add_l2_message_to_l2_sent_message_events.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
defmodule Explorer.Repo.Migrations.AddL2MessageToL2SentMessageEvents do | ||
use Ecto.Migration | ||
|
||
def change do | ||
alter table(:l2_sent_message_events) do | ||
add(:l1_token, :bytea, null: true) | ||
add(:l2_token, :bytea, null: true) | ||
add(:from, :bytea, null: true) | ||
add(:to, :bytea, null: true) | ||
add(:value, :numeric, precision: 100, null: false, default: 0) | ||
end | ||
end | ||
end |
15 changes: 15 additions & 0 deletions
15
apps/explorer/priv/repo/migrations/20230111025017_add_l2_message_to_l2_to_l1.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
defmodule Explorer.Repo.Migrations.AddL2MessageToL2ToL1 do | ||
use Ecto.Migration | ||
|
||
def change do | ||
alter table(:l2_to_l1) do | ||
add(:name, :string, null: true) | ||
add(:symbol, :string, null: true) | ||
add(:l1_token, :bytea, null: true) | ||
add(:l2_token, :bytea, null: true) | ||
add(:from, :bytea, null: true) | ||
add(:to, :bytea, null: true) | ||
add(:value, :numeric, precision: 100, null: false, default: 0) | ||
end | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
apps/explorer/priv/repo/migrations/20230111025033_add_l1_message_to_l1_to_l2.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
defmodule Explorer.Repo.Migrations.AddL1MessageToL1ToL2 do | ||
use Ecto.Migration | ||
|
||
def change do | ||
alter table(:l1_to_l2) do | ||
add(:name, :string, null: true) | ||
add(:symbol, :string, null: true) | ||
add(:l1_token, :bytea, null: true) | ||
add(:l2_token, :bytea, null: true) | ||
add(:from, :bytea, null: true) | ||
add(:to, :bytea, null: true) | ||
add(:type, :integer, null: false, default: 0) # 0: reward; 1: deposit | ||
add(:value, :numeric, precision: 100, null: false, default: 0) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.