send tx to service only after it was mined
This commit is contained in:
parent
f25f9fb138
commit
eb0584feef
|
@ -72,6 +72,12 @@ 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(
|
||||||
|
@ -88,12 +94,6 @@ 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
|
||||||
|
|
|
@ -103,11 +103,17 @@ const processTransaction = (
|
||||||
|
|
||||||
await transaction
|
await transaction
|
||||||
.send(sendParams)
|
.send(sendParams)
|
||||||
.once('transactionHash', async (hash) => {
|
.once('transactionHash', (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(
|
||||||
|
@ -124,12 +130,6 @@ 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
|
||||||
|
|
Loading…
Reference in New Issue