From 079a583041da44c02a1fccf84250b38d4a139b32 Mon Sep 17 00:00:00 2001 From: "Miquel A. Cabot" Date: Thu, 12 May 2022 19:02:44 +0200 Subject: [PATCH] console.log estimateGas() result --- src/utils/ContractUtils.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/utils/ContractUtils.ts b/src/utils/ContractUtils.ts index 17066603..84fb29f5 100644 --- a/src/utils/ContractUtils.ts +++ b/src/utils/ContractUtils.ts @@ -183,7 +183,15 @@ export async function estimateGas( { from: from }, - (err, estGas) => (err ? GASLIMIT_DEFAULT : estGas) + (err, estGas) => { + if (err) { + console.log('ERROR ESTIMATING GAS: ' + err) + return GASLIMIT_DEFAULT + } else { + console.log('OK ESTIMATING GAS: ' + estGas) + return estGas + } + } ) } catch (e) { LoggerInstance.error(`ERROR: Estimate gas failed!`, e)