Add API for internal addresses#522
Conversation
1546c42 to
63f1ec0
Compare
rajarshimaitra
left a comment
There was a problem hiding this comment.
Concept + tACK 63f1ec0
I think it makes sense and the code looks good to me.
There was a problem hiding this comment.
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.
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. |
notmandatory
left a comment
There was a problem hiding this comment.
Looks good, one small thing to fix in the new test.
| .unwrap(); | ||
|
|
||
| assert_eq!( | ||
| wallet.get_address(AddressIndex::New).unwrap().address, |
There was a problem hiding this comment.
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, |
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 <36541669+rajarshimaitra@users.noreply.github.com>
ecb60c1 to
022256c
Compare
|
Rebased. Should be ready for merge after CI (hopefully) passes. |
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 fmtandcargo clippybefore committingNew Features:
CHANGELOG.md