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

Enable Passphrase for Restore Command #1669

Merged
merged 16 commits into from
Feb 17, 2023
Merged

Enable Passphrase for Restore Command #1669

merged 16 commits into from
Feb 17, 2023

Conversation

Psifour
Copy link
Contributor

@Psifour Psifour commented Feb 11, 2023

Description

Implements an option to pass a passphrase when restoring from mnemonic.

Related Issue

Closes #1671

Motivation and Context

Without this change users are only able to (easily) import a wallet from Sparrow if they did NOT use a passphrase.

How Has This Been Tested?

Default case has been verified to call to_seed() with no passphrase and all single word data passed with the option is verified to replace that. Utilizes the standardized behavior as seen in other sub-commands.

Copy link
Collaborator

@raphjaph raphjaph left a comment

Choose a reason for hiding this comment

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

Good idea!

Would be great to also add this functionality to ord wallet create and write integration tests that both work. Integration tests can be found in tests/wallet/{create, restore}.rs.

src/subcommand/wallet/restore.rs Outdated Show resolved Hide resolved
@Psifour
Copy link
Contributor Author

Psifour commented Feb 14, 2023

I've already done the create command changes, but have not implemented unit tests. Will try to get my work committed tonight or tomorrow on this.

Copy link
Collaborator

@raphjaph raphjaph left a comment

Choose a reason for hiding this comment

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

This looks great!

I'll just wait for @casey to have a glance at this before merging.

rand::thread_rng().fill_bytes(&mut entropy);
#[derive(Debug, Parser)]
pub(crate) struct Create {
#[clap(long, default_value = "", help = "Use <PASSPHRASE> to derive wallet seed.")]
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are using the specific language of BIP 39 here.

tests/wallet/restore.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@raphjaph raphjaph left a comment

Choose a reason for hiding this comment

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

Small changes. Will merge now!

@raphjaph raphjaph enabled auto-merge (squash) February 17, 2023 21:27
@raphjaph raphjaph merged commit 6750136 into ordinals:master Feb 17, 2023
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.

Restore command does not support passphrase
2 participants