mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
fix spelling
This commit is contained in:
parent
08f49ab35f
commit
fb9866b4e1
@ -4,7 +4,7 @@ const clone = require('clone')
|
||||
const ObservableStore = require('obs-store')
|
||||
const ethUtil = require('ethereumjs-util')
|
||||
const EthQuery = require('ethjs-query')
|
||||
const TxProviderUtil = require('../lib/tx-utils')
|
||||
const TxProviderUtils = require('../lib/tx-utils')
|
||||
const PendingTransactionWatchers = require('../lib/pending-tx-watchers')
|
||||
const createId = require('../lib/random-id')
|
||||
const NonceTracker = require('../lib/nonce-tracker')
|
||||
@ -35,9 +35,9 @@ module.exports = class TransactionController extends EventEmitter {
|
||||
},
|
||||
})
|
||||
this.query = new EthQuery(this.provider)
|
||||
this.txProviderUtils = new TxProviderUtil(this.provider)
|
||||
this.txProviderUtils = new TxProviderUtils(this.provider)
|
||||
|
||||
this.pendingTxWatcher = new PendingTransactionWatchers({
|
||||
this.pendingTxWatchers = new PendingTransactionWatchers({
|
||||
provider: this.provider,
|
||||
nonceTracker: this.nonceTracker,
|
||||
getBalance: (address) => this.ethStore.getState().accounts[address].balance,
|
||||
@ -50,16 +50,16 @@ module.exports = class TransactionController extends EventEmitter {
|
||||
},
|
||||
})
|
||||
|
||||
this.pendingTxWatcher.on('txWarning', this.updateTx.bind(this))
|
||||
this.pendingTxWatcher.on('txFailed', this.setTxStatusFailed.bind(this))
|
||||
this.pendingTxWatcher.on('txConfirmed', this.setTxStatusConfirmed.bind(this))
|
||||
this.pendingTxWatchers.on('txWarning', this.updateTx.bind(this))
|
||||
this.pendingTxWatchers.on('txFailed', this.setTxStatusFailed.bind(this))
|
||||
this.pendingTxWatchers.on('txConfirmed', this.setTxStatusConfirmed.bind(this))
|
||||
|
||||
this.blockTracker.on('rawBlock', this.pendingTxWatcher.checkForTxInBlock.bind(this))
|
||||
this.blockTracker.on('rawBlock', this.pendingTxWatchers.checkForTxInBlock.bind(this))
|
||||
// this is a little messy but until ethstore has been either
|
||||
// removed or redone this is to guard against the race condition
|
||||
// where ethStore hasent been populated by the results yet
|
||||
this.blockTracker.once('latest', () => this.blockTracker.on('latest', this.pendingTxWatcher.resubmitPendingTxs.bind(this)))
|
||||
this.blockTracker.on('sync', this.pendingTxWatcher.queryPendingTxs.bind(this))
|
||||
this.blockTracker.once('latest', () => this.blockTracker.on('latest', this.pendingTxWatchers.resubmitPendingTxs.bind(this)))
|
||||
this.blockTracker.on('sync', this.pendingTxWatchers.queryPendingTxs.bind(this))
|
||||
// memstore is computed from a few different stores
|
||||
this._updateMemstore()
|
||||
this.store.subscribe(() => this._updateMemstore())
|
||||
|
@ -19,7 +19,7 @@ const sufficientBalance = require('./util').sufficientBalance
|
||||
|
||||
*/
|
||||
|
||||
module.exports = class PendingTransactionWatcher extends EventEmitter {
|
||||
module.exports = class PendingTransactionWatchers extends EventEmitter {
|
||||
constructor (config) {
|
||||
super()
|
||||
this.query = new EthQuery(config.provider)
|
||||
@ -101,11 +101,8 @@ module.exports = class PendingTransactionWatcher extends EventEmitter {
|
||||
|
||||
// if the value of the transaction is greater then the balance, fail.
|
||||
if (!sufficientBalance(txMeta.txParams, balance)) {
|
||||
const message = 'Insufficient balance during rebroadcast.'
|
||||
txMeta.warning = {
|
||||
message,
|
||||
}
|
||||
this.emit('txWarning', txMeta)
|
||||
const insufficientFundsError = new Error('Insufficient balance during rebroadcast.')
|
||||
this.emit('txFailed', txMeta.id, insufficientFundsError)
|
||||
log.error(message)
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user