flowfi icon indicating copy to clipboard operation
flowfi copied to clipboard

[Contracts] Add unit tests for cliff_time edge cases (cliff == start_time and cliff == stop_time)

Open blurbeast opened this issue 1 month ago • 7 comments

Overview

In contracts/stream_contract/src/test.rs, cliff vesting is tested for standard midpoint cliffs, but boundary conditions where cliff_time == start_time and cliff_time == stop_time lack dedicated unit tests.

Problem

  • Boundary timestamps in cliff schedules must be verified to ensure 0-second cliffs vest immediately and full-duration cliffs unlock 100% of funds at stop_time.

Proposed Changes

  1. Add two unit tests in contracts/stream_contract/src/test.rs:
    • test_cliff_at_exact_start_time_vests_linearly
    • test_cliff_at_exact_stop_time_unlocks_all_at_end
  2. Verify balance_of and withdraw behavior before, at, and after the boundary timestamps.

Acceptance Criteria

  • [ ] Both boundary unit tests added and passing via cargo test.
  • [ ] Verifies exact vested balances at start_time, midpoint, and stop_time.

blurbeast avatar Oct 18 '26 05:10 blurbeast

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

Hi, I can fix this

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

Muyideen-js avatar Oct 18 '26 12:10 Muyideen-js

@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

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

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]