Skip to content

Commit

Permalink
Merge pull request #1 from archway-network/fix-faucet-limits-implemen…
Browse files Browse the repository at this point in the history
…tation

fix(faucet): Faucet should not transfer funds after throwing quota errors
  • Loading branch information
shahbazn authored Dec 9, 2022
2 parents 58481da + 17c3c69 commit 99683b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/faucet/cosmosfaucet.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (f Faucet) ValidateRequest(req TransferRequest) error {
for _, coin := range req.Coins {
if _, ok := f.MaxCoinsPerAccount[coin.Denom]; ok {
if coin.Amount.GT(f.MaxCoinsPerRequest[coin.Denom]) {
return fmt.Errorf("%s is greater than max allowed per request of %s%s", coin.String(), f.MaxCoinsPerRequest[coin.Denom].String(), coin.Amount.String())
return fmt.Errorf("%s is greater than max allowed per request of %s%s", coin.String(), coin.Denom, f.MaxCoinsPerRequest[coin.Denom].String())
}
} else {
return fmt.Errorf("Faucet not allowed to distribute %s", coin.Denom)
Expand Down
1 change: 1 addition & 0 deletions pkg/faucet/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func (f Faucet) faucetHandler(w http.ResponseWriter, r *http.Request) {
return
}
responseError(w, http.StatusInternalServerError, err)
return
}

// try performing the transfer
Expand Down

0 comments on commit 99683b5

Please sign in to comment.