-
Notifications
You must be signed in to change notification settings - Fork 75
feat: bump bdk_wallet to 3.1.0 #1030
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
Open
reez
wants to merge
5
commits into
bitcoindevkit:master
Choose a base branch
from
reez:v3.1.0
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+690
−56
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a907ed6
feat: bump bdk_wallet to 3.1.0
reez b5e92a1
feat: expose `Wallet::load_from_two_path_descriptor`
reez 425f673
feat: expose `Wallet::sign_with_signers`
reez 7c3a7db
fix: align foreign utxo validation with upstream
reez 40dbc32
feat: expose Wallet create and load params
reez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ mod esplora; | |
| mod keys; | ||
| mod kyoto; | ||
| mod macros; | ||
| mod signer; | ||
| mod store; | ||
| mod tx_builder; | ||
| mod types; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| use crate::descriptor::Descriptor; | ||
|
|
||
| use bdk_wallet::bitcoin::key::Secp256k1; | ||
| use bdk_wallet::signer::SignersContainer as BdkSignersContainer; | ||
|
|
||
| use std::sync::Arc; | ||
|
|
||
| /// Container for multiple signers. | ||
| #[derive(Debug, uniffi::Object)] | ||
| pub struct SignersContainer { | ||
| pub(crate) inner: BdkSignersContainer, | ||
| } | ||
|
|
||
| #[uniffi::export] | ||
| impl SignersContainer { | ||
| /// Build a new signer container from a descriptor's key map. | ||
| /// | ||
| /// Also looks at the same descriptor to determine the `SignerContext` to attach to the signers. | ||
| #[uniffi::constructor] | ||
| pub fn from_descriptor(descriptor: Arc<Descriptor>) -> Self { | ||
| Self::from_descriptor_with_context(Arc::clone(&descriptor), descriptor) | ||
| } | ||
|
|
||
| /// Build a new signer container from a signer descriptor's key map. | ||
| /// | ||
| /// Also looks at the corresponding descriptor to determine the `SignerContext` to attach to | ||
| /// the signers. | ||
| #[uniffi::constructor] | ||
| pub fn from_descriptor_with_context( | ||
| signer_descriptor: Arc<Descriptor>, | ||
| context_descriptor: Arc<Descriptor>, | ||
| ) -> Self { | ||
| let secp = Secp256k1::new(); | ||
| let inner = BdkSignersContainer::build( | ||
| signer_descriptor.key_map.clone(), | ||
| &context_descriptor.extended_descriptor, | ||
| &secp, | ||
| ); | ||
|
|
||
| Self { inner } | ||
| } | ||
|
|
||
| /// Returns the number of signers in the container. | ||
| pub fn len(&self) -> u64 { | ||
| self.inner.signers().len() as u64 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this length represent? A reminder to myself to look into it. |
||
| } | ||
|
|
||
| /// Returns true when the container has no signers. | ||
| pub fn is_empty(&self) -> bool { | ||
| self.inner.signers().is_empty() | ||
| } | ||
| } | ||
|
|
||
| impl From<BdkSignersContainer> for SignersContainer { | ||
| fn from(inner: BdkSignersContainer) -> Self { | ||
| Self { inner } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to make sure I understand well the use case(s) for this constructor. Can we add a test showcasing this?