-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(cast): wallet new - enable default keystore #9201
base: master
Are you sure you want to change the base?
feat(cast): wallet new - enable default keystore #9201
Conversation
Hi @kien6034 thanks for your PR, a few notes |
31537dc
to
f28f6af
Compare
Hi @zerosnacks , i updated code and writing tests following your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update! Some small notes, tests look good 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kien6034, looks great
Pending another review cc @grandizzy / @yash-atreya
@grandizzy @yash-atreya can you help me review this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a comment re newly introduced default_keystore
, @zerosnacks pls chime in. thanks!
crates/cast/bin/cmd/wallet/mod.rs
Outdated
@@ -53,6 +53,10 @@ pub enum WalletSubcommands { | |||
/// Output generated wallets as JSON. | |||
#[arg(long, short, default_value = "false")] | |||
json: bool, | |||
|
|||
/// Use default keystore location (~/.foundry/keystores). | |||
#[arg(long, short, conflicts_with = "path", default_value = "false")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I get it right, the default keystore is used if no path
provided but only with unsafe_password
option (any reason why this is not available for password
too?).
If so, do we want to make this explicit by adding the new default_keystore
arg or can we just use default keystore if path
is None?
That is the
} else if default_keystore {
below to be
} else if unsafe_password {
@zerosnacks wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the removal of requires = "path
should allow it to use the default path, not place a conditional on it
I would prefer making the default path implicit as well over having a new flag be introduced
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zerosnacks @grandizzy tks for reviewing
so as my understanding, we should use default_key_store
when path
is none + unsafe password
or password
is provided.
if password
fields not provided, we just printout the keys for user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, a keystore implies having a password whereas a keypair does not
@zerosnacks updated sir |
@zerosnacks @grandizzy hello sirs, can you help me finalize this pr? |
Close #9166
Motivation
Solution
-default-keystore
to allow user to generate wallet if no path is given