Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 47a0001

Browse files
committed
Update hdkey to 0.8.0
1 parent 52f0ca9 commit 47a0001

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

hdkey.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ EthereumHDKey.fromExtendedKey = function (base58key) {
2222
}
2323

2424
EthereumHDKey.prototype.privateExtendedKey = function () {
25-
// FIXME: change this according to the outcome of https://github.com/cryptocoinjs/hdkey/issues/7
26-
if (!this._hdkey._privateKey) {
27-
throw new Error('Private key is not available')
25+
if (!this._hdkey.privateExtendedKey) {
26+
throw new Error('This is a public key only wallet')
2827
}
2928
return this._hdkey.privateExtendedKey
3029
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"aes-js": "^3.1.0",
3030
"bs58check": "^2.1.1",
3131
"ethereumjs-util": "^5.1.4",
32-
"hdkey": "^0.7.0",
32+
"hdkey": "^0.8.0",
3333
"safe-buffer": "^5.1.1",
3434
"scrypt.js": "^0.2.0",
3535
"utf8": "^3.0.0",

test/hdkey.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('.fromExtendedKey()', function () {
3232
assert.equal(hdnode.publicExtendedKey(), 'xpub661MyMwAqRbcGout4B6s29b6gGQsowyoiF6UgXBEr7eFCWYfXuZDvRxP9zEh1Kwq3TLqDQMbkbaRpSnoC28oWvjLeshoQz1StZ9YHM1EpcJ')
3333
assert.throws(function () {
3434
hdnode.privateExtendedKey()
35-
}, /^Error: Private key is not available$/)
35+
}, /^Error: This is a public key only wallet$/)
3636
})
3737
it('should work with private', function () {
3838
var hdnode = HDKey.fromExtendedKey('xprv9s21ZrQH143K4KqQx9Zrf1eN8EaPQVFxM2Ast8mdHn7GKiDWzNEyNdduJhWXToy8MpkGcKjxeFWd8oBSvsz4PCYamxR7TX49pSpp3bmHVAY')

0 commit comments

Comments
 (0)