Repository navigation
feat(cli): accept --wallet as the wallet a wallet command acts on - #93
Conversation
13c62f7 to
7b29bb0
Compare
tee8z
left a comment
There was a problem hiding this comment.
Approved 7b29bb0 against fix/cli-transport-error-cause (#90 134f858). This change does not depend on #90, which has changes requested.
target_idreads only an explicit--wallet. The global--walletflag has no clapenv, andVOLTAGE_WALLET_IDand profiles are resolved later insourced_scope, so neither can select the wallet that awallets deleteacts on. That is the right safety property.- Only the operations where
targets_wallet()is true relax the requiredTargetFlagsgroup.payments get --walletstill requiresPAYMENT_ID, and a test covers it. - An ID and
--walletthat differ, or that are both missing, are usage errors with hints, and both are tested.
Validation on this head, in nix develop: cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo machete --with-metadata and python3 scripts/check-coverage.py passed. In cargo test --locked, all 138 unit tests passed. One integration test from #75, a_profile_saved_after_login_keeps_changes_made_while_its_prompt_was_open, failed once at the harness's 10-second prompt wait while other builds were running. It passed in the CRAP run's full suite and in 2 of 2 isolated reruns, and this PR does not touch it. CRAP: 626 measured functions, none at or above 20, highest wait_for_payment at 19.60; 176 functions were unmeasured. CI is green.
7b29bb0 to
b3df4d0
Compare
tee8z
left a comment
There was a problem hiding this comment.
Re-approved b3df4d0, a rebase onto #90 e4f73a8. The patch is the one I approved as 7b29bb0, and only the CHANGELOG context differs. Validation on this head, in nix develop: cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo machete --with-metadata, cargo test --locked (140 unit, 122 integration) and python3 scripts/check-coverage.py passed. CRAP: 628 measured functions, none at or above 20, highest wait_for_payment at 19.60. CI is green.
A command that acts on one wallet, such as
wallets get,wallets deleteorwallets policies get, now also takes the wallet as--wallet ID:$ voltage wallets get --wallet WALLET_ID # before: error: required argument <WALLET_ID|--id <ID>>WALLET_IDor--id--wallet IDonlyWALLET_ID A and --wallet B name different wallets, hintPass the wallet once, as WALLET_ID or --wallet.wallets get needs a wallet ID, hint showing both forms andvoltage wallets listOnly an explicit
--walletcounts. A profile's orVOLTAGE_WALLET_ID's wallet never selects the target, so a delete always names its wallet on the command line. Commands that act on something else, such aspayments get, still require their own ID. Because the ID is now optional in clap, the usage line shows[WALLET_ID]; the long help says that--wallet IDnames the wallet.In the CLI benchmark, agents made this call in 3 of 12 CLI runs, and each one cost a retry. Closes #80.
Stack: 4 of 6, on #90. It doesn't depend on the PRs below it.
CHANGELOG.md(Unreleased) anddocs/guides/login-and-profiles.mdare updated.cargo test(258 tests) andcheck-coverage.py.--walletalone, both forms with the same wallet,wallets delete --wallet, differing wallets (message and hint), neither (message and hint), andpayments get --walletstill requiringPAYMENT_ID.13c62f7: 0 functions at or above 20. The highest iswait_for_paymentat 19.60. The target-argument setup moved intotarget_args(2.0), soendpointstays at 18.0;target_idis 3.0.