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

keys: valid keys when added #1812

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

keys: valid keys when added #1812

wants to merge 3 commits into from

Conversation

leighmcculloch
Copy link
Member

What

Validate secret keys and seed phrases when adding.

Why

Close #1805

@leighmcculloch leighmcculloch marked this pull request as ready for review December 19, 2024 06:03
@leighmcculloch leighmcculloch changed the title keys: add does not validate keys keys: valid keys when added Dec 19, 2024
#[error(transparent)]
Signer(#[from] signer::Error),
}

#[derive(Debug, clap::Args, Clone)]
#[group(skip)]
pub struct Args {
/// Add using `secret_key`
/// (deprecated) Add secret (S) key
Copy link
Member

Choose a reason for hiding this comment

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

Ah so we will just have a secret in the future? If so could we add it here? It seems weird to deprecate without an alternative.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we can accept both as inputs without using any options. Wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

This change seems like it simplifies things!

I wonder if a bit more explanation in the doc comments & deprecations would help to let the user know that they will now be prompted to enter their key/passphrase. I was a bit confused at first how this would work, until I tried it out.

Something like this maybe?

Suggested change
/// (deprecated) Add secret (S) key
/// (deprecated) Enter secret (S) key when prompted

#[error(transparent)]
Signer(#[from] signer::Error),
}

#[derive(Debug, clap::Args, Clone)]
#[group(skip)]
pub struct Args {
/// Add using `secret_key`
/// (deprecated) Add secret (S) key
Copy link
Contributor

Choose a reason for hiding this comment

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

This change seems like it simplifies things!

I wonder if a bit more explanation in the doc comments & deprecations would help to let the user know that they will now be prompted to enter their key/passphrase. I was a bit confused at first how this would work, until I tried it out.

Something like this maybe?

Suggested change
/// (deprecated) Add secret (S) key
/// (deprecated) Enter secret (S) key when prompted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog (Not Ready)
Development

Successfully merging this pull request may close these issues.

keys: add does not validate keys
3 participants