diff --git a/chrome-extension/js/etherwallet-master.js b/chrome-extension/js/etherwallet-master.js index b158b7daf1..ffffdc6e5a 100644 --- a/chrome-extension/js/etherwallet-master.js +++ b/chrome-extension/js/etherwallet-master.js @@ -7001,16 +7001,20 @@ var signMsgCtrl = function signMsgCtrl($scope, $sce, walletService) { var mewConnect = MewConnect.instance; connectApp.setMewConnect(mewConnect); mewConnect.on('signMessage', function (data) { - $scope.signMsg.signedMsg = JSON.parse(data); + $scope.signMsg.signedMsg = JSON.stringify({ + address: $scope.wallet.getAddressString(), + msg: thisMessage, + sig: data.sig, + version: '3', + signer: 'MEW' + }, null, 2); $scope.notifier.success('Successfully Signed Message with ' + $scope.wallet.getAddressString()); }); - mewConnect.on('sign', function (data) { - $scope.signMsg.signedMsg = JSON.parse(data); - $scope.notifier.success('Successfully Signed Message with ' + $scope.wallet.getAddressString()); + var hashedMessage = ethUtil.hashPersonalMessage(ethUtil.toBuffer(thisMessage)).toString('hex'); + connectApp.signMessage({ + hash: hashedMessage, + text: thisMessage }); - //TODO hash message before send. Currently sending as plain text - ethUtil.hashPersonalMessage(ethUtil.toBuffer(thisMessage)).toString('hex'); - connectApp.signMessage(thisMessage); //================= Mew Connect (end)============================== @@ -7078,9 +7082,7 @@ var signMsgCtrl = function signMsgCtrl($scope, $sce, walletService) { }; $scope.reOpenDecryptWalletMEWconnect = function () { - if ($scope.globalService.currentTab === 11) { - $scope.wd = false; - } + $scope.wd = false; }; globalFuncs.MEWconnectStatus.registerDecryptOpeners($scope.reOpenDecryptWalletMEWconnect.bind(this)); }; @@ -19814,10 +19816,8 @@ var MewConnectEth = function () { } }, { key: 'signMessage', - value: function signMessage(messageHex) { - var self = this; - var hashToSign = ethUtil.hashPersonalMessage(ethUtil.toBuffer(messageHex)); - self.comm.sendRtcMessage('signMessage', hashToSign.toString('hex')); + value: function signMessage(message) { + this.comm.sendRtcMessage('signMessage', message); } }], [{ key: 'getBrowserRTC', diff --git a/dist/js/etherwallet-master.js b/dist/js/etherwallet-master.js index b158b7daf1..ffffdc6e5a 100644 --- a/dist/js/etherwallet-master.js +++ b/dist/js/etherwallet-master.js @@ -7001,16 +7001,20 @@ var signMsgCtrl = function signMsgCtrl($scope, $sce, walletService) { var mewConnect = MewConnect.instance; connectApp.setMewConnect(mewConnect); mewConnect.on('signMessage', function (data) { - $scope.signMsg.signedMsg = JSON.parse(data); + $scope.signMsg.signedMsg = JSON.stringify({ + address: $scope.wallet.getAddressString(), + msg: thisMessage, + sig: data.sig, + version: '3', + signer: 'MEW' + }, null, 2); $scope.notifier.success('Successfully Signed Message with ' + $scope.wallet.getAddressString()); }); - mewConnect.on('sign', function (data) { - $scope.signMsg.signedMsg = JSON.parse(data); - $scope.notifier.success('Successfully Signed Message with ' + $scope.wallet.getAddressString()); + var hashedMessage = ethUtil.hashPersonalMessage(ethUtil.toBuffer(thisMessage)).toString('hex'); + connectApp.signMessage({ + hash: hashedMessage, + text: thisMessage }); - //TODO hash message before send. Currently sending as plain text - ethUtil.hashPersonalMessage(ethUtil.toBuffer(thisMessage)).toString('hex'); - connectApp.signMessage(thisMessage); //================= Mew Connect (end)============================== @@ -7078,9 +7082,7 @@ var signMsgCtrl = function signMsgCtrl($scope, $sce, walletService) { }; $scope.reOpenDecryptWalletMEWconnect = function () { - if ($scope.globalService.currentTab === 11) { - $scope.wd = false; - } + $scope.wd = false; }; globalFuncs.MEWconnectStatus.registerDecryptOpeners($scope.reOpenDecryptWalletMEWconnect.bind(this)); }; @@ -19814,10 +19816,8 @@ var MewConnectEth = function () { } }, { key: 'signMessage', - value: function signMessage(messageHex) { - var self = this; - var hashToSign = ethUtil.hashPersonalMessage(ethUtil.toBuffer(messageHex)); - self.comm.sendRtcMessage('signMessage', hashToSign.toString('hex')); + value: function signMessage(message) { + this.comm.sendRtcMessage('signMessage', message); } }], [{ key: 'getBrowserRTC',