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

Make all wallet commands load wallet #1524

Merged
merged 9 commits into from
Feb 7, 2023

Conversation

raphjaph
Copy link
Collaborator

@raphjaph raphjaph commented Feb 6, 2023

No description provided.

@raphjaph raphjaph requested a review from casey February 6, 2023 17:23
@casey
Copy link
Collaborator

casey commented Feb 6, 2023

Let's add a Wallet struct that can only be constructed by loading the wallet:

struct Wallet {
  foo: (),
}

impl Wallet {
  fn load(options: &Options) -> Result<Self> {
    options.bitcoin_rpc_client_for_wallet_command(false)?;

    Ok(Self)
  }
}

Copy link
Collaborator

@casey casey left a comment

Choose a reason for hiding this comment

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

see comment

@raphjaph raphjaph marked this pull request as draft February 6, 2023 23:01
@raphjaph raphjaph requested a review from casey February 7, 2023 21:45
@raphjaph raphjaph marked this pull request as ready for review February 7, 2023 21:45
Copy link
Collaborator

@casey casey left a comment

Choose a reason for hiding this comment

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

PR reviewed in the salt mines

@raphjaph raphjaph requested a review from casey February 7, 2023 22:37
tests/lib.rs Outdated
@@ -63,10 +63,19 @@ struct Create {
mnemonic: Mnemonic,
}

fn create_wallet(rpc_server: &test_bitcoincore_rpc::Handle) {
CommandBuilder::new(format!("--chain {} wallet create", rpc_server.network()))
fn create_wallet(rpc_server: &test_bitcoincore_rpc::Handle, wallet_name: Option<String>) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we always use the name ord? Is the old test actually testing anything? If not, it can be removed.

Copy link
Collaborator

@casey casey left a comment

Choose a reason for hiding this comment

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

Minor nits, see comments.

@raphjaph raphjaph requested a review from casey February 7, 2023 23:15
Copy link
Collaborator

@casey casey left a comment

Choose a reason for hiding this comment

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

Excellent!

@casey casey enabled auto-merge (squash) February 7, 2023 23:22
@casey casey merged commit a9f9e70 into ordinals:master Feb 7, 2023
@raphjaph raphjaph deleted the load-wallet-fixes branch May 1, 2023 18:39
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.

2 participants