Closed notmandatory closed 3 years ago
Also, I am not sure if we should silently ignore "no binary built" scenarios in CI.
with current changes for example cargo build --features esplora --no-default-features
will not build any binary, but the CI doesn't complain.
you can check that locally with
$ cargo clean
$ cargo build --features esplora --no-default-features
$ ./target/debug/bdk-cli wallet --help
bash: ./target/debug/bdk-cli: No such file or directory
I am not sure how then it's passing the tests without a binary.
I think tests were passing because they only needed a lib build to run. But I agree it would be nice to not have to use the --no-default-features
flag. I did the following to try and address this:
repl
feature into cli
for the required dependencies to build the cli bin, and repl
to enable the cli repl commands, then made the cli
feature required to build the cli bin, but the cli
and repl
features on by default.--no-default-features
flagThe following structure and function call could use feature guard. They exist in binary compiled without a backend, but are never used.
Thanks for the suggestions and review on this @rajarshimaitra, all ready to rebase your #36 PR.
Description
Allow at most one blockchain client feature be enabled at a time for builds. If no blockchain client feature is enabled then online wallet commands are disabled. This will simplify the options shown to the user and make adding new blockchain clients (such as #36) easier.
Electrum is still the default, to make a build with a different blockchain client theNo blockchain client is included in the--no-default-features
build option will need to be used.default
features, so if one is needed it must be specified with--features
. I also added a default esplora server url so the user doesn't need to specify one if selecting that client, which is how the electrum and compact_filters clients work.Notes to the reviewers
I changed the server option for both
electrum
andesplora
to --server or -s since that now won't cause a conflict. I also simplified the CHANGELOG to focus on what a user would see as a change while using the bin.I've also added a
build.rs
file to prevent more than one blockchain client feature from being enabled.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
CHANGELOG.md
Bugfixes: