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

[indexer.client] Addressed PR feedback

parent 1d72344f
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
"juanblanco.solidity", "juanblanco.solidity",
"golang.go", "golang.go",
], ],
} }
\ No newline at end of file \ No newline at end of file
...@@ -25,4 +25,4 @@ ...@@ -25,4 +25,4 @@
"eslint.format.enable": true, "eslint.format.enable": true,
"editorconfig.generateAuto": false, "editorconfig.generateAuto": false,
"files.trimTrailingWhitespace": true "files.trimTrailingWhitespace": true
} }
\ No newline at end of file \ 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