|
|
|
@ -45,6 +45,7 @@ const BN = require('ethereumjs-util').BN |
|
|
|
|
const GWEI_BN = new BN('1000000000') |
|
|
|
|
const percentile = require('percentile') |
|
|
|
|
const seedPhraseVerifier = require('./lib/seed-phrase-verifier') |
|
|
|
|
const cleanErrorStack = require('./lib/cleanErrorStack') |
|
|
|
|
const log = require('loglevel') |
|
|
|
|
|
|
|
|
|
module.exports = class MetamaskController extends EventEmitter { |
|
|
|
@ -637,9 +638,9 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
|
case 'signed': |
|
|
|
|
return cb(null, data.rawSig) |
|
|
|
|
case 'rejected': |
|
|
|
|
return cb(new Error('MetaMask Message Signature: User denied message signature.')) |
|
|
|
|
return cb(cleanErrorStack(new Error('MetaMask Message Signature: User denied message signature.'))) |
|
|
|
|
default: |
|
|
|
|
return cb(new Error(`MetaMask Message Signature: Unknown problem: ${JSON.stringify(msgParams)}`)) |
|
|
|
|
return cb(cleanErrorStack(new Error(`MetaMask Message Signature: Unknown problem: ${JSON.stringify(msgParams)}`))) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
@ -697,7 +698,7 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
|
*/ |
|
|
|
|
newUnsignedPersonalMessage (msgParams, cb) { |
|
|
|
|
if (!msgParams.from) { |
|
|
|
|
return cb(new Error('MetaMask Message Signature: from field is required.')) |
|
|
|
|
return cb(cleanErrorStack(new Error('MetaMask Message Signature: from field is required.'))) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const msgId = this.personalMessageManager.addUnapprovedMessage(msgParams) |
|
|
|
@ -708,9 +709,9 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
|
case 'signed': |
|
|
|
|
return cb(null, data.rawSig) |
|
|
|
|
case 'rejected': |
|
|
|
|
return cb(new Error('MetaMask Message Signature: User denied message signature.')) |
|
|
|
|
return cb(cleanErrorStack(new Error('MetaMask Message Signature: User denied message signature.'))) |
|
|
|
|
default: |
|
|
|
|
return cb(new Error(`MetaMask Message Signature: Unknown problem: ${JSON.stringify(msgParams)}`)) |
|
|
|
|
return cb(cleanErrorStack(new Error(`MetaMask Message Signature: Unknown problem: ${JSON.stringify(msgParams)}`))) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
@ -776,9 +777,9 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
|
case 'signed': |
|
|
|
|
return cb(null, data.rawSig) |
|
|
|
|
case 'rejected': |
|
|
|
|
return cb(new Error('MetaMask Message Signature: User denied message signature.')) |
|
|
|
|
return cb(cleanErrorStack(new Error('MetaMask Message Signature: User denied message signature.'))) |
|
|
|
|
default: |
|
|
|
|
return cb(new Error(`MetaMask Message Signature: Unknown problem: ${JSON.stringify(msgParams)}`)) |
|
|
|
|
return cb(cleanErrorStack(new Error(`MetaMask Message Signature: Unknown problem: ${JSON.stringify(msgParams)}`))) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|