aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorbitpshr <mail@bitpshr.net>2018-09-26 22:00:12 +0800
committerbitpshr <mail@bitpshr.net>2018-09-26 22:00:12 +0800
commitc4caba131776ff7397d3a4071d7cc84907ac9a43 (patch)
tree64fd5a7bce96948038514005335c80faec046d3e /app/scripts
parent54de60ff84573f09235dce829b747a8cc4bc18c0 (diff)
downloadtangerine-wallet-browser-c4caba131776ff7397d3a4071d7cc84907ac9a43.tar
tangerine-wallet-browser-c4caba131776ff7397d3a4071d7cc84907ac9a43.tar.gz
tangerine-wallet-browser-c4caba131776ff7397d3a4071d7cc84907ac9a43.tar.bz2
tangerine-wallet-browser-c4caba131776ff7397d3a4071d7cc84907ac9a43.tar.lz
tangerine-wallet-browser-c4caba131776ff7397d3a4071d7cc84907ac9a43.tar.xz
tangerine-wallet-browser-c4caba131776ff7397d3a4071d7cc84907ac9a43.tar.zst
tangerine-wallet-browser-c4caba131776ff7397d3a4071d7cc84907ac9a43.zip
bugfix: update eth_signTypedData_v3 parameter order
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/metamask-controller.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index ddc13c918..123e17569 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -1255,7 +1255,7 @@ module.exports = class MetamaskController extends EventEmitter {
engine.push(this.preferencesController.requestWatchAsset.bind(this.preferencesController))
engine.push(this.createTypedDataMiddleware('eth_signTypedData', 'V1').bind(this))
engine.push(this.createTypedDataMiddleware('eth_signTypedData_v1', 'V1').bind(this))
- engine.push(this.createTypedDataMiddleware('eth_signTypedData_v3', 'V3').bind(this))
+ engine.push(this.createTypedDataMiddleware('eth_signTypedData_v3', 'V3', true).bind(this))
engine.push(createProviderMiddleware({ provider: this.provider }))
// setup connection
@@ -1511,13 +1511,13 @@ module.exports = class MetamaskController extends EventEmitter {
* @param {Function} - next
* @param {Function} - end
*/
- createTypedDataMiddleware (methodName, version) {
+ createTypedDataMiddleware (methodName, version, reverse) {
return async (req, res, next, end) => {
const { method, params } = req
if (method === methodName) {
const promise = this.typedMessageManager.addUnapprovedMessageAsync({
- data: params.length >= 1 && params[0],
- from: params.length >= 2 && params[1],
+ data: reverse ? params[1] : params[0],
+ from: reverse ? params[0] : params[1],
}, req, version)
this.sendUpdate()
this.opts.showUnconfirmedMessage()