mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
newUnaprovedTx => newUnapprovedTx
This typo tripped me up when I was reading through the code and trying to understand what's going on.
This commit is contained in:
parent
7bfb08cf3b
commit
41fea44af3
@ -133,7 +133,7 @@ module.exports = class TransactionController extends EventEmitter {
|
||||
async newUnapprovedTransaction (txParams) {
|
||||
log.debug(`MetaMaskController newUnapprovedTransaction ${JSON.stringify(txParams)}`)
|
||||
const txMeta = await this.addUnapprovedTransaction(txParams)
|
||||
this.emit('newUnaprovedTx', txMeta)
|
||||
this.emit('newUnapprovedTx', txMeta)
|
||||
// listen for tx completion (success, fail)
|
||||
return new Promise((resolve, reject) => {
|
||||
this.txStateManager.once(`${txMeta.id}:finished`, (completedTx) => {
|
||||
|
@ -128,7 +128,7 @@ module.exports = class MetamaskController extends EventEmitter {
|
||||
blockTracker: this.blockTracker,
|
||||
ethQuery: this.ethQuery,
|
||||
})
|
||||
this.txController.on('newUnaprovedTx', opts.showUnapprovedTx.bind(opts))
|
||||
this.txController.on('newUnapprovedTx', opts.showUnapprovedTx.bind(opts))
|
||||
|
||||
// computed balances (accounting for pending transactions)
|
||||
this.balancesController = new BalancesController({
|
||||
|
@ -118,8 +118,8 @@ describe('Transaction Controller', function () {
|
||||
stub.restore()
|
||||
})
|
||||
|
||||
it('should emit newUnaprovedTx event and pass txMeta as the first argument', function (done) {
|
||||
txController.once('newUnaprovedTx', (txMetaFromEmit) => {
|
||||
it('should emit newUnapprovedTx event and pass txMeta as the first argument', function (done) {
|
||||
txController.once('newUnapprovedTx', (txMetaFromEmit) => {
|
||||
assert(txMetaFromEmit, 'txMeta is falsey')
|
||||
assert.equal(txMetaFromEmit.id, 1, 'the right txMeta was passed')
|
||||
done()
|
||||
@ -129,7 +129,7 @@ describe('Transaction Controller', function () {
|
||||
})
|
||||
|
||||
it('should resolve when finished and status is submitted and resolve with the hash', function (done) {
|
||||
txController.once('newUnaprovedTx', (txMetaFromEmit) => {
|
||||
txController.once('newUnapprovedTx', (txMetaFromEmit) => {
|
||||
setTimeout(() => {
|
||||
txController.setTxHash(txMetaFromEmit.id, '0x0')
|
||||
txController.txStateManager.setTxStatusSubmitted(txMetaFromEmit.id)
|
||||
@ -145,7 +145,7 @@ describe('Transaction Controller', function () {
|
||||
})
|
||||
|
||||
it('should reject when finished and status is rejected', function (done) {
|
||||
txController.once('newUnaprovedTx', (txMetaFromEmit) => {
|
||||
txController.once('newUnapprovedTx', (txMetaFromEmit) => {
|
||||
setTimeout(() => {
|
||||
txController.txStateManager.setTxStatusRejected(txMetaFromEmit.id)
|
||||
}, 10)
|
||||
|
Loading…
Reference in New Issue
Block a user