HDWallet: now export all information by default
This commit is contained in:
parent
48503f252c
commit
c340f5cf83
@ -159,6 +159,8 @@ HDWallet.prototype.toBase58 = function(isPrivate) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HDWallet.prototype.toBuffer = function(isPrivate) {
|
HDWallet.prototype.toBuffer = function(isPrivate) {
|
||||||
|
if (isPrivate == undefined) isPrivate = !!this.priv
|
||||||
|
|
||||||
// Version
|
// Version
|
||||||
var version = isPrivate ? this.network.bip32.private : this.network.bip32.public
|
var version = isPrivate ? this.network.bip32.private : this.network.bip32.public
|
||||||
var buffer = new Buffer(HDWallet.LENGTH)
|
var buffer = new Buffer(HDWallet.LENGTH)
|
||||||
|
|||||||
@ -71,7 +71,7 @@ describe('HDWallet', function() {
|
|||||||
it('exports ' + f.master.base58 + ' (public) correctly', function() {
|
it('exports ' + f.master.base58 + ' (public) correctly', function() {
|
||||||
var hd = HDWallet.fromSeedHex(f.master.seed)
|
var hd = HDWallet.fromSeedHex(f.master.seed)
|
||||||
|
|
||||||
assert.equal(hd.toBase58(), f.master.base58)
|
assert.equal(hd.toBase58(false), f.master.base58)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ describe('HDWallet', function() {
|
|||||||
it('imports ' + f.master.base58Priv + ' (private) correctly', function() {
|
it('imports ' + f.master.base58Priv + ' (private) correctly', function() {
|
||||||
var hd = HDWallet.fromBase58(f.master.base58Priv)
|
var hd = HDWallet.fromBase58(f.master.base58Priv)
|
||||||
|
|
||||||
assert.equal(hd.toBase58(true), f.master.base58Priv)
|
assert.equal(hd.toBase58(), f.master.base58Priv)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ describe('HDWallet', function() {
|
|||||||
it('imports ' + f.master.hexPriv + ' (private) correctly', function() {
|
it('imports ' + f.master.hexPriv + ' (private) correctly', function() {
|
||||||
var hd = HDWallet.fromHex(f.master.hexPriv)
|
var hd = HDWallet.fromHex(f.master.hexPriv)
|
||||||
|
|
||||||
assert.equal(hd.toBuffer(true).toString('hex'), f.master.hexPriv)
|
assert.equal(hd.toBuffer().toString('hex'), f.master.hexPriv)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ describe('HDWallet', function() {
|
|||||||
it('exports ' + f.master.hex + ' (public) correctly', function() {
|
it('exports ' + f.master.hex + ' (public) correctly', function() {
|
||||||
var hd = HDWallet.fromSeedHex(f.master.seed)
|
var hd = HDWallet.fromSeedHex(f.master.seed)
|
||||||
|
|
||||||
assert.equal(hd.toHex(), f.master.hex)
|
assert.equal(hd.toHex(false), f.master.hex)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user