aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-05-17 01:27:41 +0800
committerDan Finlay <dan@danfinlay.com>2017-05-17 01:35:28 +0800
commit2df9344be5bf1c65daae2ca7ea47982fe2a1c2fb (patch)
tree4295596142072d170d078d9e982c694f8ff1e211 /app
parentd165f3a2b6f55cd1f4d4809c61ab3a4af5f8b070 (diff)
downloadtangerine-wallet-browser-2df9344be5bf1c65daae2ca7ea47982fe2a1c2fb.tar
tangerine-wallet-browser-2df9344be5bf1c65daae2ca7ea47982fe2a1c2fb.tar.gz
tangerine-wallet-browser-2df9344be5bf1c65daae2ca7ea47982fe2a1c2fb.tar.bz2
tangerine-wallet-browser-2df9344be5bf1c65daae2ca7ea47982fe2a1c2fb.tar.lz
tangerine-wallet-browser-2df9344be5bf1c65daae2ca7ea47982fe2a1c2fb.tar.xz
tangerine-wallet-browser-2df9344be5bf1c65daae2ca7ea47982fe2a1c2fb.tar.zst
tangerine-wallet-browser-2df9344be5bf1c65daae2ca7ea47982fe2a1c2fb.zip
Rename tx manager to tx controller
Diffstat (limited to 'app')
-rw-r--r--app/scripts/background.js4
-rw-r--r--app/scripts/controllers/transactions.js (renamed from app/scripts/transaction-manager.js)0
-rw-r--r--app/scripts/metamask-controller.js32
3 files changed, 18 insertions, 18 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index e738a9712..63c8a7252 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -114,13 +114,13 @@ function setupController (initState) {
//
updateBadge()
- controller.txManager.on('updateBadge', updateBadge)
+ controller.txController.on('updateBadge', updateBadge)
controller.messageManager.on('updateBadge', updateBadge)
// plugin badge text
function updateBadge () {
var label = ''
- var unapprovedTxCount = controller.txManager.unapprovedTxCount
+ var unapprovedTxCount = controller.txController.unapprovedTxCount
var unapprovedMsgCount = controller.messageManager.unapprovedMsgCount
var count = unapprovedTxCount + unapprovedMsgCount
if (count) {
diff --git a/app/scripts/transaction-manager.js b/app/scripts/controllers/transactions.js
index 9f267160f..9f267160f 100644
--- a/app/scripts/transaction-manager.js
+++ b/app/scripts/controllers/transactions.js
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 175602ec1..f18da9033 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -17,7 +17,7 @@ const ShapeShiftController = require('./controllers/shapeshift')
const AddressBookController = require('./controllers/address-book')
const MessageManager = require('./lib/message-manager')
const PersonalMessageManager = require('./lib/personal-message-manager')
-const TxManager = require('./transaction-manager')
+const TransactionController = require('./controllers/transactions')
const ConfigManager = require('./lib/config-manager')
const autoFaucet = require('./lib/auto-faucet')
const nodeify = require('./lib/nodeify')
@@ -90,8 +90,8 @@ module.exports = class MetamaskController extends EventEmitter {
}, this.keyringController)
// tx mgmt
- this.txManager = new TxManager({
- initState: initState.TransactionManager,
+ this.txController = new TransactionController({
+ initState: initState.TransactionController || initState.TransactionManager,
networkStore: this.networkStore,
preferencesStore: this.preferencesController.store,
txHistoryLimit: 40,
@@ -119,8 +119,8 @@ module.exports = class MetamaskController extends EventEmitter {
this.publicConfigStore = this.initPublicConfigStore()
// manual disk state subscriptions
- this.txManager.store.subscribe((state) => {
- this.store.updateState({ TransactionManager: state })
+ this.txController.store.subscribe((state) => {
+ this.store.updateState({ TransactionController: state })
})
this.keyringController.store.subscribe((state) => {
this.store.updateState({ KeyringController: state })
@@ -144,7 +144,7 @@ module.exports = class MetamaskController extends EventEmitter {
// manual mem state subscriptions
this.networkStore.subscribe(this.sendUpdate.bind(this))
this.ethStore.subscribe(this.sendUpdate.bind(this))
- this.txManager.memStore.subscribe(this.sendUpdate.bind(this))
+ this.txController.memStore.subscribe(this.sendUpdate.bind(this))
this.messageManager.memStore.subscribe(this.sendUpdate.bind(this))
this.personalMessageManager.memStore.subscribe(this.sendUpdate.bind(this))
this.keyringController.memStore.subscribe(this.sendUpdate.bind(this))
@@ -223,7 +223,7 @@ module.exports = class MetamaskController extends EventEmitter {
},
this.networkStore.getState(),
this.ethStore.getState(),
- this.txManager.memStore.getState(),
+ this.txController.memStore.getState(),
this.messageManager.memStore.getState(),
this.personalMessageManager.memStore.getState(),
this.keyringController.memStore.getState(),
@@ -248,7 +248,7 @@ module.exports = class MetamaskController extends EventEmitter {
getApi () {
const keyringController = this.keyringController
const preferencesController = this.preferencesController
- const txManager = this.txManager
+ const txController = this.txController
const noticeController = this.noticeController
const addressBookController = this.addressBookController
@@ -289,9 +289,9 @@ module.exports = class MetamaskController extends EventEmitter {
saveAccountLabel: nodeify(keyringController.saveAccountLabel).bind(keyringController),
exportAccount: nodeify(keyringController.exportAccount).bind(keyringController),
- // txManager
- approveTransaction: txManager.approveTransaction.bind(txManager),
- cancelTransaction: txManager.cancelTransaction.bind(txManager),
+ // txController
+ approveTransaction: txController.approveTransaction.bind(txController),
+ cancelTransaction: txController.cancelTransaction.bind(txController),
updateAndApproveTransaction: this.updateAndApproveTx.bind(this),
// messageManager
@@ -421,12 +421,12 @@ module.exports = class MetamaskController extends EventEmitter {
newUnapprovedTransaction (txParams, cb) {
log.debug(`MetaMaskController newUnapprovedTransaction ${JSON.stringify(txParams)}`)
const self = this
- self.txManager.addUnapprovedTransaction(txParams, (err, txMeta) => {
+ self.txController.addUnapprovedTransaction(txParams, (err, txMeta) => {
if (err) return cb(err)
self.sendUpdate()
self.opts.showUnapprovedTx(txMeta)
// listen for tx completion (success, fail)
- self.txManager.once(`${txMeta.id}:finished`, (completedTx) => {
+ self.txController.once(`${txMeta.id}:finished`, (completedTx) => {
switch (completedTx.status) {
case 'submitted':
return cb(null, completedTx.hash)
@@ -477,9 +477,9 @@ module.exports = class MetamaskController extends EventEmitter {
updateAndApproveTx (txMeta, cb) {
log.debug(`MetaMaskController - updateAndApproveTx: ${JSON.stringify(txMeta)}`)
- const txManager = this.txManager
- txManager.updateTx(txMeta)
- txManager.approveTransaction(txMeta.id, cb)
+ const txController = this.txController
+ txController.updateTx(txMeta)
+ txController.approveTransaction(txMeta.id, cb)
}
signMessage (msgParams, cb) {