-
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
Parameterize network information detection #402
Comments
This part of #325 was probably the most controversial, and likely demands more discussion. But it does make the examples a little more verbose. |
Disagree with not having a default |
@jprichardson its an interesting problem to be sure. Defaults are powerful. But in this case they can also be a source of error. I know for a fact that removing them would be useful in avoiding little frustrating errors that pop up often, but keeping them doesn't appear to be too harmful either as the error is usually immediately obvious. |
Ping @weilu, @rubensayshi for any further discussion and thoughts? Yay or nay on this? |
I like having a default network, but I have to admit, I've personally build everything I did so far to support both testnet and mainnet and thus specify the network all the time. regardless I think a default doesn't hurt and makes life easier for a group of users, including most likely people who try out the library for the first time |
Provide a consistent default network when possible. In case of detection of a network, require a list of possible networks passed in. |
That is an interesting approach. |
Unless there is further discussion, I'm actually thinking the best approach for the auto-detected networks will be as @weilu outlined above:
And for the default network, maintain the behaviour as it currently stands. |
Resolved in #425 |
Remaining aspects of #325
We should add
network
to all parts of the API that need it~~, with no defaulting~~.That meansECPair.fromWIF
would require a target network, with anError
thrown if the wrong network is given.Same with
HDNode.fromBase58
.The text was updated successfully, but these errors were encountered: