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.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"juanblanco.solidity",
"golang.go",
],
}
\ No newline at end of file
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"juanblanco.solidity",
"golang.go",
],
}
\ No newline at end of file
{
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true
},
"eslint.workingDirectories": [
{
"directory": "packages/core-utils",
"changeProcessCWD": true
},
"eslint.workingDirectories": [
{
"directory": "packages/core-utils",
"changeProcessCWD": true
},
{
"directory": "packages/common-ts",
"changeProcessCWD": true
},
{
"directory": "packages/contracts",
"changeProcessCWD": true
},
{
"directory": "packages/chain-mon",
"changeProcessCWD": true
}
],
"eslint.nodePath": "./node_modules/eslint/bin/",
"eslint.format.enable": true,
"editorconfig.generateAuto": false,
"files.trimTrailingWhitespace": true
}
\ No newline at end of file
{
"directory": "packages/common-ts",
"changeProcessCWD": true
},
{
"directory": "packages/contracts",
"changeProcessCWD": true
},
{
"directory": "packages/chain-mon",
"changeProcessCWD": true
}
],
"eslint.nodePath": "./node_modules/eslint/bin/",
"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) {
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
h.logger.Error("Invalid cursor param", "param", cursor, "err", err.Error())
}
limit, err := h.v.ParseValidateLimit(limitQuery)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
h.logger.Error("Invalid limit param", "param", limitQuery)
h.logger.Error(err.Error())
h.logger.Error("Invalid limit param", "param", limitQuery, "err", err.Error())
return
}
deposits, err := h.view.L1BridgeDepositsByAddress(address, cursor, limit)
if err != nil {
http.Error(w, "Internal server error reading deposits", http.StatusInternalServerError)
h.logger.Error("Unable to read deposits from DB")
h.logger.Error(err.Error())
h.logger.Error("Unable to read deposits from DB", "err", err.Error())
return
}
......
......@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/require"
)
func Test_ParseValidateLimit(t *testing.T) {
func TestParseValidateLimit(t *testing.T) {
v := Validator{}
// (1) Happy case
......@@ -25,7 +25,7 @@ func Test_ParseValidateLimit(t *testing.T) {
require.Error(t, err, "limit must be an integer value")
}
func Test_ParseValidateAddress(t *testing.T) {
func TestParseValidateAddress(t *testing.T) {
v := Validator{}
// (1) Happy case
......
......@@ -44,24 +44,21 @@ func (h Routes) L2WithdrawalsHandler(w http.ResponseWriter, r *http.Request) {
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())
h.logger.Error("Invalid address param", "param", addressValue, "err", err)
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())
h.logger.Error("Invalid cursor param", "param", cursor, "err", err)
return
}
limit, err := h.v.ParseValidateLimit(limitQuery)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
h.logger.Error("Invalid query params")
h.logger.Error(err.Error())
h.logger.Error("Invalid query params", "err", err)
return
}
......
......@@ -447,7 +447,7 @@ func TestE2EBridgeTransfersCursoredWithdrawals(t *testing.T) {
}
}
func Test_ClientGetWithdrawals(t *testing.T) {
func TestClientGetWithdrawals(t *testing.T) {
testSuite := createE2ETestSuite(t)
// (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