Skip to content

forge-stream — add test verifying extend_stream() increases remaining tokens and get_stream_status() reflects new end_time #338

@Austinaminu2

Description

@Austinaminu2

Summary

extend_stream() is implemented but there are no tests for it in the current codebase. Given it transfers additional tokens and modifies end_time, it needs comprehensive coverage.

Tasks

  • Create a stream with rate=100, duration=1000 (total=100,000)
  • At t=500 (halfway), extend by 500 additional seconds
  • Assert get_stream().end_time equals original end_time + 500
  • Assert get_stream_status().remaining now reflects the extended total
  • Advance to original end time — verify stream is still active
  • Advance to new end time — verify is_finished = true
  • Verify sender's token balance decreased by additional_seconds * rate at extension time
  • Add tests for: extending a cancelled stream (reverts), extending after end_time (reverts), additional_seconds = 0 (reverts)

Labels: testing, forge-stream

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions