Skip to content

Commit

Permalink
Update txRunner.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjl10 authored and Aniket-Engg committed Jan 20, 2025
1 parent 05832f5 commit e61ed52
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libs/remix-lib/src/execution/txRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type Transaction = {
export class TxRunner {
event
pendingTxs
queusTxs
queueTxs
opt
internalRunner
constructor (internalRunner, opt) {
Expand All @@ -25,7 +25,7 @@ export class TxRunner {
this.event = new EventManager()

this.pendingTxs = {}
this.queusTxs = []
this.queueTxs = []
}

rawRun (args: Transaction, confirmationCb, gasEstimationForceSend, promptCb, cb) {
Expand All @@ -42,14 +42,14 @@ export class TxRunner {

function run (self, tx: Transaction, stamp, confirmationCb, gasEstimationForceSend = null, promptCb = null, callback = null) {
if (Object.keys(self.pendingTxs).length) {
return self.queusTxs.push({ tx, stamp, confirmationCb, gasEstimationForceSend, promptCb, callback })
return self.queueTxs.push({ tx, stamp, confirmationCb, gasEstimationForceSend, promptCb, callback })
}
self.pendingTxs[stamp] = tx
self.execute(tx, confirmationCb, gasEstimationForceSend, promptCb, function (error, result) {
delete self.pendingTxs[stamp]
if (callback && typeof callback === 'function') callback(error, result)
if (self.queusTxs.length) {
const next = self.queusTxs.pop()
if (self.queueTxs.length) {
const next = self.queueTxs.pop()
run(self, next.tx, next.stamp, next.confirmationCb, next.gasEstimationForceSend, next.promptCb, next.callback)
}
})
Expand Down

0 comments on commit e61ed52

Please sign in to comment.