Skip to content
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

wallet import does not list accepted inputs #361

Closed
jsoares opened this issue Nov 6, 2023 · 0 comments
Closed

wallet import does not list accepted inputs #361

jsoares opened this issue Nov 6, 2023 · 0 comments
Labels
bug Something isn't working s:ipc

Comments

@jsoares
Copy link
Contributor

jsoares commented Nov 6, 2023

Issue type

Bug

Have you reproduced the bug with the latest dev version?

Yes

Version

dev

Custom code

No

OS platform and distribution

No response

Describe the issue

Trying to import a wallet without arguments only complains about the missing wallet type:

ubuntu@ip-172-26-4-182:~/ipc$ ./bin/ipc-cli wallet import
error: the following required arguments were not provided:
  --wallet-type <WALLET_TYPE>

Usage: ipc-cli wallet import --wallet-type <WALLET_TYPE>

Adding the wallet type errors

ubuntu@ip-172-26-4-182:~/ipc$ ./bin/ipc-cli wallet import --wallet-type evm
[2023-11-06T13:36:00Z ERROR ipc_cli] main process failed: error processing command Some(Wallet(WalletCommandsArgs { command: Import(WalletImportArgs { wallet_type: "evm", path: None, private_key: None }) })): no private key supported

This is expected as we're not providing the key but we're also not guiding the user as to how to do it.

This seems to stem from the command accepting either a path to the keyfile or a string, both being set as optional in

pub(crate) struct WalletImportArgs {
#[arg(long, short, help = "The type of the wallet, i.e. fvm, evm")]
pub wallet_type: String,
#[arg(long, short, help = "Path of key info file for the key to import")]
pub path: Option<String>,
#[arg(
long,
short,
help = "The evm private key to import if path is not specified"
)]
pub private_key: Option<String>,
}
.

So they appear when --help is added but not by default. They are indeed optional as it stands but we should either default to one or provide appropriate guidance in the usage/error message.

Repro steps

See above.

Relevant log output

No response

@jsoares jsoares added the bug Something isn't working label Nov 6, 2023
@jsoares jsoares closed this as completed Nov 14, 2023
@jsoares jsoares transferred this issue from consensus-shipyard/ipc-libs Dec 19, 2023
@jsoares jsoares added the s:ipc label Dec 19, 2023
@jsoares jsoares closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working s:ipc
Projects
No open projects
Status: Done
Development

No branches or pull requests

1 participant