[esplora] Support proxies in EsploraBlockchain#429
[esplora] Support proxies in EsploraBlockchain#429notmandatory merged 1 commit intobitcoindevkit:masterfrom
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
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
EsploraBlockchainConfigstruct with the new field added and only deprecate the current one?Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features:
CHANGELOG.md