Skip to content

Commit

Permalink
Merge #124: Migrate from structopt to clap.
Browse files Browse the repository at this point in the history
b20a140 Fix some clippies.. (rajarshimaitra)
1e21cc7 Fix wasm (rajarshimaitra)
ba1c165 Update cargo lock. (rajarshimaitra)
02e71b0 Reverse the recipient parsing string (rajarshimaitra)
95719b0 Remove vector of string from compact_filters options. (rajarshimaitra)
9fb651a Update wasm build to 1.57 in CI (rajarshimaitra)
7e87a65 update MSRV to 1.57 (rajarshimaitra)
3dcc269 Update Cargo lock (rajarshimaitra)
f8c0f2e Update recipient parsing in handlers. (rajarshimaitra)
5bbc45a Move from structopt to clap (rajarshimaitra)

Pull request description:

  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### Description

  Fixes #113.

  This is an attempt to migrate from `structopt` to `clap v0.3` which provides very similar kind of derives as `structopt`. Changes are straight forward. But this comes with few more problems.

   - with clap `v3.2.22` the MSRV pushes up to `1.57.0`.. The last clap of MSRV `1.56.0` was `clap 3.2.5`.. But even that doesn't seem to be working at MSRV `1.56.0` anymore, as bunch of underlying lib has upgraded.

   - `clap v3.0` doesn't seem to support custom vector parsing well, reported here clap-rs/clap#1704. This is required for `recipient` parsing which is a `Vec<(Script, u32)>`.  Workaround for that is to use vecs of strings and parse them at runtime in `create_tx` handler. Included in the PR.

  ### Notes to the reviewers

  `structopt` is currently freezed at `clap 2.0` and doesn't seem to intend on updating and currently its has unmaintained vulnerability. And `clap v3.0` onward seems to replacing everything that `structopt` did before.  So this means we should also look for ways to migrate from `strcutopt` to `clap`.. But `clap` seemed to have moved ahead than our MSRV `1.56.0`.. So we need to take up a call on that.. Opened this PR to facilitate that discussion..

  This is draft until we figure what to do..

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk-cli/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

ACKs for top commit:
  notmandatory:
    ACK b20a140

Tree-SHA512: de3511c1531185064e3c328f0c966c3e87294b7c6d07a89ba9f64e49f7c8b8ccaef0915f49fc6721b738f91a0128b30eeb61147a2da174ccac9abab094ab6798
  • Loading branch information
notmandatory committed Nov 29, 2022
2 parents af925ab + b20a140 commit 18ee6b2
Show file tree
Hide file tree
Showing 7 changed files with 192 additions and 198 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cont_integration.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
rust:
- 1.60.0 # STABLE
- 1.56.0 # MSRV
- 1.57.0 # MSRV
features:
- default
- electrum,sqlite-db
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- run: sudo apt-get update || exit 1
- run: sudo apt-get install -y libclang-common-10-dev clang-10 libc6-dev-i386 || exit 1
- name: Set default toolchain
run: rustup default 1.56.1 # MSRV
run: rustup default 1.57.0 # MSRV
- name: Set profile
run: rustup set profile minimal
- name: Add target wasm32
Expand Down
99 changes: 42 additions & 57 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -14,7 +14,7 @@ license = "MIT"
[dependencies]
bdk = { version = "0.24", default-features = false, features = ["all-keys"] }
bdk-macros = "0.6"
structopt = "0.3"
clap = { version = "3.2.22", features = ["derive"] }
serde_json = "1.0"
log = "0.4"
zeroize = "<1.4.0"
Expand Down

0 comments on commit 18ee6b2

Please sign in to comment.