Skip to content

test(stream): add withdraw with zero claimable test#2

Open
devUnixx wants to merge 1 commit into
mainfrom
fix/54-zero-claimable-withdraw-test
Open

test(stream): add withdraw with zero claimable test#2
devUnixx wants to merge 1 commit into
mainfrom
fix/54-zero-claimable-withdraw-test

Conversation

@devUnixx
Copy link
Copy Markdown
Owner

Closes Vera3289#54

Changes

  • Added test_withdraw_zero_claimable_returns_zero in contracts/stream/src/test.rs

What the test covers

  1. Creates a stream and advances the ledger by 100 seconds
  2. First withdraw succeeds and returns 1000 (100s × rate 10)
  3. Second withdraw at the same timestamp returns 0 — no token transfer occurs
  4. Asserts stream state (withdrawn, status) is unchanged after the no-op call

This confirms the contract handles the zero-claimable path gracefully without panicking or issuing a zero-value token transfer.

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.

Add test for withdraw with zero claimable

1 participant