Skip to content
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

KeychainTxOutIndex method should behave consistently when non-existent keychains are passed in as arguments #1340

Open
danielabrozzoni opened this issue Feb 12, 2024 · 2 comments
Labels
api A breaking API change module-blockchain

Comments

@danielabrozzoni
Copy link
Member

Some KeychainTxOutIndex methods panic if a non-existent keychain is passed in as an argument. Some examples include:

  • unbounded_spk_iter
  • next_index

Instead, the methods that return an iterator simply return an empty one. Some examples are:

  • keychain_outpoints
  • unused_keychain_spks

I think we should be consistent, and either panic everywhere, or return a Result/Option everywhere. I personally don't like returning empty iterators, as the mistake of passing a non-existent keychain might be overlooked.

More discussion here: #1203 (comment)

@collins-okafor
Copy link

Can I work on this? Although I will need some briefing

@LLFourn
Copy link
Contributor

LLFourn commented Apr 5, 2024

starting work on this will need to wait until #1203 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api A breaking API change module-blockchain
Projects
Status: Todo
Development

No branches or pull requests

4 participants