Prettify wallet-cli help; require mnemonic during wallet recovery#1953
Prettify wallet-cli help; require mnemonic during wallet recovery#1953ImplOfAnImpl merged 2 commits intomasterfrom
Conversation
| use wallet_rpc_lib::RpcError; | ||
|
|
||
| #[derive(thiserror::Error, Debug)] | ||
| #[derive(thiserror::Error, derive_more::Debug)] |
There was a problem hiding this comment.
FYI: the standard Debug macro requires N to implement Debug as well, so basically it never works. derive_more::Debug is more clever and puts no requirements on N.
| /// Specifies whether the seed-phrase should be stored in the wallet file or | ||
| /// only printed on the screen. | ||
| /// | ||
| /// Not storing the seed-phrase can be seen as a security measure | ||
| /// to ensure sufficient secrecy in case that seed-phrase is reused | ||
| /// elsewhere if this wallet is compromised. | ||
| whether_to_store_seed_phrase: CliStoreSeedPhrase, |
There was a problem hiding this comment.
FYI: the possible values are still mentioned in the help. E.g. here is how it looks like now:
<WHETHER_TO_STORE_SEED_PHRASE>
Specifies whether the seed-phrase should be stored in the wallet file or only printed on the screen.
Not storing the seed-phrase can be seen as a security measure to ensure sufficient secrecy in case that seed-phrase is reused elsewhere if this wallet is compromised.
[possible values: store-seed-phrase, do-not-store-seed-phrase]
| /// The type of utxos to be listed. | ||
| #[arg(value_enum, default_value_t = CliUtxoTypes::All)] |
There was a problem hiding this comment.
FYI: the default value is still mentioned, here is the new output:
The type of utxos to be listed [default: all] [possible values: all, transfer, lock-then-transfer, create-stake-pool, produce-block-from-stake]
| lazy_static::lazy_static! { | ||
| static ref CUSTOM_RPC_TO_CLI_NAME_MAPPINGS: BTreeMap<&'static str, &'static str> = | ||
| BTreeMap::from([("account_extended_public_key", "account-extended-public-key-as-hex")]); | ||
| } |
There was a problem hiding this comment.
Note: previously this wasn't needed because we allowed one name to be a prefix of the other (due to the usage of zip during comparison). Now we require the names to be identical (except for the separator)
3cafe06 to
5796010
Compare
5796010 to
0293882
Compare
| /// The utxos to pay fees from will be selected automatically; these will be normal, single-sig utxos. | ||
| /// The optional `fee_change_address` specifies the destination for the change for the fee payment; | ||
| /// The optional "fee change address" specifies the destination for the change for the fee payment; | ||
| /// If it's unset, the destination will be taken from one of existing single-sig utxos. |
There was a problem hiding this comment.
not sure how clear single-sig utxos is to most users, maybe something like:
one of the existing UTXOs that require only a single signature (not multisig)
There was a problem hiding this comment.
not sure how clear single-sig utxos is to most users, maybe something like: one of the existing UTXOs that require only a single signature (not multisig)
This is a hidden command for internal use, so I'd leave it as is.
56f6048 to
3eef874
Compare
helpcommand, the docs for individual commands were sometimes separated from each other with an empty line (when the doc was taken from RPC) and sometimes not (when it was generated by clap from the comamnd itself).Now they are always separated by an empty line.
helpcommand; the clap docs only put the first paragraph into "about", and to see the entire doc ("long_about") you need to run "help the_command".Now the docs from RPC also have the "about"/"long_about" parts.
helpcommand, all commands are now sorted by name, except for "help", which comes at the end.Many commands now have a shorter first paragraph (which goes to "about" and which is shown in the output of "help"). So, the output of "help" is now less cluttered, but the user will have to run "help command" or "command --help" to see the full help (btw, "command -h" still prints the short version).
Also,
cargo deny(which we always install on our CI) now requires at least 1.88.