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
LLFourn
left a comment
There was a problem hiding this comment.
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.
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. |
8b75559 to
0a7ab72
Compare
evanlinjin
left a comment
There was a problem hiding this comment.
We need to make this build with:
$ cargo build --no-default-features -p bdk_chainTo 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: 志宇 <hello@evanlinjin.me>
b604303 to
10fe32e
Compare
PR for #904
What is done:
SpkIteratorwithnewandnew_with_rangeconstructors, along with its ownnth()andnext()implementationsrange_descriptor_spkswith the newSpkIterator::new_with_rangeconstructornth()andnext()functions forSpkIteratorWhat is in-progress:
@evanlinjin: Discussing the necessity ofCow<>in this implementation@LagginTimes: Documentation for the new functions