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

refactor(chain)!: remove inner method from KeychainTxOutIndex #1652

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ValuedMammal
Copy link
Contributor

Fix #1353 by removing the inner method from keychain_txout module. See commit message for details.

Changelog notice

  • bdk_chain: Removed method KeychainTxOutIndex::inner

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing
  • This pull request breaks the existing API
  • I'm linking the issue being fixed by this PR

Comment on lines 174 to 175
txout_index.spk_at_index(TestKeychain::External, i),
Some(spk_at_index(&external_descriptor, i))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still might need another pass to fully grasp the tests, but shouldn't this be asserting for the TestKeychain::Internal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, fixed

It's desirable to have the inner SPK index internal to the
`keychain_txout` module, which aims to provide views into
the set of revealed SPKs for a given keychain.

The inner index also functions as a cache of unrevealed SPKs,
i.e. the lookahead. We test the functionality of the lookahead
by checking the value returned from
`KeychainTxOutIndex::spk_at_index` matches the SPK derived by
the descriptor at that index for indices ranging from the
last revealed to the expected last stored.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

Expand the KeychainTxOutIndex::inner docs to provide usage examples
2 participants