Skip to content

Add tests for remaining pause/resume edge cases #365

@ogazboiz

Description

@ogazboiz

Join our community: https://t.me/+DOylgFv1jyJlNzM0

Description

The contract test suite has 6 pause/resume tests but several important edge cases are still missing that could hide bugs in pause-time accounting.

Missing Test Cases

  • test_withdraw_while_paused_claims_only_pre_pause_accrual — withdraw during pause gets only elapsed-before-pause tokens
  • test_multiple_pause_resume_cycles_accumulate_correctly — total accrual after 3 pause/resume cycles equals sum of active periods
  • test_cancel_while_paused_refunds_correctly — cancel on a paused stream refunds unstreamed portion
  • test_top_up_while_paused_extends_stream — top-up while paused should extend end_time correctly
  • test_pause_at_stream_end_time_fails — cannot pause a stream that has already expired

Files

  • contracts/stream_contract/src/test.rs

Acceptance Criteria

  • All 5 tests pass
  • cargo test clean
  • No existing tests broken

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programsmart-contractSoroban smart contracttestingTesting related tasks

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