HDWallet: add to/fromHex tests
This commit is contained in:
parent
260705a24a
commit
4cec42a8d8
2 changed files with 35 additions and 4 deletions
src
|
@ -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')
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue