-
Notifications
You must be signed in to change notification settings - Fork 384
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
[esplora] Support proxies in EsploraBlockchain #429
[esplora] Support proxies in EsploraBlockchain #429
Conversation
79afac4
to
47a7a9c
Compare
On the question of how to make this sort of API change, since it's an additive change with an @thomaseizinger, as a user, what do you think about his sort of change? would it disrupt your workflow to have to add a new |
It is technically breaking yes. I see two ways of changing the code so this change would be non breaking:
EsploraBlockchainConfig::default().with_xyz().with_abc() (1) is less code (no builders and getters) and would result in usage such as: let config = EsploraBlockchainConfig {
concurrency: Some(4),
..EsploraBlockchainConfig::default()
}; Personally, I think (1) would be the better option unless you want to support Rust < 1.40. For this particular PR, it is still a breaking change but we might at least take this opportunity to make future changes non-breaking :) |
It looks this doesn't work for users outside the bdk crate (while logically flawless) |
Damn, sorry about that. I swear I did this before with non-exhaustive structs. In guess it will have to be something like this then: let mut config = ElectrumBlockchainConfig::new("foo".to_owned());
config.retry = 1; |
What about the option:
If we go this route I'll add an issue to implement And maybe someday a future version of Rust will let us add the |
For In that case, providing a constructor that only takes the mandatory arguments (in this case |
We've talked about this yesterday during our team meeting and we reached the conclusion that it's better to just add the field and technically break the API: the reasoning is that we think it's better to force the user to use the explicit initialization syntax so that they are aware of all the existing fields of the struct. Ideally we would also implement |
Needs a rebase and then I think this one is ready to review. |
47a7a9c
to
3fe2380
Compare
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.
ACK 3fe2380
Description
Add support for http/socks proxies in Esplora
Notes to the reviewers
Opening this as a draft, since I think it's gonna break for wasm32.
This is also technically an API break, which according to the new updated guidelines shouldn't happen. On the other hand, I can't think of a better way to do this. Am I supposed to make a different
EsploraBlockchainConfig
struct with the new field added and only deprecate the current one?Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
CHANGELOG.md