Browse Source

HDWallet: adds Public -> public tests

hk-custom-address
Daniel Cousens 11 years ago
parent
commit
29fbbaa58d
  1. 21
      test/hdwallet.js

21
test/hdwallet.js

@ -237,5 +237,26 @@ describe('HDWallet', function() {
})
})
})
it('works for public -> public', function() {
var f = fixtures.valid[1]
var c = f.children[0]
var parent = HDWallet.fromBase58(f.master.base58)
var child = parent.derive(c.m)
assert.equal(child.toBase58(), c.base58)
})
it('throws on public -> public (hardened)', function() {
var f = fixtures.valid[1]
var c = f.children[0]
var parent = HDWallet.fromBase58(f.master.base58)
assert.throws(function() {
parent.derivePrivate(c.m)
}, /Could not derive hardened child key/)
})
})
})

Loading…
Cancel
Save