Revert "send tx to service only after it was mined"

This reverts commit eb0584feef.
This commit is contained in:
Mikhail Mikheev 2019-11-19 17:05:31 +04:00
parent fd661c57af
commit 0863195786
2 changed files with 13 additions and 13 deletions

View File

@ -72,12 +72,6 @@ const createTransaction = (
closeSnackbar(beforeExecutionKey) closeSnackbar(beforeExecutionKey)
pendingExecutionKey = showSnackbar(notificationsQueue.pendingExecution, enqueueSnackbar, closeSnackbar) pendingExecutionKey = showSnackbar(notificationsQueue.pendingExecution, enqueueSnackbar, closeSnackbar)
})
.on('error', (error) => {
console.error('Tx error: ', error)
})
.then(async (receipt) => {
closeSnackbar(pendingExecutionKey)
try { try {
await saveTxToHistory( await saveTxToHistory(
@ -94,6 +88,12 @@ const createTransaction = (
} catch (err) { } catch (err) {
console.error(err) console.error(err)
} }
})
.on('error', (error) => {
console.error('Tx error: ', error)
})
.then((receipt) => {
closeSnackbar(pendingExecutionKey)
showSnackbar( showSnackbar(
isExecution isExecution

View File

@ -103,17 +103,11 @@ const processTransaction = (
await transaction await transaction
.send(sendParams) .send(sendParams)
.once('transactionHash', (hash) => { .once('transactionHash', async (hash) => {
txHash = hash txHash = hash
closeSnackbar(beforeExecutionKey) closeSnackbar(beforeExecutionKey)
pendingExecutionKey = showSnackbar(notificationsQueue.pendingExecution, enqueueSnackbar, closeSnackbar) pendingExecutionKey = showSnackbar(notificationsQueue.pendingExecution, enqueueSnackbar, closeSnackbar)
})
.on('error', (error) => {
console.error('Processing transaction error: ', error)
})
.then(async (receipt) => {
closeSnackbar(pendingExecutionKey)
try { try {
await saveTxToHistory( await saveTxToHistory(
@ -130,6 +124,12 @@ const processTransaction = (
} catch (err) { } catch (err) {
console.error(err) console.error(err)
} }
})
.on('error', (error) => {
console.error('Processing transaction error: ', error)
})
.then((receipt) => {
closeSnackbar(pendingExecutionKey)
showSnackbar( showSnackbar(
shouldExecute shouldExecute