Skip to content
This repository has been archived by the owner on Aug 21, 2018. It is now read-only.

Commit

Permalink
added personal_sign
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke committed Feb 5, 2017
1 parent 67e880d commit 88fa68f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/js/maps/mewify-master.min.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion app/js/mewify-master.js
Original file line number Diff line number Diff line change
Expand Up @@ -38278,6 +38278,7 @@ module.exports=[
"personal_newAccount",
"personal_sendTransaction",
"personal_signAndSendTransaction",
"personal_sign",
"rpc_modules"
]

Expand Down Expand Up @@ -38385,6 +38386,7 @@ var privMethodHandler = function(server) {
"eth_sendTransaction": 'signAndSendTransaction',
"personal_newAccount": "personalNewAccount",
"eth_sign": "ethSign",
"personal_sign": "ethSign",
"rpc_modules": "rpcModules"
}
_this.ethAccounts('', function() {});
Expand Down Expand Up @@ -38524,6 +38526,7 @@ var decryptAndSignData = function(cont, uiTx, callback) {
privMethodHandler.prototype.ethSign = function(params, callback) {
var _this = this;
var accountFound = false;
if (!params[2]) params[2] = '';
privMethodHandler.accounts.forEach(function(account) {
if (accountFound) return;
if (account.address == params[0].toLowerCase()) {
Expand All @@ -38533,7 +38536,7 @@ privMethodHandler.prototype.ethSign = function(params, callback) {
else {
var dataBuf = new Buffer(params[1].replace('0x', ''), 'hex');
var data = "\x19Ethereum Signed Message:\n" + dataBuf.length + dataBuf;
var tempTx = { from: params[0], data: ethUtil.sha3(data), string: data };
var tempTx = { from: params[0], data: ethUtil.sha3(data), string: data, pass: params[2] };
angularApprovalHandler.showSignConfirm(tempTx, function(data) {
if (data.error) callback(data);
else {
Expand Down
2 changes: 1 addition & 1 deletion app/js/mewify-master.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/scripts/libs/methods/privMethods.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"personal_newAccount",
"personal_sendTransaction",
"personal_signAndSendTransaction",
"personal_sign",
"rpc_modules"
]
4 changes: 3 additions & 1 deletion src/scripts/libs/privMethodHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var privMethodHandler = function(server) {
"eth_sendTransaction": 'signAndSendTransaction',
"personal_newAccount": "personalNewAccount",
"eth_sign": "ethSign",
"personal_sign": "ethSign",
"rpc_modules": "rpcModules"
}
_this.ethAccounts('', function() {});
Expand Down Expand Up @@ -150,6 +151,7 @@ var decryptAndSignData = function(cont, uiTx, callback) {
privMethodHandler.prototype.ethSign = function(params, callback) {
var _this = this;
var accountFound = false;
if (!params[2]) params[2] = '';
privMethodHandler.accounts.forEach(function(account) {
if (accountFound) return;
if (account.address == params[0].toLowerCase()) {
Expand All @@ -159,7 +161,7 @@ privMethodHandler.prototype.ethSign = function(params, callback) {
else {
var dataBuf = new Buffer(params[1].replace('0x', ''), 'hex');
var data = "\x19Ethereum Signed Message:\n" + dataBuf.length + dataBuf;
var tempTx = { from: params[0], data: ethUtil.sha3(data), string: data };
var tempTx = { from: params[0], data: ethUtil.sha3(data), string: data, pass: params[2] };
angularApprovalHandler.showSignConfirm(tempTx, function(data) {
if (data.error) callback(data);
else {
Expand Down

0 comments on commit 88fa68f

Please sign in to comment.