Skip to content

Commit

Permalink
Update wait time parsing (#11)
Browse files Browse the repository at this point in the history
* Update parsing

* 👌 Applied suggestions
  • Loading branch information
nagdahimanshu authored Jun 25, 2024
1 parent 122de64 commit dbd646a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/chain/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

var (
gasLimitInitializedAccount uint64 = 35000
gasLimitNonInitializedAccount uint64 = 55000
gasLimitNonInitializedAccount uint64 = 52000
)

type TxBuilder interface {
Expand Down
2 changes: 1 addition & 1 deletion internal/server/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit dbd646a

Please sign in to comment.