Skip to content

Group up Software and Trezor args in separate subcommands#1907

Merged
OBorce merged 1 commit into
masterfrom
feature/wallet-cli-trezor-commands
May 21, 2025
Merged

Group up Software and Trezor args in separate subcommands#1907
OBorce merged 1 commit into
masterfrom
feature/wallet-cli-trezor-commands

Conversation

@OBorce

@OBorce OBorce commented Apr 11, 2025

Copy link
Copy Markdown
Contributor
  • CLI commands Create, Recover and Open wallet are now grouped up into subcommands for Software vs Trezor

@OBorce OBorce force-pushed the feature/wallet-cli-trezor-commands branch 2 times, most recently from 9c3f541 to 4a31c9a Compare April 12, 2025 16:12
@OBorce OBorce mentioned this pull request Apr 14, 2025
@OBorce OBorce force-pushed the feature/trezor-recconect branch from 844ee5b to 37def6a Compare April 14, 2025 14:53
@OBorce OBorce force-pushed the feature/wallet-cli-trezor-commands branch from 4a31c9a to 5921893 Compare April 14, 2025 15:04
Base automatically changed from feature/trezor-recconect to master April 21, 2025 08:47
Comment thread wallet/wallet-cli-commands/src/command_handler/mod.rs Outdated
Comment thread wallet/wallet-cli-commands/src/lib.rs
Comment on lines +288 to +304
let wallet = match args.hardware_wallet {
None => OpenWalletSubCommand::Software {
wallet_path,
encryption_password: args.wallet_password,
force_change_wallet_type: args.force_change_wallet_type,
},
Some(hw) => match hw {
#[cfg(feature = "trezor")]
wallet_rpc_lib::cmdline::CliHardwareWalletType::Trezor => {
OpenWalletSubCommand::Trezor {
wallet_path,
device_id: None,
}
}
},
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. A "hardware" wallet file can still be encrypted. Not sure how useful this feature is, but we still have it.
  2. The "wallet_password" option can still be specified when opening a HW wallet file, but now it will be silently ignored, which is not good.

I suggest putting encryption_password into OpenWalletSubCommand::Trezor too.

Later we can decide whether encrypting a HW wallet file makes sense, but if it doesn't, we should remove this feature globally (e.g. in GUI too).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added, forgot that the standalone private keys are also encrypted.

Comment thread wallet/wallet-cli-commands/src/lib.rs Outdated
Comment thread wallet/wallet-cli-commands/src/lib.rs Outdated
CreateWallet {
#[derive(Debug, Subcommand, Clone)]
pub enum CreateWalletSubCommand {
/// Create a software wallet

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the "recover" case this looks a bit off, same for the Trezor case below.

E.g. wallet-recover --help currently prints "Recover new wallet, this will rescan the blockchain upon creation". And then it prints

Commands:
  software  Create a software wallet

"Create" looks strange here IMO.

I guess we should at least fix the "Recover new wallet" part (which sounds strange on its own). E.g. "Recover a previously existing wallet. This will create a new wallet file and rescan the blockchain upon creation.". This way "Create" may refer to the creation of the wallet file, so it should sound ok-ish.

But wallet-recover software --help also prints "Create a software wallet" and in this case no additional info is printed and "Create" still sounds off.

So I'm wondering whether we need a separate RecoverWalletSubCommand with the same contents but different doc strings. (Or may be I'm overthinking this)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

split up Create and Recover into 2 types with different comments

@OBorce OBorce force-pushed the feature/wallet-cli-trezor-commands branch from 5921893 to 32f5d6e Compare May 5, 2025 19:46
@OBorce OBorce merged commit 55a3841 into master May 21, 2025
18 checks passed
@OBorce OBorce deleted the feature/wallet-cli-trezor-commands branch May 21, 2025 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants