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
e08848a9
Commit
e08848a9
authored
Aug 15, 2023
by
Hamdi Allam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix api_test
parent
6e479d69
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
api_test.go
indexer/api/api_test.go
+13
-10
No files found.
indexer/api/api_test.go
View file @
e08848a9
...
@@ -2,7 +2,6 @@ package api
...
@@ -2,7 +2,6 @@ package api
import
(
import
(
"fmt"
"fmt"
"math/big"
"net/http"
"net/http"
"net/http/httptest"
"net/http/httptest"
"testing"
"testing"
...
@@ -21,17 +20,21 @@ var mockAddress = "0x4204204204204204204204204204204204204204"
...
@@ -21,17 +20,21 @@ var mockAddress = "0x4204204204204204204204204204204204204204"
var
(
var
(
deposit
=
database
.
L1BridgeDeposit
{
deposit
=
database
.
L1BridgeDeposit
{
TransactionSourceHash
:
common
.
HexToHash
(
"abc"
),
TransactionSourceHash
:
common
.
HexToHash
(
"abc"
),
CrossDomainMessengerNonce
:
&
database
.
U256
{
Int
:
big
.
NewInt
(
0
)},
BridgeTransfer
:
database
.
BridgeTransfer
{
Tx
:
database
.
Transaction
{},
CrossDomainMessageHash
:
&
common
.
Hash
{},
TokenPair
:
database
.
TokenPair
{},
Tx
:
database
.
Transaction
{},
TokenPair
:
database
.
TokenPair
{},
},
}
}
withdrawal
=
database
.
L2BridgeWithdrawal
{
withdrawal
=
database
.
L2BridgeWithdrawal
{
TransactionWithdrawalHash
:
common
.
HexToHash
(
"0x420"
),
TransactionWithdrawalHash
:
common
.
HexToHash
(
"0x420"
),
CrossDomainMessengerNonce
:
&
database
.
U256
{
Int
:
big
.
NewInt
(
0
)},
BridgeTransfer
:
database
.
BridgeTransfer
{
Tx
:
database
.
Transaction
{},
CrossDomainMessageHash
:
&
common
.
Hash
{},
TokenPair
:
database
.
TokenPair
{},
Tx
:
database
.
Transaction
{},
TokenPair
:
database
.
TokenPair
{},
},
}
}
)
)
...
@@ -39,7 +42,7 @@ func (mbv *MockBridgeTransfersView) L1BridgeDeposit(hash common.Hash) (*database
...
@@ -39,7 +42,7 @@ func (mbv *MockBridgeTransfersView) L1BridgeDeposit(hash common.Hash) (*database
return
&
deposit
,
nil
return
&
deposit
,
nil
}
}
func
(
mbv
*
MockBridgeTransfersView
)
L1BridgeDeposit
ByCrossDomainMessengerNonce
(
nonce
*
big
.
Int
)
(
*
database
.
L1BridgeDeposit
,
error
)
{
func
(
mbv
*
MockBridgeTransfersView
)
L1BridgeDeposit
WithFilter
(
filter
database
.
BridgeTransfer
)
(
*
database
.
L1BridgeDeposit
,
error
)
{
return
&
deposit
,
nil
return
&
deposit
,
nil
}
}
...
@@ -56,7 +59,7 @@ func (mbv *MockBridgeTransfersView) L2BridgeWithdrawal(address common.Hash) (*da
...
@@ -56,7 +59,7 @@ func (mbv *MockBridgeTransfersView) L2BridgeWithdrawal(address common.Hash) (*da
return
&
withdrawal
,
nil
return
&
withdrawal
,
nil
}
}
func
(
mbv
*
MockBridgeTransfersView
)
L2BridgeWithdrawal
ByCrossDomainMessengerNonce
(
nonce
*
big
.
Int
)
(
*
database
.
L2BridgeWithdrawal
,
error
)
{
func
(
mbv
*
MockBridgeTransfersView
)
L2BridgeWithdrawal
WithFilter
(
filter
database
.
BridgeTransfer
)
(
*
database
.
L2BridgeWithdrawal
,
error
)
{
return
&
withdrawal
,
nil
return
&
withdrawal
,
nil
}
}
...
...
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