tests: add API consistency and tests for #366
This commit is contained in:
parent
49050f9d26
commit
9daf937e93
2 changed files with 36 additions and 0 deletions
src
|
@ -43,7 +43,11 @@ function HDNode(K, chainCode, network) {
|
|||
if (K instanceof BigInteger) {
|
||||
this.privKey = new ECKey(K, true)
|
||||
this.pubKey = this.privKey.pub
|
||||
} else if (K instanceof ECKey) {
|
||||
assert(K.pub.compressed, 'ECKey must be compressed')
|
||||
this.privKey = K
|
||||
} else if (K instanceof ECPubKey) {
|
||||
assert(K.compressed, 'ECPubKey must be compressed')
|
||||
this.pubKey = K
|
||||
} else {
|
||||
this.pubKey = new ECPubKey(K, true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue