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

example: Fix wallet examples #1434

Closed
5 tasks done
ValuedMammal opened this issue May 9, 2024 · 3 comments · Fixed by #1595
Closed
5 tasks done

example: Fix wallet examples #1434

ValuedMammal opened this issue May 9, 2024 · 3 comments · Fixed by #1595
Assignees
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@ValuedMammal
Copy link
Contributor

ValuedMammal commented May 9, 2024

These are some fixes that can be implemented for the wallet_* examples in the example-crates dir.

  • Print balances either in BTC or sats (but not both)
  • wallet_esplora_async appears to be printing the KeychainKind twice, and forgets to print spk0
  • Use tempfile instead of std::env::tempdir, as this should automatically clean up temporary files
  • Consider changing wallet examples to use signet and possibly a different server URL to fix rate limiting issues
  • Try to recycle the sats so that running an example doesn't result in a net loss of "funds"
@ValuedMammal ValuedMammal added the documentation Improvements or additions to documentation label May 9, 2024
@storopoli
Copy link
Contributor

You can assign this to me.
I am eager to help.

@storopoli
Copy link
Contributor

@ValuedMammal the problem with

  • Consider moving these smaller examples to the bdk/examples folder

is that we cannot add them to the wallet/examples folder is due to the fact that bdk_esplora and bdk_electrum crates are not dependencies for bdk_wallet.
Hence we cannot add them to the cargo examples.

However we can circumvent this by adding both bdk_electrum and bdk_esplora to the dev-depencies of bdk_wallet.
Which I think is not worth it the extra overhead.

Source: https://users.rust-lang.org/t/cargo-example-only-dependencies/3215

@storopoli storopoli mentioned this issue May 14, 2024
8 tasks
@ValuedMammal
Copy link
Contributor Author

we cannot add them to the wallet/examples folder is due to the fact that bdk_esplora and bdk_electrum crates are not dependencies for bdk_wallet.

you're right, they will probably have to stay in example-crates

@notmandatory notmandatory added this to BDK Jun 23, 2024
@notmandatory notmandatory moved this to Todo in BDK Jun 23, 2024
@notmandatory notmandatory added this to the 1.0.0-beta milestone Jun 23, 2024
@github-project-automation github-project-automation bot moved this from Needs Review to Done in BDK Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants