Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
071de782
Commit
071de782
authored
Aug 21, 2023
by
Hamdi Allam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comment nits
parent
25305575
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
bridge_transfers.go
indexer/database/bridge_transfers.go
+2
-10
No files found.
indexer/database/bridge_transfers.go
View file @
071de782
...
...
@@ -137,7 +137,7 @@ func (db *bridgeTransfersDB) L1BridgeDepositsByAddress(address common.Address, c
// TODO join with l1_tokens and l2_tokens
ethAddressString
:=
predeploys
.
LegacyERC20ETHAddr
.
String
()
// Coalesce l1 transaction deposits that are
ETH receives into bridge deposits.
// Coalesce l1 transaction deposits that are
simply ETH sends
ethTransactionDeposits
:=
db
.
gorm
.
Model
(
&
L1TransactionDeposit
{})
ethTransactionDeposits
=
ethTransactionDeposits
.
Where
(
Transaction
{
FromAddress
:
address
})
.
Where
(
`data = '0x' AND amount > 0`
)
ethTransactionDeposits
=
ethTransactionDeposits
.
Joins
(
"INNER JOIN l1_contract_events ON l1_contract_events.guid = initiated_l1_event_guid"
)
...
...
@@ -154,10 +154,6 @@ l1_bridge_deposits.from_address, l1_bridge_deposits.to_address, l1_bridge_deposi
l2_transaction_hash, l1_contract_events.transaction_hash AS l1_transaction_hash,
l1_bridge_deposits.timestamp, cross_domain_message_hash, local_token_address, remote_token_address`
)
// Since all bridge deposits share have the same primary key corresponding to the transaction
// deposit, we can simply order by the timestamp in the transaction deposits table which will
// order all deposits (bridge & transactions) uniformly
// TODO: cursoring options
query
:=
db
.
gorm
.
Table
(
"(?) AS deposits"
,
depositsQuery
)
...
...
@@ -245,7 +241,7 @@ func (db *bridgeTransfersDB) L2BridgeWithdrawalsByAddress(address common.Address
// TODO join with l1_tokens and l2_tokens
ethAddressString
:=
predeploys
.
LegacyERC20ETHAddr
.
String
()
// Coalesce l2 transaction withdrawals that are
ETH receive
s
// Coalesce l2 transaction withdrawals that are
simply ETH send
s
ethTransactionWithdrawals
:=
db
.
gorm
.
Model
(
&
L2TransactionWithdrawal
{})
ethTransactionWithdrawals
=
ethTransactionWithdrawals
.
Where
(
Transaction
{
FromAddress
:
address
})
.
Where
(
`data = '0x' AND amount > 0`
)
ethTransactionWithdrawals
=
ethTransactionWithdrawals
.
Joins
(
"INNER JOIN l2_contract_events ON l2_contract_events.guid = l2_transaction_withdrawals.initiated_l2_event_guid"
)
...
...
@@ -266,10 +262,6 @@ l2_bridge_withdrawals.from_address, l2_bridge_withdrawals.to_address, l2_bridge_
l2_contract_events.transaction_hash AS l2_transaction_hash, proven_l1_events.transaction_hash AS proven_l1_transaction_hash, finalized_l1_events.transaction_hash AS finalized_l1_transaction_hash,
l2_bridge_withdrawals.timestamp, cross_domain_message_hash, local_token_address, remote_token_address`
)
// Since all bridge withdrawals share have the same primary key corresponding to the transaction
// withdrawal, we can simply order by the timestamp in the transaction withdrawal table which will
// order all deposits (bridge & transactions) uniformly
// TODO: cursoring options
query
:=
db
.
gorm
.
Table
(
"(?) AS withdrawals"
,
withdrawalsQuery
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment