From ece1362de8b3187022e1435c44924fe2403b4134 Mon Sep 17 00:00:00 2001 From: sophian Date: Wed, 30 Aug 2023 16:10:25 -0400 Subject: [PATCH] More accurate error handling --- faucet-api/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/faucet-api/src/index.ts b/faucet-api/src/index.ts index 611437b824..1f5ecfc9db 100644 --- a/faucet-api/src/index.ts +++ b/faucet-api/src/index.ts @@ -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)