Skip to content

Add basic tests for AnyChainBlock#10327

Merged
arya2 merged 1 commit intoany-chain-blockfrom
any-chain-block-test
Feb 17, 2026
Merged

Add basic tests for AnyChainBlock#10327
arya2 merged 1 commit intoany-chain-blockfrom
any-chain-block-test

Conversation

@oxarbitrage
Copy link
Contributor

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 that AnyChainBlock can retrieve blocks from side chains (non-best chains), while the regular Block request cannot.

AI Disclosure

  • No AI tools were used in this PR
  • AI tools were used: GitHub Copilot assisted with test generation

PR Checklist

  • The PR name is suitable for the release notes.
  • The PR follows the contribution guidelines.
  • This change was discussed in an issue or with the team beforehand.
  • The solution is tested.
  • The documentation and changelogs are up to date.

@arya2 arya2 merged commit 5af85e5 into any-chain-block Feb 17, 2026
16 checks passed
@arya2 arya2 deleted the any-chain-block-test branch February 17, 2026 19:27
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants