Skip to content
This repository has been archived by the owner on Jan 9, 2019. It is now read-only.

Commit

Permalink
fix signHash
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstep committed Nov 14, 2017
1 parent ca73f86 commit 2120554
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/model/Eth/Wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,15 @@ export default class Wallet {

signHash(hash){
if (!_privkey) return false
return signHash(hash, _privkey)

hash = Utils.add0x(hash)
if (this.web3.utils.isHexStrict(hash)) {
console.log(hash+' is not correct hex')
console.log('Use DCLib.Utils.makeSeed or Utils.soliditySHA3(your_args) to create valid hash')
throw new Error('invalid hash')
}

return signHash(hash, Utils.add0x(_privkey))
}

}
Expand Down

0 comments on commit 2120554

Please sign in to comment.