Repository navigation
feat(stream): support partial cancellation and escrow deadline tests - #291
Merged
techAlhaji merged 3 commits intoOct 24, 2026
Merged
techAlhaji merged 3 commits into
techAlhaji merged 3 commits into
Conversation
|
@Adediwura-dev is attempting to deploy a commit to the techalhaji's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
reduce_streamentry point that partially cancels a stream without terminating it: it lowers the streamed total, immediately refunds the difference, and keeps the reduced amount vesting on the existing schedule/rate.Changes
Partial cancellation (#80)
reduce_stream(stream_id, new_total)toStreamContract.ReductionBelowVested = 20InvalidReduction = 21end_timeproportionally so the stream keeps its current payment rate and already-vested tokens remain vested.old_total - new_totalto the sender immediately.StreamReduced { id, sender, new_total, refunded }event.withdraw;Escrow deadline boundaries (#75)
deadlinesucceeds;deadlinereturnsDeadlineNotReached;refund_escrow, and a second finalization returnsAlreadyFinalized.Test plan
cargo test --manifest-path contracts/Cargo.toml --lib— 99 passed, 0 failed.cargo fmt --manifest-path contracts/Cargo.toml --all -- --check— passed.cargo clippy --manifest-path contracts/Cargo.toml --workspace --lib -- -D warnings— passed.cargo test --manifest-path contracts/Cargo.tomlcommand could not link the local Windows GNUcdylibtargets (export ordinal too large), an environment-specific toolchain limitation; all unit-test targets pass.Closes #75
Closes #80