Skip to content

bug: partial_cancel called throughout tests but never implemented in the contract #217

Description

@Austinaminu2

Problem

contracts/streaming/src/test_features.rs (lines 437-610) calls client.partial_cancel(...) extensively, and PartialCancelEvent is fully defined in lib.rs:265-271. However, there is no partial_cancel function anywhere in impl StreamingContract.

This only "works" today because test_features.rs is excluded from the module tree (see the companion issue about that) — if it were included, the crate wouldn't compile.

Impact

Either a shipped feature was silently removed from the contract while its tests/event type were left behind, or a promised feature (partial cancellation of a stream) was never actually finished. Either way, the codebase currently documents/tests a capability that doesn't exist, which is confusing for integrators reading the event types and misleading for anyone trusting the (currently-skipped) test suite.

Suggested fix

Decide whether partial_cancel is in scope:

  • If yes: implement partial_cancel in impl StreamingContract (allow the sender to cancel and reclaim only part of the undeposited/unlocked amount, emitting PartialCancelEvent), matching the behavior the tests in test_features.rs expect.
  • If no: remove PartialCancelEvent and the corresponding tests to avoid dead/misleading code.

Location

  • contracts/streaming/src/test_features.rs:437-610
  • contracts/streaming/src/lib.rs:265-271 (PartialCancelEvent)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26bugSomething isn't workingsmart-contractSoroban smart contract

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions