This repository was archived by the owner on Oct 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,8 @@ EthereumHDKey.fromExtendedKey = function (base58key) {
22
22
}
23
23
24
24
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' )
28
27
}
29
28
return this . _hdkey . privateExtendedKey
30
29
}
Original file line number Diff line number Diff line change 29
29
"aes-js" : " ^3.1.0" ,
30
30
"bs58check" : " ^2.1.1" ,
31
31
"ethereumjs-util" : " ^5.1.4" ,
32
- "hdkey" : " ^0.7 .0" ,
32
+ "hdkey" : " ^0.8 .0" ,
33
33
"safe-buffer" : " ^5.1.1" ,
34
34
"scrypt.js" : " ^0.2.0" ,
35
35
"utf8" : " ^3.0.0" ,
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ describe('.fromExtendedKey()', function () {
32
32
assert . equal ( hdnode . publicExtendedKey ( ) , 'xpub661MyMwAqRbcGout4B6s29b6gGQsowyoiF6UgXBEr7eFCWYfXuZDvRxP9zEh1Kwq3TLqDQMbkbaRpSnoC28oWvjLeshoQz1StZ9YHM1EpcJ' )
33
33
assert . throws ( function ( ) {
34
34
hdnode . privateExtendedKey ( )
35
- } , / ^ E r r o r : P r i v a t e k e y i s n o t a v a i l a b l e $ / )
35
+ } , / ^ E r r o r : T h i s i s a p u b l i c k e y o n l y w a l l e t $ / )
36
36
} )
37
37
it ( 'should work with private' , function ( ) {
38
38
var hdnode = HDKey . fromExtendedKey ( 'xprv9s21ZrQH143K4KqQx9Zrf1eN8EaPQVFxM2Ast8mdHn7GKiDWzNEyNdduJhWXToy8MpkGcKjxeFWd8oBSvsz4PCYamxR7TX49pSpp3bmHVAY' )
You can’t perform that action at this time.
0 commit comments