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

Report progress on blockchains that don't currently report intermediate progress #798

Closed
notmandatory opened this issue Nov 17, 2022 · 3 comments
Labels
api A breaking API change discussion There's still a discussion ongoing module-wallet new feature New feature or request
Milestone

Comments

@notmandatory
Copy link
Member

Describe the enhancement
Blockchains electrum and esplora don't currently update the progress callback. For apps that expect progress this causes a problem. The blockchains that don't report progress should just call the progress call back with 0 and then 100 when done.

Use case
On apps that let the user select which blockchain there needs to be at least starting and ending progress call backs even if the underlying blockchain doesn't have intermediate progress updates.

Additional context

_progress_update: Box<dyn Progress>,

_progress_update: Box<dyn Progress>,

_progress_update: Box<dyn Progress>,

@LLFourn
Copy link
Contributor

LLFourn commented Nov 18, 2022

FWIW the plan is to remove Progress from bdk in v1. Instead, you can attach to the iterator that electrum/esplora type syncs use and as they consume more addresses you can see them with .inspect: https://github.com/LLFourn/bdk_core_staging/blob/c1fea6df1c0cb8ee514ec67b50b67ff12e430c8d/bdk_core_example/src/main.rs#L200

This effectively allows you to get a callback any time a new address is consumed by them. Of course not all blockchain data is fetched in the same way but for those that iterate over script pubkeys and find related transactions this is a very convenient way.

@notmandatory
Copy link
Member Author

Thanks, make sense not to change anything now then, but I will leave this issue open as a place holder to create example code to demo now to do this once we have the v1 apis out. Or possibly implement something for the bdk_compat layer if we're going to have that as a bridge for pre-v1 apps.

@notmandatory notmandatory removed the good first issue Good for newcomers label Nov 19, 2022
@notmandatory notmandatory added good first issue Good for newcomers discussion There's still a discussion ongoing and removed good first issue Good for newcomers labels Jan 13, 2023
@notmandatory notmandatory added this to the Alpha 1.0.0 milestone Mar 2, 2023
@notmandatory notmandatory removed this from the 1.0.0-alpha.0 milestone Mar 3, 2023
@notmandatory notmandatory added this to BDK May 4, 2023
@notmandatory notmandatory moved this to Todo in BDK Jan 2, 2024
@notmandatory notmandatory added module-wallet api A breaking API change labels Mar 17, 2024
@notmandatory
Copy link
Member Author

Related to #1153 and #1194.

@notmandatory notmandatory added this to the 1.0.0-alpha milestone Mar 17, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in BDK Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api A breaking API change discussion There's still a discussion ongoing module-wallet new feature New feature or request
Projects
Archived in project
Development

No branches or pull requests

3 participants