-
Notifications
You must be signed in to change notification settings - Fork 330
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 API for internal addresses #522
Conversation
1546c42
to
63f1ec0
Compare
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.
Concept + tACK 63f1ec0
I think it makes sense and the code looks good to me.
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.
tACK 63f1ec0
I tested this commit with two wallets:
1 - with internal and external descriptors: worked as expected.
2- with external descriptor only: get_internal_address
returns the same addresses as get_address
.
Maybe if there is not an internal descriptor, a possible better approach would be to throw an error when calling get_internal_address
.
But I think this behavior is not related to this PR. It happens because get_descriptor_for_keychain(keychain)
apparently returns the same descriptor for internal and external keychain when the wallet is created with external descriptor only,
I think the So it makes sense to me to keep the behavior intact in |
bebc89b
to
89f88ce
Compare
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.
ACK 89f88ce
Sorry I missed few others comment nits in last review, of the previous methods.
89f88ce
to
466f46d
Compare
comments addressed ready for further review. |
466f46d
to
8434d58
Compare
I think docs are breaking because of a regression in rust +nightly, there seems to be a bug fix PR in the works so I think we should wait a couple days and see if that fixes it. See #538 |
#538 is merged and fixes the docs issue, once you rebase this PR should be good to go. |
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.
Looks good, one small thing to fix in the new test.
src/wallet/mod.rs
Outdated
.unwrap(); | ||
|
||
assert_eq!( | ||
wallet.get_address(AddressIndex::New).unwrap().address, |
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.
Shouldn't you be verifying that the internal address is the same as the external here?
wallet.get_address(AddressIndex::New).unwrap().address, | |
wallet.get_internal_address(AddressIndex::New).unwrap().address, |
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.
thanks fixed @notmandatory
I think you still need to rebase since this went in, that will fix the rust docs CI job. |
8434d58
to
ecb60c1
Compare
@notmandatory new CI problem. Looks like tokio increased MSRV without major version bump. I think we should set MSRV for bdk to v1.56 (2021 edition) and leave it there. |
I guess we need to revisit and not close #331 .. at this point I agree the best option is set MSRV to rust 1.56, it's not the current stable for Debian.. but is being tested and should be shipped with next stable debian "bookworm" release. https://tracker.debian.org/pkg/rustc |
There are good reasons for applications to need to get internal addresses too. For example creating a transactions that splits an output into several smaller ones.
Co-authored-by: Raj <[email protected]>
ecb60c1
to
022256c
Compare
Rebased. Should be ready for merge after CI (hopefully) passes. |
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.
ACK 022256c
Requested changes look to be resolved.
There are good reasons for applications to need to get internal
addresses too. For example creating a transactions that splits an output
into several smaller ones.
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
CHANGELOG.md