Repository navigation
test(node): pin that the shutdown redeem sweep applies the configured floor - #2260
Conversation
… floor Build PoolSettlementService with a struct literal in mod tests and drive shutdown against a mocked PaymentPool with one seeded lane. A sub-floor lane issues no getWatermarks read; a lane at the floor reaches the pre-submit reconcile, and an unsettled one reaches redeemMany. The first test fails if final_redeem_sweep passes a zero floor. Closes #2235 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code Coverage OverviewLanguages: Rust Rust / code-coverage/cargo-llvm-covThe overall line coverage in commit 38dc570 in the Show a line coverage summary of the most impacted files.
Updated |
Add a FailingFlushStore and a test that fails if final_redeem_sweep passes strict_flush true. Rename the at-floor reconcile test to match what it checks, assert the send and failure counters directly, queue an explicit send failure, and tighten the test doc comments. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review: approve with nitsThe tests pin the floor. Nits
|
Decision on the review nitsKeep the tests as they are: the at-floor test documents the boundary, and separate tests give clearer failures. Good to merge. |
Summary
PoolSettlementService::shutdown, built against a mockedPaymentPoolprovider with one seeded lane:shutdown_sweep_leaves_a_sub_floor_lane_unread: a lane belowblockchain.redeem_threshold_micro_usdcis planned (decdn_unredeemed_usdcset) but left alone — nogetWatermarksread, so noredeemMany;shutdown_sweep_reconciles_a_lane_at_the_floor: a lane exactly at the floor reaches the pre-submit reconcile; the chain reports it settled, so nothing is sent;shutdown_sweep_submits_redeem_many_for_an_unsettled_lane: an unsettled lane at the floor reachesredeemMany(an explicit queued RPC failure counts one refused send and one redemption failure);shutdown_sweep_redeems_despite_a_failed_flush: with a lane store whoseflushalways fails, the shutdown sweep still sendsredeemMany.final_redeem_sweeppasses aU256::ZEROfloor, which the existing zero-floor mechanics tests cannot catch. The fourth fails if it passesstrict_flush: true, the literal on the same call.Test plan
cargo nextest run -p decdn-node payment_settlement(69 passed; the four new tests stable over 5 repeat runs)U256::ZEROfloor fails only the sub-floor test;strict_flush: truefails only the failed-flush testcargo clippy --workspace --all-targets -- -D warnings,cargo fmt -- --check,RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-itemsCloses #2235
🤖 Generated with Claude Code