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

Add --save-path Option to VanityArgs for Custom Wallet File Saving #6475

Merged
merged 9 commits into from
Dec 1, 2023

Conversation

codeesura
Copy link
Contributor

Motivation

The current implementation of the cast wallet vanity generation tool (VanityArgs struct) lacks the flexibility of specifying a custom file path for saving generated wallet details. Users who need to organize their wallet information in specific directories, or those managing multiple wallets, are currently limited to the tool's default behavior of saving these details in the current working directory. This limitation can be inconvenient for users who require more control over where their wallet details are stored.

Solution

This PR introduces the save_path option to the VanityArgs struct, providing users the ability to specify a custom path for saving their wallet details. The implementation updates the run method within the VanityArgs struct to handle the logic for saving the wallet details at the user-specified path. If no path is specified, the wallet details will be saved in the current working directory, maintaining the existing default behavior.

image

Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

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

Sounds good

crates/cast/bin/cmd/wallet/vanity.rs Outdated Show resolved Hide resolved
crates/cast/bin/cmd/wallet/vanity.rs Outdated Show resolved Hide resolved
crates/cast/bin/cmd/wallet/vanity.rs Outdated Show resolved Hide resolved
crates/cast/bin/cmd/wallet/vanity.rs Outdated Show resolved Hide resolved
@codeesura codeesura requested a review from DaniPopes November 30, 2023 23:29
@DaniPopes
Copy link
Member

You need to format with nightly cargo +nightly fmt

@codeesura
Copy link
Contributor Author

You need to format with nightly cargo +nightly fmt

Thank you very much for your assistance and guidance! I successfully formatted my code using the cargo +nightly fmt command, and now everything conforms to the project's formatting standards. Your support throughout this process has been invaluable.

@DaniPopes
Copy link
Member

Updated test and made the option write directly to the given path rather than appending a file name to it

Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

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

Thanks

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.

reasonable

@DaniPopes DaniPopes merged commit ef5ad0c into foundry-rs:master Dec 1, 2023
19 checks passed
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