From 345984608bdb19d6c00da30252315c82fdf0629b Mon Sep 17 00:00:00 2001 From: Nam Chu Hoai Date: Thu, 22 Sep 2022 15:39:17 -0400 Subject: [PATCH] Use estimateGas in msg debugger (#1109) --- typescript/infra/scripts/debug-message.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/typescript/infra/scripts/debug-message.ts b/typescript/infra/scripts/debug-message.ts index 103dbc6f4..96d2901a3 100644 --- a/typescript/infra/scripts/debug-message.ts +++ b/typescript/infra/scripts/debug-message.ts @@ -128,7 +128,7 @@ async function checkMessage( ); try { - await recipient.callStatic.handle( + await recipient.estimateGas.handle( message.parsed.origin, message.parsed.sender, message.parsed.body, @@ -138,10 +138,12 @@ async function checkMessage( 'Calling recipient `handle` function from the inbox does not revert', ); } catch (err: any) { - console.error( - `Error calling recipient \`handle\` function from the inbox`, - err, - ); + console.error(`Error calling recipient \`handle\` function from the inbox`); + if (err.reason) { + console.error('Reason: ', err.reason); + } else { + console.error(err); + } } }