Skip to content
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

Stop using Stellar.default_network #87

Open
JakeUrban opened this issue Apr 1, 2020 · 0 comments
Open

Stop using Stellar.default_network #87

JakeUrban opened this issue Apr 1, 2020 · 0 comments

Comments

@JakeUrban
Copy link
Contributor

Users are currently required to set Stellar.default_network in order to submit transactions to mainnet. If users have clients for multiple different networks, they have to reset default_network before every submission.

This requirement is missed by many newcomers and can be confusing to even experienced users when they explicitly declare a client for mainnet but still have to set this attribute on the top-level module.

This design also differs from most of the SDKs (Go, Python, JavaScript, etc.). Instead, these SDK's accept the network passphrase as a parameter to the function that need it. See the JS library's TransactionBuilder, for example.

We should change the ruby implementation to accept these same parameters while maintaining backwards compatibility. This likely means the network will have to come in the form of a keyword argument. If omitted, the SDK can still use Stellar.default_network, but downstream errors due to not setting this attribute should be replaced with a suggestion to pass the network passphrase to the function or object constructor.

@nebolsin nebolsin transferred this issue from astroband/ruby-stellar-base May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@nebolsin @JakeUrban and others