Join the discussion on Telegram
Why this matters
The on-chain withdraw and cancel_stream flows differ in an important way that is not directly tested: cancel_stream (contracts/stream_contract/src/lib.rs) settles the recipient's accrued amount even when the stream is paused, whereas withdraw explicitly rejects when stream.paused is true. Today the contract test suite covers pause stopping accrual (test_pause_stops_accrual) and resume adjusting end time, but there is no test that cancels a currently-paused stream and asserts the settlement/refund split is computed from paused_at (frozen accrual) rather than now. This is exactly the kind of edge case where a regression would silently misallocate user funds.
Acceptance criteria
Files to touch
contracts/stream_contract/src/test.rs
Out of scope
- Property-based / fuzz invariants (covered by existing open issues).
- Changing contract behavior.
Join the discussion on Telegram
Why this matters
The on-chain
withdrawandcancel_streamflows differ in an important way that is not directly tested:cancel_stream(contracts/stream_contract/src/lib.rs) settles the recipient's accrued amount even when the stream is paused, whereaswithdrawexplicitly rejects whenstream.pausedis true. Today the contract test suite covers pause stopping accrual (test_pause_stops_accrual) and resume adjusting end time, but there is no test that cancels a currently-paused stream and asserts the settlement/refund split is computed frompaused_at(frozen accrual) rather thannow. This is exactly the kind of edge case where a regression would silently misallocate user funds.Acceptance criteria
contracts/stream_contract/src/test.rsthat: creates a stream, advances time, pauses it, advances time further while paused, then cancels — and asserts the recipient receives only the amount accrued up topaused_atand the sender is refunded the rest.withdrawon a paused stream returnsStreamInactive(locking in current behavior).Files to touch
contracts/stream_contract/src/test.rsOut of scope