aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/metamask-controller.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-10-06 05:39:35 +0800
committerDan Finlay <dan@danfinlay.com>2017-10-06 05:39:35 +0800
commit9bc80d998eda937e3a8f95fa5e04fcba66e8a6f8 (patch)
tree1a58cfbed24644de8562bf25c640b93a65a130d4 /app/scripts/metamask-controller.js
parent176d03b2e8061c50108b2024f7716885097e82fd (diff)
downloadtangerine-wallet-browser-9bc80d998eda937e3a8f95fa5e04fcba66e8a6f8.tar
tangerine-wallet-browser-9bc80d998eda937e3a8f95fa5e04fcba66e8a6f8.tar.gz
tangerine-wallet-browser-9bc80d998eda937e3a8f95fa5e04fcba66e8a6f8.tar.bz2
tangerine-wallet-browser-9bc80d998eda937e3a8f95fa5e04fcba66e8a6f8.tar.lz
tangerine-wallet-browser-9bc80d998eda937e3a8f95fa5e04fcba66e8a6f8.tar.xz
tangerine-wallet-browser-9bc80d998eda937e3a8f95fa5e04fcba66e8a6f8.tar.zst
tangerine-wallet-browser-9bc80d998eda937e3a8f95fa5e04fcba66e8a6f8.zip
Add signTypedData input validations
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r--app/scripts/metamask-controller.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 8f773a72b..727f48f1c 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -566,11 +566,16 @@ module.exports = class MetamaskController extends EventEmitter {
}
newUnsignedTypedMessage (msgParams, cb) {
- const msgId = this.typedMessageManager.addUnapprovedMessage(msgParams)
- this.sendUpdate()
- this.opts.showUnconfirmedMessage()
+ let msgId
+ try {
+ msgId = this.typedMessageManager.addUnapprovedMessage(msgParams)
+ this.sendUpdate()
+ this.opts.showUnconfirmedMessage()
+ } catch (e) {
+ return cb(e)
+ }
+
this.typedMessageManager.once(`${msgId}:finished`, (data) => {
- console.log(data)
switch (data.status) {
case 'signed':
return cb(null, data.rawSig)