-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add network list tests for ECPair/HDNode #550
Conversation
@fanatid please review 👍. Thoughts on aae5db6? On the 1 hand, easier to verify the tests are actually following the path they should be (not ambiguous with the other other case). |
@dcousens I think throwing 2 different errors is OK, first says that not one of network from |
@@ -72,7 +74,7 @@ HDNode.fromBase58 = function (string, networks) { | |||
} | |||
|
|||
if (version !== network.bip32.private && | |||
version !== network.bip32.public) throw new Error('Invalid network') | |||
version !== network.bip32.public) throw new Error('Invalid network version') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious, you don't use align in if
blocks?
if (version !== network.bip32.private &&
version !== network.bip32.public) throw new Error('Invalid network version')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, alignment isn't that big a deal IMHO.
Its also very hard to enforce semantically so I don't bother.
Add network list tests for ECPair/HDNode
This actually fixes a bug
bip32 is undefined
when a networks list was passed and no valid version was found inHDNode
.