From d994b2682ab099ff993b65f53f402700042a7e11 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 5 Feb 2020 17:46:51 -0500 Subject: [PATCH] fix signMessage --- src/blockchain/providers/vm.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/blockchain/providers/vm.js b/src/blockchain/providers/vm.js index e9fbfaca39..a359066499 100644 --- a/src/blockchain/providers/vm.js +++ b/src/blockchain/providers/vm.js @@ -55,10 +55,20 @@ class VMProvider { console.dir("--- signMessage") const hashedMsg = Web3.utils.sha3(message) try { - this.web3.eth.sign(account, hashedMsg, (error, signedData) => { - cb(error.message, hashedMsg, signedData) + // this.web3.eth.sign(account, hashedMsg, (error, signedData) => { + this.web3.eth.sign(hashedMsg, account, (error, signedData) => { + if (error) { + return cb(error) + } + console.dir("------") + console.dir(error) + console.dir("------") + cb(null, hashedMsg, signedData) }) } catch (e) { + console.dir("======") + console.dir(e) + console.dir("======") cb(e.message) } // const personalMsg = ethJSUtil.hashPersonalMessage(Buffer.from(message))