Commit 337e113
feat: add LMDB unit tests for BlockchainBackend read methods
Create comprehensive unit tests that exercise LMDB read operations against
a realistic blockchain containing a fork and reorg.
Test chain topology:
Genesis -> B1..B5 -> B6..B10 (original)
\-> F6'..F15' (fork, triggers reorg)
After reorg: canonical = Genesis + B1..B5 + F6'..F15'
Reorged blocks: B6..B10
Tests cover:
- Chain construction and reorg verification
- JSON serialization for reproducibility
- fetch_outputs_in_block / fetch_output / fetch_unspent_output_hash_by_commitment
- fetch_inputs_in_block
- fetch_kernels_in_block / fetch_kernel_by_excess_sig
- fetch_header_containing_kernel_mmr
- fetch_outputs_in_block_with_spend_state
- fetch_mined_info_by_payref
22 test functions organized in write_tests and read_tests modules.
Fixes #7715
Co-Authored-By: Claude Opus 4.6 <[email protected]>1 parent ab95625 commit 337e113
File tree
2 files changed
+873
-0
lines changed- base_layer/core/src/chain_storage/tests
2 files changed
+873
-0
lines changed
0 commit comments