Add basic tests for AnyChainBlock#10327
Merged
arya2 merged 1 commit intoany-chain-blockfrom Feb 17, 2026
Merged
Conversation
arya2
approved these changes
Feb 17, 2026
mergify bot
pushed a commit
that referenced
this pull request
Feb 17, 2026
…in side chains (#10325) * adds an `AnyChainBlock` state request * Updates changelog * Avoids cloning any extra data in the non-finalized state when handling some state requests that only query the best non-finalized chain (perhaps at the expense of holding read locks slightly longer if the added traversals are worse than the copying, probably insignicant either way but this makes it easier to add fields to NonFinalizedState without worrying) Adds a `cloned_mapped_watch_data()` method on `WatchReceiver`. * Applies docs corrections, renames methods/fns, and unifies implementations for `block` and `any_chain_block` read fns (latter renamed to `any_block()`) * Factors `spawn_blocking()` and `in_scope()` calls into a new trait method. * Update zebra-state/src/request.rs * Add basic tests for `AnyChainBlock` (#10327) generate some tests * Update zebra-state/src/request.rs --------- Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
I generated some basic tests for #10325 to improve test coverage.
Solution
Added two tests:
any_chain_block_test: A basic functionality test using mainnet blocks.any_chain_block_finds_side_chain_blocks: Verifies thatAnyChainBlockcan retrieve blocks from side chains (non-best chains), while the regularBlockrequest cannot.AI Disclosure
PR Checklist