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

feat(cast): wallet keystore decrypting #7893

Merged
merged 3 commits into from
May 14, 2024

Conversation

rplusq
Copy link
Contributor

@rplusq rplusq commented May 8, 2024

Motivation

After integrating cast wallet import and using it for a while, some users might want to get the private key for an account back through decryption of the keystone, so we're just making it easy for them in the same cli they created the keystore.

Solution

Added an extra command DecryptKeystore to the WalletSubcommands enum, alongside the implementation where we verify the file exists, prompt for the password (they can also send it in clear text from the cli call if they wish to), decrypt the keystore to instantiate a LocalWallet and then make it an alloy B256 so it formats properly in the print.

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

supportive, could we can a casttest! for this as well?
ideally run both commands in sequence

@rplusq rplusq force-pushed the feat(cast)/wallet-decrypt-keystore branch from 2cba6a3 to 0a65341 Compare May 8, 2024 15:37
@rplusq rplusq requested a review from mattsse May 8, 2024 15:37
@rplusq
Copy link
Contributor Author

rplusq commented May 8, 2024

Fixing clippy failing...

@rplusq rplusq force-pushed the feat(cast)/wallet-decrypt-keystore branch from 0a65341 to f4ef8ec Compare May 8, 2024 22:25
@rplusq
Copy link
Contributor Author

rplusq commented May 8, 2024

Ready for review @mattsse

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm, pending doc nit

@rplusq
Copy link
Contributor Author

rplusq commented May 14, 2024

Fixed @Evalir

@rplusq rplusq requested a review from Evalir May 14, 2024 11:40
@mattsse mattsse merged commit 781acf0 into foundry-rs:master May 14, 2024
19 checks passed
@rplusq rplusq deleted the feat(cast)/wallet-decrypt-keystore branch May 14, 2024 18:40
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.

None yet

3 participants