Merge pull request #3717 from ethereum/yann300-patch-51

fix async tx
pull/3742/head
yann300 2 years ago committed by GitHub
commit fa648d40d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      libs/remix-lib/src/execution/txRunner.ts

@ -42,7 +42,7 @@ export class TxRunner {
function run (self, tx: Transaction, stamp, confirmationCb, gasEstimationForceSend = null, promptCb = null, callback = null) { function run (self, tx: Transaction, stamp, confirmationCb, gasEstimationForceSend = null, promptCb = null, callback = null) {
if (Object.keys(self.pendingTxs).length) { if (Object.keys(self.pendingTxs).length) {
return self.queusTxs.push({ tx, stamp, callback }) return self.queusTxs.push({ tx, stamp, confirmationCb, gasEstimationForceSend, promptCb, callback })
} }
self.pendingTxs[stamp] = tx self.pendingTxs[stamp] = tx
self.execute(tx, confirmationCb, gasEstimationForceSend, promptCb, function (error, result) { self.execute(tx, confirmationCb, gasEstimationForceSend, promptCb, function (error, result) {
@ -50,7 +50,7 @@ function run (self, tx: Transaction, stamp, confirmationCb, gasEstimationForceSe
if (callback && typeof callback === 'function') callback(error, result) if (callback && typeof callback === 'function') callback(error, result)
if (self.queusTxs.length) { if (self.queusTxs.length) {
const next = self.queusTxs.pop() const next = self.queusTxs.pop()
run(self, next.tx, next.stamp, next.callback) run(self, next.tx, next.stamp, next.confirmationCb, next.gasEstimationForceSend, next.promptCb, next.callback)
} }
}) })
} }

Loading…
Cancel
Save