Repository navigation
docs: correct admin transfer, pausing and error tables - #322
Merged
Merged
Conversation
Add table-driven coverage for the stream status state machine. closes StreamGive#305 closes StreamGive#304 closes StreamGive#303 closes StreamGive#301
|
@thegreatfeez Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This was referenced Oct 17, 2026
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.
closes #305,
closes #304,
closes #303,
closes #301.
All four items from
issues.mdwere implemented instreamgive-contracts.The README now describes the shared admin handshake for both contracts, lists
every entry point's paused behaviour, and regenerates both error tables from
the actual
Errorenums. The donation vault gains a table-driven test for thewhole
StreamStatusmachine.issues.mditem#305 — Admin transfer, both contracts
behaviour in the code: the current admin proposes and cancels; the
pending admin accepts. The active admin is unchanged until acceptance.
ngo-registry, which had been omitted.donation-vaulthasrenounce_admin; the registry does not.#304 — Pausing section
flag” without consequence. The pause call itself still moves no funds, but it
changes which entry points are accepted.
rejected paths (
create_stream,withdraw,withdraw_batch,top_up,modify_rate,transfer_stream), paths that stay open (cancel_stream,unpause,renounce_admin,extend_stream), pause-onlyrescue_stream,the admin/configuration surface, and all read-only views.
paused and is claimable after unpause.
#303 — Error tables
contracts/*/src/lib.rsrather than copying thestale rows.
that can surface each one (including errors raised through
require_admin,require_not_paused, andsettle/record_payout).InvalidAdmin,ArithmeticOverflowandInvalidName, and the full list of paths that canreturn
AlreadyVerified(unregister,update_name,approve_ngo).InvalidTreasury/SelfStreamassignments.#301 — Stream status state machine
stream_status_state_machine_walks_each_transition, a table-driventest that creates a fresh stream and walks each case, asserting the stored
status after every call:
cancelling_a_drained_stream_makes_it_terminal, which checks theDrained → Cancelled transition and that
withdraw,top_up,modify_rateand
transfer_streamall treat the cancelled stream as terminal.stream's stored status. See the judgement call below.
Verification
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspacecargo doc --workspace --no-depswithRUSTDOCFLAGS=-D warningscargo build --workspace --target wasm32v1-none --releasebash scripts/check-wasm-size.shJudgement calls
transition, but the current contract deliberately does not recompute
statuson
top_up; the existing test from Add tests for modify_rate and top_up on a drained stream #298/test: pin Stream layout and cover depletion, fee TTL, drained streams #321 asserts it remainsDrained.This is a test-only issue, so the new state-machine test asserts the actual
behaviour and keeps the prior contract semantics. Changing the contract would
be a separate behavioural fix.
rescue_stream(README Pausing section is garbled and out of date #304). It is listed separately because it is theone entry point that requires the vault to be paused;
cancel_streamis openduring a pause, and the admin/config surface is not gated by pause at all.
cargo clippy -- -D warningscommand wasalready red on
mainfrom unused imports/borrows and an unused loopvariable. Those warning-only fixes are included so the PR's required checks
can pass; no behaviour changed.
bash associative arrays, which macOS's system bash 3.2 cannot run; the CI
runner uses bash 5, so the check remains unchanged.