Commit 2a8dc033 authored by Ethen Pociask's avatar Ethen Pociask

[indexer.client] Addressed PR feedback

parent 1d72344f
{ {
// 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
{ {
"[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
...@@ -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
} }
......
...@@ -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
......
...@@ -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
} }
......
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment