diff options
author | Frankie <frankie.diamond@gmail.com> | 2017-07-26 06:26:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-26 06:26:41 +0800 |
commit | a929fb2387de87619192ea0a86fe1ead4f7a0361 (patch) | |
tree | 21ced267219f692dc00234f814059e7dc68afbda /app/scripts | |
parent | b81f8831505b1ebb1d58a474d52b068d42879d56 (diff) | |
parent | 0c73d6d852ac9c98613f71d6ee87f9d89c3c2b47 (diff) | |
download | tangerine-wallet-browser-a929fb2387de87619192ea0a86fe1ead4f7a0361.tar tangerine-wallet-browser-a929fb2387de87619192ea0a86fe1ead4f7a0361.tar.gz tangerine-wallet-browser-a929fb2387de87619192ea0a86fe1ead4f7a0361.tar.bz2 tangerine-wallet-browser-a929fb2387de87619192ea0a86fe1ead4f7a0361.tar.lz tangerine-wallet-browser-a929fb2387de87619192ea0a86fe1ead4f7a0361.tar.xz tangerine-wallet-browser-a929fb2387de87619192ea0a86fe1ead4f7a0361.tar.zst tangerine-wallet-browser-a929fb2387de87619192ea0a86fe1ead4f7a0361.zip |
Merge branch 'master' into betterErrorsOnTx
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/controllers/network.js | 5 | ||||
-rw-r--r-- | app/scripts/controllers/transactions.js | 10 |
2 files changed, 8 insertions, 7 deletions
diff --git a/app/scripts/controllers/network.js b/app/scripts/controllers/network.js index c07f13b8d..0a3e5e26b 100644 --- a/app/scripts/controllers/network.js +++ b/app/scripts/controllers/network.js @@ -28,9 +28,9 @@ module.exports = class NetworkController extends EventEmitter { this._provider = provider } - initializeProvider (opts) { + initializeProvider (opts, providerContructor = MetaMaskProvider) { this.providerInit = opts - this._provider = MetaMaskProvider(opts) + this._provider = providerContructor(opts) this._proxy = new Proxy(this._provider, { get: (obj, name) => { if (name === 'on') return this._on.bind(this) @@ -38,6 +38,7 @@ module.exports = class NetworkController extends EventEmitter { }, set: (obj, name, value) => { this._provider[name] = value + return value }, }) this.provider.on('block', this._logBlock.bind(this)) diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js index 5485dc723..7b2e4e314 100644 --- a/app/scripts/controllers/transactions.js +++ b/app/scripts/controllers/transactions.js @@ -469,7 +469,7 @@ module.exports = class TransactionController extends EventEmitter { })) } - async _resubmitTx (txMeta, cb) { + async _resubmitTx (txMeta) { const address = txMeta.txParams.from const balance = this.ethStore.getState().accounts[address].balance if (!('retryCount' in txMeta)) txMeta.retryCount = 0 @@ -481,17 +481,17 @@ module.exports = class TransactionController extends EventEmitter { stack: '_resubnitTx: custom tx-controller error', message, }) - cb() - return log.error(message) + log.error(message) + return } // Only auto-submit already-signed txs: - if (!('rawTx' in txMeta)) return cb() + if (!('rawTx' in txMeta)) return // Increment a try counter. txMeta.retryCount++ const rawTx = txMeta.rawTx - return await this.txProviderUtils.publishTransaction(rawTx, cb) + return await this.txProviderUtils.publishTransaction(rawTx) } // checks the network for signed txs and |