-
Notifications
You must be signed in to change notification settings - Fork 325
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
Custom spk iterator #927
Custom spk iterator #927
Conversation
@LagginTimes any updates here, this is blocking #894 |
d553f68
to
091b068
Compare
979ecdd
to
b0e7fba
Compare
b0e7fba
to
84a9c15
Compare
I think the next step would be to squash all these commits in this PR into one commit and cherry-pick it onto #894 to see if we can fix #894 (comment). |
005456e
to
b21d369
Compare
b21d369
to
475ca29
Compare
1217917
to
7c3d439
Compare
7c3d439
to
dbfb666
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.
Looking good. I don't think we want new_with_range
.
I think once it's ready we should just merge this. No need to cherry pick. You can make a test checking whether this has done its job by making a dummy trait in a test like trait TestSendStatic: Send + 'static {}
and impl TestSendStatic for SpkIterator<Descriptor<DescriptorPublicKey>> { }
. This will fail to compile if it didn't work.
Put the SpkIterator
into its own spk_iter.mod
file. Put tests for it at the end of the module.
Make sure methods that return an SpkIterator
return it and not an impl Iterator
.
10fb618
to
881df40
Compare
@LLFourn Here is my argument for leaving
For me, this justifies leaving it as is, since it provides a better API. |
cd42bba
to
8b75559
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 8b75559
This looks good to me. I guess the last thing to do is to do the "dummy trait" test as mentioned by @LLFourn: #927 (review).
There is also a small nit.
Also note that I rebased for you (sorry!), so you need to force pull.
I agree.
Do you mean it provides a API internally? Then I suggest we make it a private function and remove the documentation for it. |
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.
Nits aside LGTM
8b75559
to
0a7ab72
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.
We need to make this build with:
$ cargo build --no-default-features -p bdk_chain
To fix this, only include spk_iter
module if cargo feature "miniscript"
is enabled.
Also a nit: move keychain::BIP32_MAX_INDEX
into spk_iter
module.
0a7ab72
to
b604303
Compare
SpkIterator was created with its own nth() and next() implementations and its own new() and new_with_range() constructors. Co-authored-by: 志宇 <[email protected]>
b604303
to
10fe32e
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 10fe32e
PR for #904
What is done:
SpkIterator
withnew
andnew_with_range
constructors, along with its ownnth()
andnext()
implementationsrange_descriptor_spks
with the newSpkIterator::new_with_range
constructornth()
andnext()
functions forSpkIterator
What is in-progress:
@evanlinjin: Discussing the necessity ofCow<>
in this implementation@LagginTimes: Documentation for the new functions