tests: add API consistency and tests for

This commit is contained in:
Daniel Cousens 2015-02-24 12:23:31 +11:00
parent 49050f9d26
commit 9daf937e93
2 changed files with 36 additions and 0 deletions

View file

@ -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)