Skip to content

test(stream): add open-ended stream + clawback regression tests (#458) - #495

Open
Abba073 wants to merge 1 commit into
conduit-protocol:mainfrom
Abba073:fix/458-open-ended-clawback-regression-test
Open

test(stream): add open-ended stream + clawback regression tests (#458)#495
Abba073 wants to merge 1 commit into
conduit-protocol:mainfrom
Abba073:fix/458-open-ended-clawback-regression-test

Conversation

@Abba073

@Abba073 Abba073 commented Aug 31, 2026

Copy link
Copy Markdown

Summary

Closes #458.

Adds two regression tests covering the end_time == 0 (open-ended) + clawback interaction, which had no test coverage.

Tests added

Both tests use a manual inline setup (same pattern as initialize_accepts_open_ended_stream) since the Setup helper always sets a bounded end_time.

clawback_open_ended_refunds_unstreamed_remainder

  • Stream: rate = 100 stroops/s, deposit = 10,000, end_time = 0
  • Advances 30 s → 3,000 stroops accrued
  • Asserts clawback returns exactly deposit − accrued = 7,000
  • Asserts sender's wallet grew by 7,000
  • Asserts the 3,000 accrued stroops remain in the contract

clawback_open_ended_does_not_touch_accrued_funds

  • Same setup, advance 50 s → 5,000 stroops accrued
  • Clawback runs (returns unstreamed half)
  • Asserts withdrawable() == 5,000
  • Asserts recipient can withdraw the full 5,000 accrued
  • Asserts withdrawable() == 0 afterwards

What was not changed

No production code was modified. This is a test-only change.

…uit-protocol#458)

Two regression tests covering the interaction between end_time == 0 and
clawback, which had no test coverage:

- clawback_open_ended_refunds_unstreamed_remainder: verifies that
  clawback refunds exactly (deposit - accrued) and leaves the accrued
  balance in the contract for the recipient.

- clawback_open_ended_does_not_touch_accrued_funds: verifies that after
  clawback the recipient can still withdraw every stroop that accrued
  before the clawback, but not a single stroop more.
@Abba073
Abba073 requested a review from Jaydbrown as a code owner August 31, 2026 10:47
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Abba073 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open-ended stream + clawback interaction lacks a regression test

1 participant