From 4c1b6cb2b87cbdc44b35209822540a4f31341b29 Mon Sep 17 00:00:00 2001 From: rajranjan0608 Date: Wed, 25 May 2022 15:38:36 +0530 Subject: [PATCH 1/2] minimizing captcha score and failed tx handling --- middlewares/verifyCaptcha.ts | 3 ++- vms/evm.ts | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/middlewares/verifyCaptcha.ts b/middlewares/verifyCaptcha.ts index d5816d4..74b972e 100644 --- a/middlewares/verifyCaptcha.ts +++ b/middlewares/verifyCaptcha.ts @@ -17,7 +17,8 @@ export class VerifyCaptcha { const data = response?.data; if(data?.success) { - if(data?.score > 0.6) { + console.log("score:", data?.score) + if(data?.score >= 0.3) { return true; } } diff --git a/vms/evm.ts b/vms/evm.ts index 0f11023..9cd887e 100644 --- a/vms/evm.ts +++ b/vms/evm.ts @@ -156,7 +156,14 @@ export default class EVM { this.pendingTxNonces.delete(nonce); } catch (err: any) { console.log(err.message); - console.log(`Error with nonce ${nonce} while sending signed transaction.`); + console.log(`Error with nonce ${nonce} while sending signed transaction on ${this.NAME}.`); + if(err.message.includes("nonce too low")) { + console.log(`Nonce too low: Dropping transaction with nonce ${nonce} on ${this.NAME}`) + this.pendingTxNonces.delete(nonce); + } else { + console.log("Re-sending tx to faucet address"); + this.sendTokenUtil(0, this.account.address, nonce) + } } } From ed42d466f24b870dd534e51fd7afe788c6a39cfb Mon Sep 17 00:00:00 2001 From: rajranjan0608 Date: Wed, 25 May 2022 15:42:26 +0530 Subject: [PATCH 2/2] typo --- middlewares/verifyCaptcha.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/middlewares/verifyCaptcha.ts b/middlewares/verifyCaptcha.ts index 74b972e..44b71d4 100644 --- a/middlewares/verifyCaptcha.ts +++ b/middlewares/verifyCaptcha.ts @@ -17,7 +17,6 @@ export class VerifyCaptcha { const data = response?.data; if(data?.success) { - console.log("score:", data?.score) if(data?.score >= 0.3) { return true; }