HDWallet: add to/fromHex tests

This commit is contained in:
Daniel Cousens 2014-06-01 16:39:07 +10:00
commit 4cec42a8d8
2 changed files with 35 additions and 4 deletions

View file

@ -132,6 +132,10 @@ HDWallet.fromBuffer = function(buffer) {
return hd
}
HDWallet.fromHex = function(hex, priv) {
return HDWallet.fromBuffer(new Buffer(hex, 'hex'))
}
HDWallet.prototype.getIdentifier = function() {
return crypto.hash160(this.pub.toBuffer())
}
@ -182,6 +186,7 @@ HDWallet.prototype.toBuffer = function(priv) {
return buffer
}
HDWallet.prototype.toHex = function(priv) {
return this.toBuffer(priv).toString('hex')
}