From a85852d97ff721a66977cc2c5b79aa72dc7e7551 Mon Sep 17 00:00:00 2001 From: nagdahimanshu Date: Tue, 25 Jun 2024 13:17:57 +0200 Subject: [PATCH 1/2] Update parsing --- internal/server/middleware.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/server/middleware.go b/internal/server/middleware.go index 414c9577..15f4bb52 100644 --- a/internal/server/middleware.go +++ b/internal/server/middleware.go @@ -73,7 +73,7 @@ func (l *Limiter) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.Ha func (l *Limiter) limitByKey(w http.ResponseWriter, key string) bool { if _, ttl, err := l.cache.GetWithTTL(key); err == nil { - errMsg := fmt.Sprintf("You have exceeded the rate limit. Please wait %s before you try again", ttl.Round(time.Second)) + errMsg := fmt.Sprintf("You have exceeded the rate limit. Please wait %d days before you try again", int(ttl.Round(time.Hour).Hours()/24)) renderJSON(w, claimResponse{Message: errMsg}, http.StatusTooManyRequests) return true } From 68b2f34e9d09a93c292db0b39980deb9ae89dcaf Mon Sep 17 00:00:00 2001 From: nagdahimanshu Date: Tue, 25 Jun 2024 14:27:58 +0200 Subject: [PATCH 2/2] :ok_hand: Applied suggestions --- internal/chain/transaction.go | 2 +- internal/server/middleware.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/chain/transaction.go b/internal/chain/transaction.go index 567be7d6..605b5d7c 100644 --- a/internal/chain/transaction.go +++ b/internal/chain/transaction.go @@ -20,7 +20,7 @@ import ( var ( gasLimitInitializedAccount uint64 = 35000 - gasLimitNonInitializedAccount uint64 = 55000 + gasLimitNonInitializedAccount uint64 = 52000 ) type TxBuilder interface { diff --git a/internal/server/middleware.go b/internal/server/middleware.go index 15f4bb52..da6a7699 100644 --- a/internal/server/middleware.go +++ b/internal/server/middleware.go @@ -73,7 +73,7 @@ func (l *Limiter) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.Ha func (l *Limiter) limitByKey(w http.ResponseWriter, key string) bool { if _, ttl, err := l.cache.GetWithTTL(key); err == nil { - errMsg := fmt.Sprintf("You have exceeded the rate limit. Please wait %d days before you try again", int(ttl.Round(time.Hour).Hours()/24)) + errMsg := fmt.Sprintf("You have exceeded the rate limit. Please wait for %d day(s) before you try again.", int(ttl.Round(time.Hour).Hours()/24)) renderJSON(w, claimResponse{Message: errMsg}, http.StatusTooManyRequests) return true }