Skip to content

integration_test.rs Step 19 (consolidate) threshold too high to exercise consolidate parser #49

@gyorgybalazsi

Description

@gyorgybalazsi

Follow-up from #46 / v0.4.2 verification.

Context

examples/integration_test.rs Step 19 ("Consolidate UTXOs") calls consolidate::check_and_consolidate with a hardcoded threshold (the threshold local; currently 10 UTXOs). The earlier steps in the test never accumulate more than 2-3 UTXOs on the sender party, so this step always skips:

[Step 19/20] Consolidate UTXOs (sender) .............. SKIPPED (2 < 10 threshold)

The consolidate parser in src/consolidate.rs is therefore never exercised end-to-end by this test. It WAS exercised by fixture unit tests added in #46 (parse_consolidate_response), but it'd be nice to also have the live ledger covered.

Proposal

Lower the threshold for the test run — let threshold: usize = 2; would always fire consolidation given the current UTXO count post-transfer-round-trip. Either:

  • Hardcode threshold = 2 in the test (simplest).
  • Read it from an optional env var like CONSOLIDATE_THRESHOLD (defaults to 2) so the test exercises consolidation by default but consumers can opt out.

Affected files

  • examples/integration_test.rs (Step 19 block, around line 768).

Out of scope

Anything in src/consolidate.rs. The library's threshold behavior is fine; only the integration test's chosen threshold is the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceMaintenance, deps, and upgrade work

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions