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: Moved --export to a seperate export command #47

Merged
merged 2 commits into from
Sep 23, 2022
Merged

Conversation

kayagokalp
Copy link
Member

closes #43

@kayagokalp kayagokalp self-assigned this Sep 21, 2022
@kayagokalp kayagokalp mentioned this pull request Sep 21, 2022
3 tasks
@kayagokalp kayagokalp requested review from mitchmindtree and a team September 21, 2022 19:16
@kayagokalp kayagokalp marked this pull request as ready for review September 21, 2022 19:16
mitchmindtree
mitchmindtree previously approved these changes Sep 22, 2022
Copy link
Contributor

@mitchmindtree mitchmindtree left a comment

Choose a reason for hiding this comment

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

Looking good! Left an optional suggestion, but not important.

pub(crate) fn export_account(path: Option<String>, account_index: usize) -> Result<()> {
let wallet_path = match &path {
Some(path) => PathBuf::from(path),
None => home::home_dir().unwrap().join(DEFAULT_WALLETS_VAULT_PATH),
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this path gets used quite a bit, perhaps we could have some default_home_wallets_vault_path function for it or similar?

A more idiomatic approach to retrieving the wallet_path might look like:

let wallet_path = path
    .map(PathBuf::from)
    .unwrap_or_else(default_home_wallets_vault_path);

Copy link
Member Author

@kayagokalp kayagokalp Sep 22, 2022

Choose a reason for hiding this comment

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

Yep, this looks much better thanks! Since I have couple of wallet path usage I am thinking of cleaning all of them together with a future PR if that sounds good to you.

Created #49 to track that.

Copy link
Contributor

@eightfilms eightfilms left a comment

Choose a reason for hiding this comment

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

utACK

@kayagokalp kayagokalp merged commit 906565d into master Sep 23, 2022
@kayagokalp kayagokalp deleted the kayagokalp/43 branch September 23, 2022 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Have a separate command for account --export
3 participants