Skip to content

test(chain): cover IndexedTxGraph changeset restoration - #2465

Open
busayo-od wants to merge 1 commit into
bitcoindevkit:masterfrom
busayo-od:test/indexed-tx-graph-apply-changeset
Open

busayo-od wants to merge 1 commit into
bitcoindevkit:masterfrom
busayo-od:test/indexed-tx-graph-apply-changeset

Conversation

@busayo-od

Copy link
Copy Markdown
Contributor

Description

Adds a regression test for IndexedTxGraph::apply_changeset, which had no direct test coverage. The test verifies that restoring from both accumulated changesets and initial_changeset() correctly restores indexer state, indexes full transactions and floating txouts, and matches the original graph.

The deep transaction pays to an index that is only derivable once the shallow one has revealed a lower index. It sorts first in the changeset, so it is only indexed if the indexer state is applied before the transactions. The test asserts this order. Removing any of the three steps in apply_changeset previously passed the test suite; each now fails this test.

Changelog notice

None (test only).

Checklists

All Submissions:

Add coverage for restoring indexer state, full transactions, and
floating txouts through IndexedTxGraph::apply_changeset.
@busayo-od
busayo-od requested a review from a team as a code owner November 10, 2026 18:44
@github-project-automation github-project-automation Bot moved this to Triage in BDK Chain Nov 10, 2026
@codecov

codecov Bot commented Nov 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.70%. Comparing base (02b7b12) to head (c8e9f6e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2465      +/-   ##
==========================================
+ Coverage   83.25%   83.70%   +0.44%     
==========================================
  Files          31       31              
  Lines        6236     6236              
  Branches      293      293              
==========================================
+ Hits         5192     5220      +28     
+ Misses        976      949      -27     
+ Partials       68       67       -1     
Flag Coverage Δ
rust 83.70% <ø> (+0.44%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant