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
b79cb066
Unverified
Commit
b79cb066
authored
Sep 27, 2023
by
Ethen Pociask
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[indexer.client] Updated tests
parent
fea2d96f
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
151 additions
and
78 deletions
+151
-78
api.go
indexer/api/api.go
+1
-1
api_test.go
indexer/api/api_test.go
+3
-3
models.go
indexer/api/models/models.go
+45
-0
deposits.go
indexer/api/routes/deposits.go
+23
-27
validator.go
indexer/api/routes/validator.go
+19
-3
validator_test.go
indexer/api/routes/validator_test.go
+21
-2
withdrawals.go
indexer/api/routes/withdrawals.go
+23
-27
client.go
indexer/client/client.go
+9
-9
bridge_transfers_e2e_test.go
indexer/e2e_tests/bridge_transfers_e2e_test.go
+6
-6
setup.go
indexer/e2e_tests/setup.go
+1
-0
No files found.
indexer/api/api.go
View file @
b79cb066
...
...
@@ -135,7 +135,7 @@ func (a *API) startServer(ctx context.Context) error {
}
// Update the port in the config in case the OS chose a different port
// than the one we requested (e.g.
port 0
)
// than the one we requested (e.g.
using port 0 to fetch a random open port
)
a
.
serverConfig
.
Port
=
tcpAddr
.
Port
err
=
http
.
Serve
(
listener
,
server
.
Handler
)
...
...
indexer/api/api_test.go
View file @
b79cb066
...
...
@@ -7,7 +7,7 @@ import (
"net/http/httptest"
"testing"
"github.com/ethereum-optimism/optimism/indexer/api/
route
s"
"github.com/ethereum-optimism/optimism/indexer/api/
model
s"
"github.com/ethereum-optimism/optimism/indexer/config"
"github.com/ethereum-optimism/optimism/indexer/database"
"github.com/ethereum-optimism/optimism/op-node/testlog"
...
...
@@ -116,7 +116,7 @@ func TestL1BridgeDepositsHandler(t *testing.T) {
assert
.
Equal
(
t
,
http
.
StatusOK
,
responseRecorder
.
Code
)
var
resp
route
s
.
DepositResponse
var
resp
model
s
.
DepositResponse
err
=
json
.
Unmarshal
(
responseRecorder
.
Body
.
Bytes
(),
&
resp
)
assert
.
Nil
(
t
,
err
)
...
...
@@ -137,7 +137,7 @@ func TestL2BridgeWithdrawalsByAddressHandler(t *testing.T) {
responseRecorder
:=
httptest
.
NewRecorder
()
api
.
router
.
ServeHTTP
(
responseRecorder
,
request
)
var
resp
route
s
.
WithdrawalResponse
var
resp
model
s
.
WithdrawalResponse
err
=
json
.
Unmarshal
(
responseRecorder
.
Body
.
Bytes
(),
&
resp
)
assert
.
Nil
(
t
,
err
)
...
...
indexer/api/models/models.go
0 → 100644
View file @
b79cb066
package
models
// DepositItem ... Deposit item model for API responses
type
DepositItem
struct
{
Guid
string
`json:"guid"`
From
string
`json:"from"`
To
string
`json:"to"`
Timestamp
uint64
`json:"timestamp"`
L1BlockHash
string
`json:"l1BlockHash"`
L1TxHash
string
`json:"l1TxHash"`
L2TxHash
string
`json:"l2TxHash"`
Amount
string
`json:"amount"`
L1TokenAddress
string
`json:"l1TokenAddress"`
L2TokenAddress
string
`json:"l2TokenAddress"`
}
// DepositResponse ... Data model for API JSON response
type
DepositResponse
struct
{
Cursor
string
`json:"cursor"`
HasNextPage
bool
`json:"hasNextPage"`
Items
[]
DepositItem
`json:"items"`
}
// WithdrawalItem ... Data model for API JSON response
type
WithdrawalItem
struct
{
Guid
string
`json:"guid"`
From
string
`json:"from"`
To
string
`json:"to"`
TransactionHash
string
`json:"transactionHash"`
MessageHash
string
`json:"messageHash"`
Timestamp
uint64
`json:"timestamp"`
L2BlockHash
string
`json:"l2BlockHash"`
Amount
string
`json:"amount"`
ProofTransactionHash
string
`json:"proofTransactionHash"`
ClaimTransactionHash
string
`json:"claimTransactionHash"`
L1TokenAddress
string
`json:"l1TokenAddress"`
L2TokenAddress
string
`json:"l2TokenAddress"`
}
// WithdrawalResponse ... Data model for API JSON response
type
WithdrawalResponse
struct
{
Cursor
string
`json:"cursor"`
HasNextPage
bool
`json:"hasNextPage"`
Items
[]
WithdrawalItem
`json:"items"`
}
indexer/api/routes/deposits.go
View file @
b79cb066
...
...
@@ -3,37 +3,17 @@ package routes
import
(
"net/http"
"github.com/ethereum-optimism/optimism/indexer/api/models"
"github.com/ethereum-optimism/optimism/indexer/database"
"github.com/ethereum/go-ethereum/common"
"github.com/go-chi/chi/v5"
)
// DepositItem ... Deposit item model for API responses
type
DepositItem
struct
{
Guid
string
`json:"guid"`
From
string
`json:"from"`
To
string
`json:"to"`
Timestamp
uint64
`json:"timestamp"`
L1BlockHash
string
`json:"l1BlockHash"`
L1TxHash
string
`json:"l1TxHash"`
L2TxHash
string
`json:"l2TxHash"`
Amount
string
`json:"amount"`
L1TokenAddress
string
`json:"l1TokenAddress"`
L2TokenAddress
string
`json:"l2TokenAddress"`
}
// DepositResponse ... Data model for API JSON response
type
DepositResponse
struct
{
Cursor
string
`json:"cursor"`
HasNextPage
bool
`json:"hasNextPage"`
Items
[]
DepositItem
`json:"items"`
}
// newDepositResponse ... Converts a database.L1BridgeDepositsResponse to an api.DepositResponse
func
newDepositResponse
(
deposits
*
database
.
L1BridgeDepositsResponse
)
DepositResponse
{
items
:=
make
([]
DepositItem
,
len
(
deposits
.
Deposits
))
func
newDepositResponse
(
deposits
*
database
.
L1BridgeDepositsResponse
)
models
.
DepositResponse
{
items
:=
make
([]
models
.
DepositItem
,
len
(
deposits
.
Deposits
))
for
i
,
deposit
:=
range
deposits
.
Deposits
{
item
:=
DepositItem
{
item
:=
models
.
DepositItem
{
Guid
:
deposit
.
L1BridgeDeposit
.
TransactionSourceHash
.
String
(),
L1BlockHash
:
deposit
.
L1BlockHash
.
String
(),
Timestamp
:
deposit
.
L1BridgeDeposit
.
Tx
.
Timestamp
,
...
...
@@ -48,7 +28,7 @@ func newDepositResponse(deposits *database.L1BridgeDepositsResponse) DepositResp
items
[
i
]
=
item
}
return
DepositResponse
{
return
models
.
DepositResponse
{
Cursor
:
deposits
.
Cursor
,
HasNextPage
:
deposits
.
HasNextPage
,
Items
:
items
,
...
...
@@ -57,10 +37,26 @@ func newDepositResponse(deposits *database.L1BridgeDepositsResponse) DepositResp
// L1DepositsHandler ... Handles /api/v0/deposits/{address} GET requests
func
(
h
Routes
)
L1DepositsHandler
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
address
:=
common
.
HexToAddress
(
chi
.
URLParam
(
r
,
"address"
)
)
address
Value
:=
chi
.
URLParam
(
r
,
"address"
)
cursor
:=
r
.
URL
.
Query
()
.
Get
(
"cursor"
)
limitQuery
:=
r
.
URL
.
Query
()
.
Get
(
"limit"
)
address
,
err
:=
h
.
v
.
ParseValidateAddress
(
addressValue
)
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
h
.
logger
.
Error
(
"Invalid address param"
,
"param"
,
addressValue
)
h
.
logger
.
Error
(
err
.
Error
())
return
}
err
=
h
.
v
.
ValidateCursor
(
cursor
)
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
h
.
logger
.
Error
(
"Invalid cursor param"
,
"param"
,
cursor
)
h
.
logger
.
Error
(
err
.
Error
())
return
}
limit
,
err
:=
h
.
v
.
ParseValidateLimit
(
limitQuery
)
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
...
...
indexer/api/routes/validator.go
View file @
b79cb066
...
...
@@ -9,8 +9,7 @@ import (
)
// Validator ... Validates API user request parameters
type
Validator
struct
{
}
type
Validator
struct
{}
// ParseValidateLimit ... Validates and parses the limit query parameters
func
(
v
*
Validator
)
ParseValidateLimit
(
limit
string
)
(
int
,
error
)
{
...
...
@@ -33,7 +32,7 @@ func (v *Validator) ParseValidateLimit(limit string) (int, error) {
// ParseValidateAddress ... Validates and parses the address query parameter
func
(
v
*
Validator
)
ParseValidateAddress
(
addr
string
)
(
common
.
Address
,
error
)
{
if
common
.
IsHexAddress
(
addr
)
{
if
!
common
.
IsHexAddress
(
addr
)
{
return
common
.
Address
{},
errors
.
New
(
"address must be represented as a valid hexadecimal string"
)
}
...
...
@@ -44,3 +43,20 @@ func (v *Validator) ParseValidateAddress(addr string) (common.Address, error) {
return
parsedAddr
,
nil
}
// ValidateCursor ... Validates and parses the cursor query parameter
func
(
v
*
Validator
)
ValidateCursor
(
cursor
string
)
error
{
if
cursor
==
""
{
return
nil
}
if
len
(
cursor
)
!=
66
{
// 0x + 64 chars
return
errors
.
New
(
"cursor must be a 32 byte hex string"
)
}
if
cursor
[
:
2
]
!=
"0x"
{
return
errors
.
New
(
"cursor must begin with 0x"
)
}
return
nil
}
indexer/api/routes/validator_test.go
View file @
b79cb066
...
...
@@ -29,7 +29,7 @@ func Test_ParseValidateAddress(t *testing.T) {
v
:=
Validator
{}
// (1) Happy case
addr
:=
"0x
1
"
addr
:=
"0x
95222290DD7278Aa3Ddd389Cc1E1d165CC4BAfe5
"
_
,
err
:=
v
.
ParseValidateAddress
(
addr
)
require
.
NoError
(
t
,
err
,
"address should be pass"
)
...
...
@@ -39,7 +39,26 @@ func Test_ParseValidateAddress(t *testing.T) {
require
.
Error
(
t
,
err
,
"address must be represented as a valid hexadecimal string"
)
// (3) Zero address
addr
=
"0x0"
addr
=
"0x0
000000000000000000000000000000000000000
"
_
,
err
=
v
.
ParseValidateAddress
(
addr
)
require
.
Error
(
t
,
err
,
"address cannot be black-hole value"
)
}
func
Test_ParseValidateCursor
(
t
*
testing
.
T
)
{
v
:=
Validator
{}
// (1) Happy case
cursor
:=
"0xf3fd2eb696dab4263550b938726f9b3606e334cce6ebe27446bc26cb700b94e0"
err
:=
v
.
ValidateCursor
(
cursor
)
require
.
NoError
(
t
,
err
,
"cursor should be pass"
)
// (2) Invalid length
cursor
=
"0x000"
err
=
v
.
ValidateCursor
(
cursor
)
require
.
Error
(
t
,
err
,
"cursor must be 32 byte hex string"
)
// (3) Invalid hex
cursor
=
"0🫡"
err
=
v
.
ValidateCursor
(
cursor
)
require
.
Error
(
t
,
err
,
"cursor must start with 0x"
)
}
indexer/api/routes/withdrawals.go
View file @
b79cb066
...
...
@@ -3,37 +3,17 @@ package routes
import
(
"net/http"
"github.com/ethereum-optimism/optimism/indexer/api/models"
"github.com/ethereum-optimism/optimism/indexer/database"
"github.com/ethereum/go-ethereum/common"
"github.com/go-chi/chi/v5"
)
type
WithdrawalItem
struct
{
Guid
string
`json:"guid"`
From
string
`json:"from"`
To
string
`json:"to"`
TransactionHash
string
`json:"transactionHash"`
MessageHash
string
`json:"messageHash"`
Timestamp
uint64
`json:"timestamp"`
L2BlockHash
string
`json:"l2BlockHash"`
Amount
string
`json:"amount"`
ProofTransactionHash
string
`json:"proofTransactionHash"`
ClaimTransactionHash
string
`json:"claimTransactionHash"`
L1TokenAddress
string
`json:"l1TokenAddress"`
L2TokenAddress
string
`json:"l2TokenAddress"`
}
type
WithdrawalResponse
struct
{
Cursor
string
`json:"cursor"`
HasNextPage
bool
`json:"hasNextPage"`
Items
[]
WithdrawalItem
`json:"items"`
}
// FIXME make a pure function that returns a struct instead of newWithdrawalResponse
func
newWithdrawalResponse
(
withdrawals
*
database
.
L2BridgeWithdrawalsResponse
)
WithdrawalResponse
{
items
:=
make
([]
WithdrawalItem
,
len
(
withdrawals
.
Withdrawals
))
// newWithdrawalResponse ... Converts a database.L2BridgeWithdrawalsResponse to an api.WithdrawalResponse
func
newWithdrawalResponse
(
withdrawals
*
database
.
L2BridgeWithdrawalsResponse
)
models
.
WithdrawalResponse
{
items
:=
make
([]
models
.
WithdrawalItem
,
len
(
withdrawals
.
Withdrawals
))
for
i
,
withdrawal
:=
range
withdrawals
.
Withdrawals
{
item
:=
WithdrawalItem
{
item
:=
models
.
WithdrawalItem
{
Guid
:
withdrawal
.
L2BridgeWithdrawal
.
TransactionWithdrawalHash
.
String
(),
L2BlockHash
:
withdrawal
.
L2BlockHash
.
String
(),
From
:
withdrawal
.
L2BridgeWithdrawal
.
Tx
.
FromAddress
.
String
(),
...
...
@@ -48,7 +28,7 @@ func newWithdrawalResponse(withdrawals *database.L2BridgeWithdrawalsResponse) Wi
items
[
i
]
=
item
}
return
WithdrawalResponse
{
return
models
.
WithdrawalResponse
{
Cursor
:
withdrawals
.
Cursor
,
HasNextPage
:
withdrawals
.
HasNextPage
,
Items
:
items
,
...
...
@@ -57,10 +37,26 @@ func newWithdrawalResponse(withdrawals *database.L2BridgeWithdrawalsResponse) Wi
// L2WithdrawalsHandler ... Handles /api/v0/withdrawals/{address} GET requests
func
(
h
Routes
)
L2WithdrawalsHandler
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
address
:=
common
.
HexToAddress
(
chi
.
URLParam
(
r
,
"address"
)
)
address
Value
:=
chi
.
URLParam
(
r
,
"address"
)
cursor
:=
r
.
URL
.
Query
()
.
Get
(
"cursor"
)
limitQuery
:=
r
.
URL
.
Query
()
.
Get
(
"limit"
)
address
,
err
:=
h
.
v
.
ParseValidateAddress
(
addressValue
)
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
h
.
logger
.
Error
(
"Invalid address param"
,
"param"
,
addressValue
)
h
.
logger
.
Error
(
err
.
Error
())
return
}
err
=
h
.
v
.
ValidateCursor
(
cursor
)
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
h
.
logger
.
Error
(
"Invalid cursor param"
,
"param"
,
cursor
)
h
.
logger
.
Error
(
err
.
Error
())
return
}
limit
,
err
:=
h
.
v
.
ParseValidateLimit
(
limitQuery
)
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
...
...
indexer/client/client.go
View file @
b79cb066
...
...
@@ -9,7 +9,7 @@ import (
"encoding/json"
"github.com/ethereum-optimism/optimism/indexer/api"
"github.com/ethereum-optimism/optimism/indexer/api/
route
s"
"github.com/ethereum-optimism/optimism/indexer/api/
model
s"
"github.com/ethereum-optimism/optimism/indexer/node"
"github.com/ethereum/go-ethereum/common"
)
...
...
@@ -123,8 +123,8 @@ func (c *Client) HealthCheck() error {
}
// GetDepositsByAddress ... Gets a deposit response object provided an L1 address and cursor
func
(
c
*
Client
)
GetDepositsByAddress
(
l1Address
common
.
Address
,
cursor
string
)
(
*
route
s
.
DepositResponse
,
error
)
{
var
dResponse
*
route
s
.
DepositResponse
func
(
c
*
Client
)
GetDepositsByAddress
(
l1Address
common
.
Address
,
cursor
string
)
(
*
model
s
.
DepositResponse
,
error
)
{
var
dResponse
*
model
s
.
DepositResponse
url
:=
c
.
cfg
.
BaseURL
+
api
.
DepositsPath
+
l1Address
.
String
()
+
urlParams
endpoint
:=
fmt
.
Sprintf
(
url
,
cursor
,
c
.
cfg
.
PaginationLimit
)
...
...
@@ -141,8 +141,8 @@ func (c *Client) GetDepositsByAddress(l1Address common.Address, cursor string) (
}
// GetAllDepositsByAddress ... Gets all deposits provided a L1 address
func
(
c
*
Client
)
GetAllDepositsByAddress
(
l1Address
common
.
Address
)
([]
route
s
.
DepositItem
,
error
)
{
var
deposits
[]
route
s
.
DepositItem
func
(
c
*
Client
)
GetAllDepositsByAddress
(
l1Address
common
.
Address
)
([]
model
s
.
DepositItem
,
error
)
{
var
deposits
[]
model
s
.
DepositItem
cursor
:=
""
for
{
...
...
@@ -165,8 +165,8 @@ func (c *Client) GetAllDepositsByAddress(l1Address common.Address) ([]routes.Dep
}
// GetAllWithdrawalsByAddress ... Gets all withdrawals provided a L2 address
func
(
c
*
Client
)
GetAllWithdrawalsByAddress
(
l2Address
common
.
Address
)
([]
route
s
.
WithdrawalItem
,
error
)
{
var
withdrawals
[]
route
s
.
WithdrawalItem
func
(
c
*
Client
)
GetAllWithdrawalsByAddress
(
l2Address
common
.
Address
)
([]
model
s
.
WithdrawalItem
,
error
)
{
var
withdrawals
[]
model
s
.
WithdrawalItem
cursor
:=
""
for
{
...
...
@@ -188,8 +188,8 @@ func (c *Client) GetAllWithdrawalsByAddress(l2Address common.Address) ([]routes.
}
// GetWithdrawalsByAddress ... Gets a withdrawal response object provided an L2 address and cursor
func
(
c
*
Client
)
GetWithdrawalsByAddress
(
l2Address
common
.
Address
,
cursor
string
)
(
*
route
s
.
WithdrawalResponse
,
error
)
{
var
wResponse
*
route
s
.
WithdrawalResponse
func
(
c
*
Client
)
GetWithdrawalsByAddress
(
l2Address
common
.
Address
,
cursor
string
)
(
*
model
s
.
WithdrawalResponse
,
error
)
{
var
wResponse
*
model
s
.
WithdrawalResponse
url
:=
c
.
cfg
.
BaseURL
+
api
.
WithdrawalsPath
+
l2Address
.
String
()
+
urlParams
endpoint
:=
fmt
.
Sprintf
(
url
,
cursor
,
c
.
cfg
.
PaginationLimit
)
...
...
indexer/e2e_tests/bridge_transfers_e2e_test.go
View file @
b79cb066
...
...
@@ -52,7 +52,7 @@ func TestE2EBridgeTransfersStandardBridgeETHDeposit(t *testing.T) {
}))
cursor
:=
""
limit
:=
0
limit
:=
10
0
aliceDeposits
,
err
:=
testSuite
.
DB
.
BridgeTransfers
.
L1BridgeDepositsByAddress
(
aliceAddr
,
cursor
,
limit
)
...
...
@@ -118,7 +118,7 @@ func TestE2EBridgeTransfersOptimismPortalETHReceive(t *testing.T) {
return
l1Header
!=
nil
&&
l1Header
.
Number
.
Uint64
()
>=
portalDepositReceipt
.
BlockNumber
.
Uint64
(),
nil
}))
aliceDeposits
,
err
:=
testSuite
.
DB
.
BridgeTransfers
.
L1BridgeDepositsByAddress
(
aliceAddr
,
""
,
0
)
aliceDeposits
,
err
:=
testSuite
.
DB
.
BridgeTransfers
.
L1BridgeDepositsByAddress
(
aliceAddr
,
""
,
1
)
require
.
NoError
(
t
,
err
)
require
.
NotNil
(
t
,
aliceDeposits
)
require
.
Len
(
t
,
aliceDeposits
.
Deposits
,
1
)
...
...
@@ -145,7 +145,7 @@ func TestE2EBridgeTransfersOptimismPortalETHReceive(t *testing.T) {
}))
// Still nil as the withdrawal did not occur through the standard bridge
aliceDeposits
,
err
=
testSuite
.
DB
.
BridgeTransfers
.
L1BridgeDepositsByAddress
(
aliceAddr
,
""
,
0
)
aliceDeposits
,
err
=
testSuite
.
DB
.
BridgeTransfers
.
L1BridgeDepositsByAddress
(
aliceAddr
,
""
,
1
)
require
.
NoError
(
t
,
err
)
require
.
Nil
(
t
,
aliceDeposits
.
Deposits
[
0
]
.
L1BridgeDeposit
.
CrossDomainMessageHash
)
}
...
...
@@ -187,7 +187,7 @@ func TestE2EBridgeTransfersCursoredDeposits(t *testing.T) {
}))
// Get All
aliceDeposits
,
err
:=
testSuite
.
DB
.
BridgeTransfers
.
L1BridgeDepositsByAddress
(
aliceAddr
,
""
,
0
)
aliceDeposits
,
err
:=
testSuite
.
DB
.
BridgeTransfers
.
L1BridgeDepositsByAddress
(
aliceAddr
,
""
,
3
)
require
.
NotNil
(
t
,
aliceDeposits
)
require
.
NoError
(
t
,
err
)
require
.
Len
(
t
,
aliceDeposits
.
Deposits
,
3
)
...
...
@@ -200,14 +200,14 @@ func TestE2EBridgeTransfersCursoredDeposits(t *testing.T) {
require
.
Len
(
t
,
aliceDeposits
.
Deposits
,
2
)
require
.
True
(
t
,
aliceDeposits
.
HasNextPage
)
aliceDeposits
,
err
=
testSuite
.
DB
.
BridgeTransfers
.
L1BridgeDepositsByAddress
(
aliceAddr
,
aliceDeposits
.
Cursor
,
2
)
aliceDeposits
,
err
=
testSuite
.
DB
.
BridgeTransfers
.
L1BridgeDepositsByAddress
(
aliceAddr
,
aliceDeposits
.
Cursor
,
1
)
require
.
NoError
(
t
,
err
)
require
.
NotNil
(
t
,
aliceDeposits
)
require
.
Len
(
t
,
aliceDeposits
.
Deposits
,
1
)
require
.
False
(
t
,
aliceDeposits
.
HasNextPage
)
// Returns the results in the right order
aliceDeposits
,
err
=
testSuite
.
DB
.
BridgeTransfers
.
L1BridgeDepositsByAddress
(
aliceAddr
,
""
,
100
)
aliceDeposits
,
err
=
testSuite
.
DB
.
BridgeTransfers
.
L1BridgeDepositsByAddress
(
aliceAddr
,
""
,
3
)
require
.
NotNil
(
t
,
aliceDeposits
)
require
.
NoError
(
t
,
err
)
for
i
:=
0
;
i
<
3
;
i
++
{
...
...
indexer/e2e_tests/setup.go
View file @
b79cb066
...
...
@@ -26,6 +26,7 @@ import (
/*
NOTE - Most of the current tests fetch chain data via direct database queries. These could all
be transitioned to use the API client instead to better simulate/validate real-world usage.
Supporting this would potentially require adding new API endpoints for the specific query lookup types.
*/
type
E2ETestSuite
struct
{
...
...
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