-
Notifications
You must be signed in to change notification settings - Fork 65
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
Migrate from structopt to clap. #124
Conversation
Thanks for starting this! I don't see a problem updating |
Thanks @notmandatory .. If we can move up to 1.57 for bdk-cli then that resolves major chunk of the issue.. Will update the PR accordingly.. |
@notmandatory updated with few more fixes..
|
Documented the issue here #126 |
I'll need to change the branch protection rules to require 1.57 instead of 1.56. That means this this PR would need to get merged next and any others rebased on it. Is that the order you want to do things? |
@notmandatory Updated this to bdk v0.23.. Fixed #126 .. Turns out the only way to parse |
This commit include changes to move from structopt to clap. This includes: - Update Cargo.toml. - Update commands from structopt to clap. - Some auxiliary fixes in commands. - Updates main.
Clap doesn't support custom vector parsing. Not so ideal work around is to handle recipient parsing in create_tx handler at run time.
Vector parsing is possible with multiple flags.
I updated the branch protection rules to check for the tests run against 1.57 instead of 1.56. Looks like you just need to fix up the WASM. |
ed33f38
to
4ff8619
Compare
Sorry its taking some time and iteration.. I am not being able to play the wasm run in local.. So trying up with the CI outputs here.. Seems like it fixed the issue but now clippy is throwing an
But that import |
🎉 🎉 It worked.. @notmandatory this is now good for merge.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK b20a140
Did a little manual testing also and everything worked.
Description
Fixes #113.
This is an attempt to migrate from
structopt
toclap v0.3
which provides very similar kind of derives asstructopt
. Changes are straight forward. But this comes with few more problems.with clap
v3.2.22
the MSRV pushes up to1.57.0
.. The last clap of MSRV1.56.0
wasclap 3.2.5
.. But even that doesn't seem to be working at MSRV1.56.0
anymore, as bunch of underlying lib has upgraded.clap v3.0
doesn't seem to support custom vector parsing well, reported here Handle parsing vector of custom structures clap-rs/clap#1704. This is required forrecipient
parsing which is aVec<(Script, u32)>
. Workaround for that is to use vecs of strings and parse them at runtime increate_tx
handler. Included in the PR.Notes to the reviewers
structopt
is currently freezed atclap 2.0
and doesn't seem to intend on updating and currently its has unmaintained vulnerability. Andclap v3.0
onward seems to replacing everything thatstructopt
did before. So this means we should also look for ways to migrate fromstrcutopt
toclap
.. Butclap
seemed to have moved ahead than our MSRV1.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:
cargo fmt
andcargo clippy
before committing