Skip to content

Commit

Permalink
More accurate error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sophialittlejohn committed Aug 30, 2023
1 parent 2ce744f commit ece1362
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions faucet-api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ async function faucet(req: Request, res: Response) {
return res.status(400).send('Wallet already has sufficient aUSD/DEVEL balances')
}

if (signerBalance.gte(CurrencyBalance.fromFloat(1, currency.decimals))) {
if (signerBalance.gte(CurrencyBalance.fromFloat(10000, currency.decimals))) {
api.disconnect()
return res.status(400).send(`Insufficient funds in signer ${currency.key}: ${signerBalance.toString()}`)
}

if (signerNativeBalance.gte(CurrencyBalance.fromFloat(1, currency.decimals))) {
if (signerNativeBalance.gte(CurrencyBalance.fromFloat(1000, 18))) {
api.disconnect()
return res
.status(400)
Expand Down

0 comments on commit ece1362

Please sign in to comment.