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
1369fd9f
Commit
1369fd9f
authored
Oct 10, 2023
by
Hamdi Allam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust unit test to catch this
parent
a13573d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
bridge_transactions_e2e_test.go
indexer/e2e_tests/bridge_transactions_e2e_test.go
+5
-2
20230523_create_schema.sql
indexer/migrations/20230523_create_schema.sql
+4
-1
No files found.
indexer/e2e_tests/bridge_transactions_e2e_test.go
View file @
1369fd9f
...
@@ -26,6 +26,7 @@ func TestE2EBridgeTransactionsOptimismPortalDeposits(t *testing.T) {
...
@@ -26,6 +26,7 @@ func TestE2EBridgeTransactionsOptimismPortalDeposits(t *testing.T) {
optimismPortal
,
err
:=
bindings
.
NewOptimismPortal
(
testSuite
.
OpCfg
.
L1Deployments
.
OptimismPortalProxy
,
testSuite
.
L1Client
)
optimismPortal
,
err
:=
bindings
.
NewOptimismPortal
(
testSuite
.
OpCfg
.
L1Deployments
.
OptimismPortalProxy
,
testSuite
.
L1Client
)
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
bobAddr
:=
testSuite
.
OpCfg
.
Secrets
.
Addresses
()
.
Bob
aliceAddr
:=
testSuite
.
OpCfg
.
Secrets
.
Addresses
()
.
Alice
aliceAddr
:=
testSuite
.
OpCfg
.
Secrets
.
Addresses
()
.
Alice
// attach 1 ETH to the deposit and random calldata
// attach 1 ETH to the deposit and random calldata
...
@@ -34,7 +35,9 @@ func TestE2EBridgeTransactionsOptimismPortalDeposits(t *testing.T) {
...
@@ -34,7 +35,9 @@ func TestE2EBridgeTransactionsOptimismPortalDeposits(t *testing.T) {
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
l1Opts
.
Value
=
big
.
NewInt
(
params
.
Ether
)
l1Opts
.
Value
=
big
.
NewInt
(
params
.
Ether
)
depositTx
,
err
:=
optimismPortal
.
DepositTransaction
(
l1Opts
,
aliceAddr
,
l1Opts
.
Value
,
100
_000
,
false
,
calldata
)
// In the same deposit transaction, transfer, 0.5ETH to Bob. We do this to ensure we're only indexing
// bridged funds from the source address versus any transferred value to a recepient in the same L2 transaction
depositTx
,
err
:=
optimismPortal
.
DepositTransaction
(
l1Opts
,
bobAddr
,
big
.
NewInt
(
params
.
Ether
/
2
),
100
_000
,
false
,
calldata
)
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
depositReceipt
,
err
:=
wait
.
ForReceiptOK
(
context
.
Background
(),
testSuite
.
L1Client
,
depositTx
.
Hash
())
depositReceipt
,
err
:=
wait
.
ForReceiptOK
(
context
.
Background
(),
testSuite
.
L1Client
,
depositTx
.
Hash
())
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
...
@@ -57,7 +60,7 @@ func TestE2EBridgeTransactionsOptimismPortalDeposits(t *testing.T) {
...
@@ -57,7 +60,7 @@ func TestE2EBridgeTransactionsOptimismPortalDeposits(t *testing.T) {
require
.
Equal
(
t
,
uint64
(
100
_000
),
deposit
.
GasLimit
.
Uint64
())
require
.
Equal
(
t
,
uint64
(
100
_000
),
deposit
.
GasLimit
.
Uint64
())
require
.
Equal
(
t
,
uint64
(
params
.
Ether
),
deposit
.
Tx
.
Amount
.
Uint64
())
require
.
Equal
(
t
,
uint64
(
params
.
Ether
),
deposit
.
Tx
.
Amount
.
Uint64
())
require
.
Equal
(
t
,
aliceAddr
,
deposit
.
Tx
.
FromAddress
)
require
.
Equal
(
t
,
aliceAddr
,
deposit
.
Tx
.
FromAddress
)
require
.
Equal
(
t
,
alice
Addr
,
deposit
.
Tx
.
ToAddress
)
require
.
Equal
(
t
,
bob
Addr
,
deposit
.
Tx
.
ToAddress
)
require
.
ElementsMatch
(
t
,
calldata
,
deposit
.
Tx
.
Data
)
require
.
ElementsMatch
(
t
,
calldata
,
deposit
.
Tx
.
Data
)
event
,
err
:=
testSuite
.
DB
.
ContractEvents
.
L1ContractEvent
(
deposit
.
InitiatedL1EventGUID
)
event
,
err
:=
testSuite
.
DB
.
ContractEvents
.
L1ContractEvent
(
deposit
.
InitiatedL1EventGUID
)
...
...
indexer/migrations/20230523_create_schema.sql
View file @
1369fd9f
...
@@ -92,7 +92,10 @@ CREATE TABLE IF NOT EXISTS l1_transaction_deposits (
...
@@ -92,7 +92,10 @@ CREATE TABLE IF NOT EXISTS l1_transaction_deposits (
l2_transaction_hash
VARCHAR
NOT
NULL
UNIQUE
,
l2_transaction_hash
VARCHAR
NOT
NULL
UNIQUE
,
initiated_l1_event_guid
VARCHAR
NOT
NULL
UNIQUE
REFERENCES
l1_contract_events
(
guid
)
ON
DELETE
CASCADE
,
initiated_l1_event_guid
VARCHAR
NOT
NULL
UNIQUE
REFERENCES
l1_contract_events
(
guid
)
ON
DELETE
CASCADE
,
-- transaction data
-- transaction data. NOTE: `to_address` is the recipient of funds transferred in value field of the
-- L2 deposit transaction and not the amount minted on L1 from the source address. Hence the `amount`
-- column in this table does NOT indiciate the amount transferred to the recipient but instead funds
-- bridged from L1 into `from_address`.
from_address
VARCHAR
NOT
NULL
,
from_address
VARCHAR
NOT
NULL
,
to_address
VARCHAR
NOT
NULL
,
to_address
VARCHAR
NOT
NULL
,
...
...
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