From dbd646a3f44ef76b550dc4143a8d9a9ef43d1ac9 Mon Sep 17 00:00:00 2001 From: Himanshu Nagda <69150921+nagdahimanshu@users.noreply.github.com> Date: Tue, 25 Jun 2024 15:08:58 +0200 Subject: [PATCH] Update wait time parsing (#11) * Update parsing * :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 414c9577..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 %s before you try again", ttl.Round(time.Second)) + 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 }