flowfi icon indicating copy to clipboard operation
flowfi copied to clipboard

[Contracts] Add is_active, is_paused, and is_completed helper methods on Stream struct

Open blurbeast opened this issue 1 month ago • 7 comments

Overview

In contracts/stream_contract/src/types.rs and contracts/stream_contract/src/lib.rs, contract functions repeatedly match or compare stream.status == StreamStatus::Active across multiple entrypoints.

Problem

  • Direct enum comparisons scattered throughout lib.rs make status transition checks verbose and harder to read.

Proposed Changes

  1. Implement #[inline] helper methods on Stream in contracts/stream_contract/src/types.rs:
    • pub fn is_active(&self) -> bool
    • pub fn is_paused(&self) -> bool
    • pub fn is_cancelled(&self) -> bool
    • pub fn is_completed(&self) -> bool
  2. Replace repetitive stream.status == ... checks in lib.rs with these helper methods.

Acceptance Criteria

  • [ ] Helper methods implemented on Stream in types.rs.
  • [ ] Used consistently across lib.rs.
  • [ ] cargo test passes with zero compiler warnings.

blurbeast avatar Oct 18 '26 05:10 blurbeast

@innocentharuna has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

hey maintainer, please kindly assign this to me, i can surely fix it

ℹ️ Repo Maintainers: To accept this application, review their application or assign @innocentharuna to this issue.

innocentharuna avatar Oct 18 '26 12:10 innocentharuna

@furqan005 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Hello, Furqan here. I’ve reviewed the task and am ready to begin immediately, with a focus on delivering a clean and maintainable solution.

ℹ️ Repo Maintainers: To accept this application, review their application or assign @furqan005 to this issue.

furqan005 avatar Oct 18 '26 12:10 furqan005

@Alosnireda has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Kindly assign to me

ℹ️ Repo Maintainers: To accept this application, review their application or assign @Alosnireda to this issue.

Alosnireda avatar Oct 18 '26 12:10 Alosnireda

@VeronicDev has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Hello Maintainer, I can fix this please assign.

ℹ️ Repo Maintainers: To accept this application, review their application or assign @VeronicDev to this issue.

VeronicDev avatar Oct 18 '26 12:10 VeronicDev

@CollinsKRO has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

Hi Maintainer, I can fix this pls assign. ETA 5hrs

ℹ️ Repo Maintainers: To accept this application, review their application or assign @CollinsKRO to this issue.

CollinsKRO avatar Oct 18 '26 12:10 CollinsKRO

Congratulations, @Alosnireda! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

🧑‍💻 @Alosnireda: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

🌊 Happy Wave 🌊

drips-wave[bot] avatar Oct 18 '26 12:10 drips-wave[bot]

This issue has been completed by @Alosnireda as part of the Stellar Wave Program's 10th Wave 🥳

😎 @Alosnireda: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

drips-wave[bot] avatar Oct 18 '26 18:10 drips-wave[bot]