aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-05-25 07:05:07 +0800
committerkumavis <aaron@kumavis.me>2018-05-25 07:05:07 +0800
commit76cfb10864364d53efcdfa5f646f9947c83b6fb2 (patch)
tree2d9c9d3b229d61224b53e1eb2f56157bc67d412f /app/scripts
parent2b54d948da80e5ef90b81f140b72df8a3547d0d1 (diff)
downloadtangerine-wallet-browser-76cfb10864364d53efcdfa5f646f9947c83b6fb2.tar
tangerine-wallet-browser-76cfb10864364d53efcdfa5f646f9947c83b6fb2.tar.gz
tangerine-wallet-browser-76cfb10864364d53efcdfa5f646f9947c83b6fb2.tar.bz2
tangerine-wallet-browser-76cfb10864364d53efcdfa5f646f9947c83b6fb2.tar.lz
tangerine-wallet-browser-76cfb10864364d53efcdfa5f646f9947c83b6fb2.tar.xz
tangerine-wallet-browser-76cfb10864364d53efcdfa5f646f9947c83b6fb2.tar.zst
tangerine-wallet-browser-76cfb10864364d53efcdfa5f646f9947c83b6fb2.zip
metamask-controller - wrap txController.addUnapprovedTx for wallet middleware reference before txController is instantiated
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/metamask-controller.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 8c3c70c5c..796c9385a 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -247,7 +247,7 @@ module.exports = class MetamaskController extends EventEmitter {
}
},
// tx signing
- processTransaction: this.txController.newUnapprovedTransaction.bind(this.txController),
+ processTransaction: this.newUnapprovedTransaction.bind(this),
// msg signing
processEthSignMessage: this.newUnsignedMessage.bind(this),
processPersonalMessage: this.newUnsignedPersonalMessage.bind(this),
@@ -617,6 +617,18 @@ module.exports = class MetamaskController extends EventEmitter {
// ---------------------------------------------------------------------------
// Identity Management (signature operations)
+ /**
+ * Called when a Dapp suggests a new tx to be signed.
+ * this wrapper needs to exist so we can provide a reference to
+ * "newUnapprovedTransaction" before "txController" is instantiated
+ *
+ * @param {Object} msgParams - The params passed to eth_sign.
+ * @param {Object} req - (optional) the original request, containing the origin
+ */
+ async newUnapprovedTransaction(txParams, req) {
+ return await this.txController.newUnapprovedTransaction(txParams, req)
+ }
+
// eth_sign methods:
/**