From 0863195786022ff85a15e5deb3a45a321ad09857 Mon Sep 17 00:00:00 2001 From: Mikhail Mikheev Date: Tue, 19 Nov 2019 17:05:31 +0400 Subject: [PATCH] Revert "send tx to service only after it was mined" This reverts commit eb0584feeff629fc41934d887db63efaf42580cb. --- src/routes/safe/store/actions/createTransaction.js | 12 ++++++------ .../safe/store/actions/processTransaction.js | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/routes/safe/store/actions/createTransaction.js b/src/routes/safe/store/actions/createTransaction.js index a212ec36..2b85ee40 100644 --- a/src/routes/safe/store/actions/createTransaction.js +++ b/src/routes/safe/store/actions/createTransaction.js @@ -72,12 +72,6 @@ const createTransaction = ( closeSnackbar(beforeExecutionKey) pendingExecutionKey = showSnackbar(notificationsQueue.pendingExecution, enqueueSnackbar, closeSnackbar) - }) - .on('error', (error) => { - console.error('Tx error: ', error) - }) - .then(async (receipt) => { - closeSnackbar(pendingExecutionKey) try { await saveTxToHistory( @@ -94,6 +88,12 @@ const createTransaction = ( } catch (err) { console.error(err) } + }) + .on('error', (error) => { + console.error('Tx error: ', error) + }) + .then((receipt) => { + closeSnackbar(pendingExecutionKey) showSnackbar( isExecution diff --git a/src/routes/safe/store/actions/processTransaction.js b/src/routes/safe/store/actions/processTransaction.js index 98daa286..1df89980 100644 --- a/src/routes/safe/store/actions/processTransaction.js +++ b/src/routes/safe/store/actions/processTransaction.js @@ -103,17 +103,11 @@ const processTransaction = ( await transaction .send(sendParams) - .once('transactionHash', (hash) => { + .once('transactionHash', async (hash) => { txHash = hash closeSnackbar(beforeExecutionKey) pendingExecutionKey = showSnackbar(notificationsQueue.pendingExecution, enqueueSnackbar, closeSnackbar) - }) - .on('error', (error) => { - console.error('Processing transaction error: ', error) - }) - .then(async (receipt) => { - closeSnackbar(pendingExecutionKey) try { await saveTxToHistory( @@ -130,6 +124,12 @@ const processTransaction = ( } catch (err) { console.error(err) } + }) + .on('error', (error) => { + console.error('Processing transaction error: ', error) + }) + .then((receipt) => { + closeSnackbar(pendingExecutionKey) showSnackbar( shouldExecute