Skip to content

test: add non-empty coverage for SyncResponse and FullScanResponse#2111

Closed
mubashirrao1122 wants to merge 1 commit intobitcoindevkit:masterfrom
mubashirrao1122:test/spk-client-is-empty
Closed

test: add non-empty coverage for SyncResponse and FullScanResponse#2111
mubashirrao1122 wants to merge 1 commit intobitcoindevkit:masterfrom
mubashirrao1122:test/spk-client-is-empty

Conversation

@mubashirrao1122
Copy link
Copy Markdown

This PR adds additional test coverage for SyncResponse::is_empty and
FullScanResponse::is_empty.

It verifies responses are correctly reported as non-empty when:

  • a chain update is present in SyncResponse
  • last_active_indices is populated in FullScanResponse

These tests complement the existing default-empty coverage and help prevent
future regressions.

Tests:

  • cargo test -p bdk_core --test test_spk_client

Copilot AI review requested due to automatic review settings February 3, 2026 07:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds non-empty test coverage for SyncResponse::is_empty and FullScanResponse::is_empty to prevent regressions where meaningful response data could be misclassified as empty.

Changes:

  • Add a test asserting SyncResponse is non-empty when chain_update is set.
  • Add a test asserting FullScanResponse is non-empty when last_active_indices is populated.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mubashirrao1122
Copy link
Copy Markdown
Author

Hi! First contribution here added small tests for is_empty behavior. Happy to adjust anything if needed. Thanks

@evanlinjin
Copy link
Copy Markdown
Member

Thanks for the contribution! These tests primarily exercise the boolean composition in is_empty, which doesn't catch the kinds of bugs we'd worry about.

If you're interested in contributing test coverage, here are some suggestions off the top of my (and @oleonardolima's) head:

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants