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
75c62315
Unverified
Commit
75c62315
authored
Sep 26, 2023
by
Ethen Pociask
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[indexer.client] Addressing PR feedback: URL -> BaseURL
parent
a91f95a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
client.go
indexer/client/client.go
+4
-4
setup.go
indexer/e2e_tests/setup.go
+1
-1
No files found.
indexer/client/client.go
View file @
75c62315
...
@@ -47,7 +47,7 @@ func WithTimeout(t time.Duration) Option {
...
@@ -47,7 +47,7 @@ func WithTimeout(t time.Duration) Option {
// Config ... Indexer client config struct
// Config ... Indexer client config struct
type
Config
struct
{
type
Config
struct
{
PaginationLimit
int
PaginationLimit
int
URL
string
BaseURL
string
}
}
// Client ... Indexer client struct
// Client ... Indexer client struct
...
@@ -113,7 +113,7 @@ func (c *Client) doRecordRequest(method string, endpoint string) ([]byte, error)
...
@@ -113,7 +113,7 @@ func (c *Client) doRecordRequest(method string, endpoint string) ([]byte, error)
// HealthCheck ... Checks the health of the indexer API
// HealthCheck ... Checks the health of the indexer API
func
(
c
*
Client
)
HealthCheck
()
error
{
func
(
c
*
Client
)
HealthCheck
()
error
{
_
,
err
:=
c
.
doRecordRequest
(
healthz
,
c
.
cfg
.
URL
+
api
.
HealthPath
)
_
,
err
:=
c
.
doRecordRequest
(
healthz
,
c
.
cfg
.
Base
URL
+
api
.
HealthPath
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
@@ -125,7 +125,7 @@ func (c *Client) HealthCheck() error {
...
@@ -125,7 +125,7 @@ func (c *Client) HealthCheck() error {
// GetDepositsByAddress ... Gets a deposit response object provided an L1 address and cursor
// GetDepositsByAddress ... Gets a deposit response object provided an L1 address and cursor
func
(
c
*
Client
)
GetDepositsByAddress
(
l1Address
common
.
Address
,
cursor
string
)
(
*
database
.
L1BridgeDepositsResponse
,
error
)
{
func
(
c
*
Client
)
GetDepositsByAddress
(
l1Address
common
.
Address
,
cursor
string
)
(
*
database
.
L1BridgeDepositsResponse
,
error
)
{
var
dResponse
*
database
.
L1BridgeDepositsResponse
var
dResponse
*
database
.
L1BridgeDepositsResponse
url
:=
c
.
cfg
.
URL
+
api
.
DepositsPath
+
l1Address
.
String
()
+
urlParams
url
:=
c
.
cfg
.
Base
URL
+
api
.
DepositsPath
+
l1Address
.
String
()
+
urlParams
endpoint
:=
fmt
.
Sprintf
(
url
,
cursor
,
c
.
cfg
.
PaginationLimit
)
endpoint
:=
fmt
.
Sprintf
(
url
,
cursor
,
c
.
cfg
.
PaginationLimit
)
resp
,
err
:=
c
.
doRecordRequest
(
deposits
,
endpoint
)
resp
,
err
:=
c
.
doRecordRequest
(
deposits
,
endpoint
)
...
@@ -190,7 +190,7 @@ func (c *Client) GetAllWithdrawalsByAddress(l2Address common.Address) ([]databas
...
@@ -190,7 +190,7 @@ func (c *Client) GetAllWithdrawalsByAddress(l2Address common.Address) ([]databas
// GetWithdrawalsByAddress ... Gets a withdrawal response object provided an L2 address and cursor
// GetWithdrawalsByAddress ... Gets a withdrawal response object provided an L2 address and cursor
func
(
c
*
Client
)
GetWithdrawalsByAddress
(
l2Address
common
.
Address
,
cursor
string
)
(
*
database
.
L2BridgeWithdrawalsResponse
,
error
)
{
func
(
c
*
Client
)
GetWithdrawalsByAddress
(
l2Address
common
.
Address
,
cursor
string
)
(
*
database
.
L2BridgeWithdrawalsResponse
,
error
)
{
var
wResponse
*
database
.
L2BridgeWithdrawalsResponse
var
wResponse
*
database
.
L2BridgeWithdrawalsResponse
url
:=
c
.
cfg
.
URL
+
api
.
WithdrawalsPath
+
l2Address
.
String
()
+
urlParams
url
:=
c
.
cfg
.
Base
URL
+
api
.
WithdrawalsPath
+
l2Address
.
String
()
+
urlParams
endpoint
:=
fmt
.
Sprintf
(
url
,
cursor
,
c
.
cfg
.
PaginationLimit
)
endpoint
:=
fmt
.
Sprintf
(
url
,
cursor
,
c
.
cfg
.
PaginationLimit
)
resp
,
err
:=
c
.
doRecordRequest
(
withdrawals
,
endpoint
)
resp
,
err
:=
c
.
doRecordRequest
(
withdrawals
,
endpoint
)
...
...
indexer/e2e_tests/setup.go
View file @
75c62315
...
@@ -138,7 +138,7 @@ func createE2ETestSuite(t *testing.T) E2ETestSuite {
...
@@ -138,7 +138,7 @@ func createE2ETestSuite(t *testing.T) E2ETestSuite {
client
,
err
:=
client
.
NewClient
(
&
client
.
Config
{
client
,
err
:=
client
.
NewClient
(
&
client
.
Config
{
PaginationLimit
:
100
,
PaginationLimit
:
100
,
URL
:
fmt
.
Sprintf
(
"http://%s:%d"
,
indexerCfg
.
HTTPServer
.
Host
,
indexerCfg
.
HTTPServer
.
Port
),
BaseURL
:
fmt
.
Sprintf
(
"http://%s:%d"
,
indexerCfg
.
HTTPServer
.
Host
,
indexerCfg
.
HTTPServer
.
Port
),
})
})
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
...
...
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