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
2a8dc033
Unverified
Commit
2a8dc033
authored
Sep 29, 2023
by
Ethen Pociask
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[indexer.client] Addressed PR feedback
parent
1d72344f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
52 deletions
+45
-52
extensions.json
.vscode/extensions.json
+10
-10
settings.json
.vscode/settings.json
+26
-26
deposits.go
indexer/api/routes/deposits.go
+3
-7
validator_test.go
indexer/api/routes/validator_test.go
+2
-2
withdrawals.go
indexer/api/routes/withdrawals.go
+3
-6
bridge_transfers_e2e_test.go
indexer/e2e_tests/bridge_transfers_e2e_test.go
+1
-1
No files found.
.vscode/extensions.json
View file @
2a8dc033
{
{
//
See
https://go.microsoft.com/fwlink/?LinkId=
827846
to
learn
about
workspace
recommendations.
//
See
https://go.microsoft.com/fwlink/?LinkId=
827846
to
learn
about
workspace
recommendations.
//
Extension
identifier
format:
$
{
publisher
}
.$
{
name
}
.
Example:
vscode.csharp
//
Extension
identifier
format:
$
{
publisher
}
.$
{
name
}
.
Example:
vscode.csharp
//
List
of
extensions
which
should
be
recommended
for
users
of
this
workspace.
//
List
of
extensions
which
should
be
recommended
for
users
of
this
workspace.
"recommendations"
:
[
"recommendations"
:
[
"dbaeumer.vscode-eslint"
,
"dbaeumer.vscode-eslint"
,
"editorconfig.editorconfig"
,
"editorconfig.editorconfig"
,
"juanblanco.solidity"
,
"juanblanco.solidity"
,
"golang.go"
,
"golang.go"
,
],
],
}
}
\ No newline at end of file
\ No newline at end of file
.vscode/settings.json
View file @
2a8dc033
{
{
"[typescript]"
:
{
"[typescript]"
:
{
"editor.defaultFormatter"
:
"dbaeumer.vscode-eslint"
,
"editor.defaultFormatter"
:
"dbaeumer.vscode-eslint"
,
"editor.formatOnSave"
:
true
"editor.formatOnSave"
:
true
},
"eslint.workingDirectories"
:
[
{
"directory"
:
"packages/core-utils"
,
"changeProcessCWD"
:
true
},
},
"eslint.workingDirectories"
:
[
{
{
"directory"
:
"packages/common-ts"
,
"directory"
:
"packages/core-utils"
,
"changeProcessCWD"
:
true
"changeProcessCWD"
:
true
},
},
{
{
"directory"
:
"packages/contracts"
,
"directory"
:
"packages/common-ts"
,
"changeProcessCWD"
:
true
"changeProcessCWD"
:
true
},
},
{
{
"directory"
:
"packages/chain-mon"
,
"directory"
:
"packages/contracts"
,
"changeProcessCWD"
:
true
"changeProcessCWD"
:
true
}
},
],
{
"eslint.nodePath"
:
"./node_modules/eslint/bin/"
,
"directory"
:
"packages/chain-mon"
,
"eslint.format.enable"
:
true
,
"changeProcessCWD"
:
true
"editorconfig.generateAuto"
:
false
,
}
"files.trimTrailingWhitespace"
:
true
],
}
"eslint.nodePath"
:
"./node_modules/eslint/bin/"
,
\ No newline at end of file
"eslint.format.enable"
:
true
,
"editorconfig.generateAuto"
:
false
,
"files.trimTrailingWhitespace"
:
true
}
\ No newline at end of file
indexer/api/routes/deposits.go
View file @
2a8dc033
...
@@ -52,24 +52,20 @@ func (h Routes) L1DepositsHandler(w http.ResponseWriter, r *http.Request) {
...
@@ -52,24 +52,20 @@ func (h Routes) L1DepositsHandler(w http.ResponseWriter, r *http.Request) {
err
=
h
.
v
.
ValidateCursor
(
cursor
)
err
=
h
.
v
.
ValidateCursor
(
cursor
)
if
err
!=
nil
{
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
h
.
logger
.
Error
(
"Invalid cursor param"
,
"param"
,
cursor
)
h
.
logger
.
Error
(
"Invalid cursor param"
,
"param"
,
cursor
,
"err"
,
err
.
Error
())
h
.
logger
.
Error
(
err
.
Error
())
return
}
}
limit
,
err
:=
h
.
v
.
ParseValidateLimit
(
limitQuery
)
limit
,
err
:=
h
.
v
.
ParseValidateLimit
(
limitQuery
)
if
err
!=
nil
{
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
h
.
logger
.
Error
(
"Invalid limit param"
,
"param"
,
limitQuery
)
h
.
logger
.
Error
(
"Invalid limit param"
,
"param"
,
limitQuery
,
"err"
,
err
.
Error
())
h
.
logger
.
Error
(
err
.
Error
())
return
return
}
}
deposits
,
err
:=
h
.
view
.
L1BridgeDepositsByAddress
(
address
,
cursor
,
limit
)
deposits
,
err
:=
h
.
view
.
L1BridgeDepositsByAddress
(
address
,
cursor
,
limit
)
if
err
!=
nil
{
if
err
!=
nil
{
http
.
Error
(
w
,
"Internal server error reading deposits"
,
http
.
StatusInternalServerError
)
http
.
Error
(
w
,
"Internal server error reading deposits"
,
http
.
StatusInternalServerError
)
h
.
logger
.
Error
(
"Unable to read deposits from DB"
)
h
.
logger
.
Error
(
"Unable to read deposits from DB"
,
"err"
,
err
.
Error
())
h
.
logger
.
Error
(
err
.
Error
())
return
return
}
}
...
...
indexer/api/routes/validator_test.go
View file @
2a8dc033
...
@@ -6,7 +6,7 @@ import (
...
@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)
)
func
Test
_
ParseValidateLimit
(
t
*
testing
.
T
)
{
func
TestParseValidateLimit
(
t
*
testing
.
T
)
{
v
:=
Validator
{}
v
:=
Validator
{}
// (1) Happy case
// (1) Happy case
...
@@ -25,7 +25,7 @@ func Test_ParseValidateLimit(t *testing.T) {
...
@@ -25,7 +25,7 @@ func Test_ParseValidateLimit(t *testing.T) {
require
.
Error
(
t
,
err
,
"limit must be an integer value"
)
require
.
Error
(
t
,
err
,
"limit must be an integer value"
)
}
}
func
Test
_
ParseValidateAddress
(
t
*
testing
.
T
)
{
func
TestParseValidateAddress
(
t
*
testing
.
T
)
{
v
:=
Validator
{}
v
:=
Validator
{}
// (1) Happy case
// (1) Happy case
...
...
indexer/api/routes/withdrawals.go
View file @
2a8dc033
...
@@ -44,24 +44,21 @@ func (h Routes) L2WithdrawalsHandler(w http.ResponseWriter, r *http.Request) {
...
@@ -44,24 +44,21 @@ func (h Routes) L2WithdrawalsHandler(w http.ResponseWriter, r *http.Request) {
address
,
err
:=
h
.
v
.
ParseValidateAddress
(
addressValue
)
address
,
err
:=
h
.
v
.
ParseValidateAddress
(
addressValue
)
if
err
!=
nil
{
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
h
.
logger
.
Error
(
"Invalid address param"
,
"param"
,
addressValue
)
h
.
logger
.
Error
(
"Invalid address param"
,
"param"
,
addressValue
,
"err"
,
err
)
h
.
logger
.
Error
(
err
.
Error
())
return
return
}
}
err
=
h
.
v
.
ValidateCursor
(
cursor
)
err
=
h
.
v
.
ValidateCursor
(
cursor
)
if
err
!=
nil
{
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
h
.
logger
.
Error
(
"Invalid cursor param"
,
"param"
,
cursor
)
h
.
logger
.
Error
(
"Invalid cursor param"
,
"param"
,
cursor
,
"err"
,
err
)
h
.
logger
.
Error
(
err
.
Error
())
return
return
}
}
limit
,
err
:=
h
.
v
.
ParseValidateLimit
(
limitQuery
)
limit
,
err
:=
h
.
v
.
ParseValidateLimit
(
limitQuery
)
if
err
!=
nil
{
if
err
!=
nil
{
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
http
.
Error
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
h
.
logger
.
Error
(
"Invalid query params"
)
h
.
logger
.
Error
(
"Invalid query params"
,
"err"
,
err
)
h
.
logger
.
Error
(
err
.
Error
())
return
return
}
}
...
...
indexer/e2e_tests/bridge_transfers_e2e_test.go
View file @
2a8dc033
...
@@ -447,7 +447,7 @@ func TestE2EBridgeTransfersCursoredWithdrawals(t *testing.T) {
...
@@ -447,7 +447,7 @@ func TestE2EBridgeTransfersCursoredWithdrawals(t *testing.T) {
}
}
}
}
func
Test
_
ClientGetWithdrawals
(
t
*
testing
.
T
)
{
func
TestClientGetWithdrawals
(
t
*
testing
.
T
)
{
testSuite
:=
createE2ETestSuite
(
t
)
testSuite
:=
createE2ETestSuite
(
t
)
// (1) Generate contract bindings for the L1 and L2 standard bridges
// (1) Generate contract bindings for the L1 and L2 standard bridges
...
...
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