Comparing version 0.7.0 to 0.7.1
@@ -0,1 +1,5 @@ | ||
0.7.1 / 2016-05-26 | ||
------------------ | ||
- fix bug when `privateKey` is `null`, `privateExtendedKey` should not throw, and return `null` [#7][#7] | ||
0.7.0 / 2016-03-22 | ||
@@ -13,3 +17,3 @@ ------------------ | ||
- JavaScript Standard Style | ||
- fix rare condition for BIP32 consistency: https://github.com/cryptocoinjs/hdkey/issues/1 | ||
- fix rare condition for BIP32 consistency: [#1][#1] | ||
- added `toJSON()/fromJSON()` | ||
@@ -55,11 +59,9 @@ | ||
<!--- hdkey: use the secp256k1 package for crypto --> | ||
[#5]: https://github.com/cryptocoinjs/hdkey/pull/5 | ||
<!--- Is this library still maintained? --> | ||
[#4]: https://github.com/cryptocoinjs/hdkey/issues/4 | ||
<!--- Update hdkey.js --> | ||
[#3]: https://github.com/cryptocoinjs/hdkey/pull/3 | ||
<!--- Update hdkey.js --> | ||
[#2]: https://github.com/cryptocoinjs/hdkey/pull/2 | ||
<!--- rare condition needed for bip consistency --> | ||
[#1]: https://github.com/cryptocoinjs/hdkey/issues/1 | ||
<!-- generated using jprichardson/issue-links --> | ||
[#7]: https://github.com/cryptocoinjs/hdkey/issues/7 "privateExtendedKey error handling" | ||
[#6]: https://github.com/cryptocoinjs/hdkey/pull/6 "hdkey: use bippath for BIP32 path parsing and validation" | ||
[#5]: https://github.com/cryptocoinjs/hdkey/pull/5 "hdkey: use the secp256k1 package for crypto" | ||
[#4]: https://github.com/cryptocoinjs/hdkey/issues/4 "Is this library still maintained?" | ||
[#3]: https://github.com/cryptocoinjs/hdkey/pull/3 "Update hdkey.js" | ||
[#2]: https://github.com/cryptocoinjs/hdkey/pull/2 "Update hdkey.js" | ||
[#1]: https://github.com/cryptocoinjs/hdkey/issues/1 "rare condition needed for bip consistency" |
@@ -60,3 +60,4 @@ var assert = require('assert') | ||
get: function () { | ||
return cs.encode(serialize(this, this.versions.private, Buffer.concat([new Buffer([0]), this.privateKey]))) | ||
if (this._privateKey) return cs.encode(serialize(this, this.versions.private, Buffer.concat([new Buffer([0]), this.privateKey]))) | ||
else return null | ||
} | ||
@@ -63,0 +64,0 @@ }) |
{ | ||
"name": "hdkey", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "Bitcoin BIP32 hierarchical deterministic keys", | ||
@@ -33,3 +33,3 @@ "main": "lib/hdkey.js", | ||
"secure-random": "^1.0.0", | ||
"standard": "6.x" | ||
"standard": "^7.1.1" | ||
}, | ||
@@ -36,0 +36,0 @@ "dependencies": { |
@@ -9,2 +9,3 @@ var assert = require('assert') | ||
// trinity: mocha | ||
/* global describe it */ | ||
@@ -142,2 +143,18 @@ | ||
}) | ||
describe('> when private key is null', function () { | ||
it('privateExtendedKey should return null and not throw', function () { | ||
var seed = '000102030405060708090a0b0c0d0e0f' | ||
var masterKey = HDKey.fromMasterSeed(new Buffer(seed, 'hex')) | ||
assert.ok(masterKey.privateExtendedKey, 'xpriv is truthy') | ||
masterKey._privateKey = null | ||
assert.doesNotThrow(function () { | ||
masterKey.privateExtendedKey | ||
}) | ||
assert.ok(!masterKey.privateExtendedKey, 'xpriv is falsy') | ||
}) | ||
}) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23488
397