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

Open
4 of 5 tasks
ValuedMammal opened this issue May 9, 2024 · 3 comments · May be fixed by #1442
Open
4 of 5 tasks

example: Fix wallet examples #1434

ValuedMammal opened this issue May 9, 2024 · 3 comments · May be fixed by #1442
Assignees
Labels
documentation Improvements or additions to documentation

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
  • Consider moving these smaller examples to the bdk/examples folder
@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 linked a pull request May 14, 2024 that will close this issue
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

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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants