From 3383afee0d05abcb0b782745a5ecc726486bb5f5 Mon Sep 17 00:00:00 2001 From: mmv Date: Thu, 11 Jul 2019 16:30:16 +0400 Subject: [PATCH] remove console.log and move getting errmsg to catch block in executeTransaction --- src/logic/safe/transactions/send.js | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/logic/safe/transactions/send.js b/src/logic/safe/transactions/send.js index 27f12bc6..c44c7108 100644 --- a/src/logic/safe/transactions/send.js +++ b/src/logic/safe/transactions/send.js @@ -64,15 +64,6 @@ export const executeTransaction = async ( sender: string, signatures?: string, ) => { - console.log({ - to, - valueInWei, - data, - operation, - nonce, - sender, - signatures, - }) try { let sigs = signatures @@ -84,13 +75,6 @@ export const executeTransaction = async ( )}000000000000000000000000000000000000000000000000000000000000000001` } - // debug - const executeDataUsedSignatures = safeInstance.contract.methods - .execTransaction(to, valueInWei, data, operation, 0, 0, 0, ZERO_ADDRESS, ZERO_ADDRESS, sigs) - .encodeABI() - console.log(await getErrorMessage(safeInstance.address, 0, executeDataUsedSignatures, sender)) - // debug end - const receipt = await safeInstance.execTransaction( to, valueInWei, @@ -119,8 +103,15 @@ export const executeTransaction = async ( return receipt } catch (error) { - // eslint-disable-next-line - console.log('Error executing the TX: ' + error) + /* eslint-disable */ + const executeDataUsedSignatures = safeInstance.contract.methods + .execTransaction(to, valueInWei, data, operation, 0, 0, 0, ZERO_ADDRESS, ZERO_ADDRESS, sigs) + .encodeABI() + const errMsg = await getErrorMessage(safeInstance.address, 0, executeDataUsedSignatures, sender) + + console.log(`Error executing the TX: ${error}`) + console.log(`Error executing the TX: ${errMsg}`) + /* eslint-enable */ return 0 } }