Repository navigation
Fix: 4 issues (#226, #238, #239, #242) - #301
Merged
techisigu merged 1 commit intoOct 24, 2026
Merged
Conversation
Co-authored-by: Simple Agent <agent@simple.dev>
|
@chideraisiguzor 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 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 #226
Closes #238
Closes #239
Closes #242
Issues
#226 Enforce Workspace-Wide cargo fmt and Clippy in CI
#238 Implement the
paramsCrate: On-Chain Protocol Parameter Registry#239 Implement
lp_poolEpoch Deposit/Withdrawal Queues and Share-Price Accounting#242 Implement
streamsStream Recipient Transfer and AssignmentSummary
Land the CI lint job first so subsequent PRs are checked; it may start advisory-only (continue-on-error) and be flipped to blocking once the workspace compiles cleanly, with the flap documented in the workflow file. For params, keep the existing bounds/migration machinery intact and add the namespaced registry alongside it; use item-level #[allow] with tracked follow-ups for any macro-generated lint in contract crates, never crate-level allows. For lp_pool, the existing scaffolding already has most storage/types/events; focus on wiring the entrypoints and share-price math, and ensure the integration test exercises options_market and vault. For streams, the existing
transferentrypoint is recipient-only; addtransfer_recipientwith dual auth and reindexing, and document the self-transfer decision.Changes
lintjob (or fix the existing fmt/clippy jobs) that runscargo fmt --all -- --checkandcargo clippy --workspace --all-targets -- -D warningsas two distinct steps, on every pull request and on pushes to main. Pin the toolchain to the same version used by the other jobs (dtolnay/rust-toolchain@stable with rustfmt and clippy components plus wasm32-unknown-unknown target), use Swatinem/rust-cache, and runcargo xtask check-importsbefore clippy if cross-contract wasm is required. Document in a comment block at the top of the job that it may land advisory-only (continue-on-error: true) while stub-heavy crates are being reconstructed, and that flipping to blocking is done by removing that flag — make the flap explicit and documented. Any pre-existing lint that cannot be fixed must be captured as a narrowly scoped, commented#[allow(...)]with a tracked follow-up, never a workspace-wide allow. Also clean up the duplicated/malformed job blocks currently in the file (the truncatedcrate:matrix line, the duplicatedwasm/testjobs) so the workflow is valid YAML. (.github/workflows/ci.yml)paramscrate as a typed, namespaced on-chain parameter registry. Addset_value,get_value,remove_value, and a paginatedlist_namespacesupporting at leastu32,i64,bool, andAddressvalues. Encode namespace, key, and a type tag into a single storage key so au32and ani64under the same name cannot collide; store values in a small typed enum rather than untyped bytes. Gate writes throughcommon::require_admin_or_multisig(admin/multisig auth), keep reads permissionless, and support an explicit default on getters so consumers can fall back when a parameter is unset. Fail closed with a specific error code on type mismatch (never silently coerce), handle removing an unset key, page namespace listings, and extend TTL on long-lived parameter entries. Emit an event per set/remove carrying namespace, key, and old/new value. Add unit tests per value type for set/get/remove round-trips, namespace isolation, type-mismatch rejection, default fallback, and a negative test that a non-admin cannot write. (params/src/lib.rs)params/src/types.rswith the typed value enum (ParamValuecoveringU32(u32),I64(i64),Bool(bool),Address(Address)), a namespaced key type combining namespaceSymbol, keySymbol, and a type tag, and the newDataKeyvariants needed for the registry (namespaced value entries and per-namespace index entries for paginated listing). Keep the existingParam/BoundsProposaltypes intact so the current bounds machinery still compiles. (params/src/types.rs)TypeMismatch), key not found where required, invalid namespace/key, and invalid pagination cursor/limit. Keep existing codes stable and append new ones. (params/src/error.rs)value_setevent carrying namespace, key, and old/new value, and avalue_removedevent carrying namespace, key, and the removed value. Keep existing param/bounds events unchanged. (params/src/events.rs)params/src/test.rs: set/get/remove round-trips for each value type (u32,i64,bool,Address), namespace isolation (a caller cannot read/write another namespace's key), type-mismatch rejection with the specific error, default fallback when a parameter is unset, paginatedlist_namespace, and a negative test that a non-admin cannot write. (params/src/test.rs)lp_poolcontract entrypoints:request_deposit,request_withdraw,process_epoch(epoch finalization),claim, and read-onlyshare_price/pending_*views. Deposits and withdrawals requested during an epoch are only priced at the next finalized epoch. Mint/burn shares through the pinnedlp_token(pool is the only minter). Deploy pooled capital as option collateral throughoptions_market's writer flow, accounted against the correspondingvaulttag so pool funds are never commingled with individual writers' collateral. Prevent withdrawals from being filled from collateral still locked against a live series. Compute share price at finalization from total assets minus locked collateral over total shares (never from the raw token balance). Emit events for deposit request, withdraw request, epoch finalization, and claim. Handle first epoch with zero shares, epochs where locked collateral exceeds withdrawable assets, claims after several epochs, rounding dust on share burn, and re-requesting in the same epoch. (lp_pool/src/lib.rs)lp_poolqueue lifecycle and share-price math including rounding, plus an integration test withoptions_marketandvaultshowing a pool-written series blocking a withdrawal until settlement. Cover first-epoch zero shares, locked collateral exceeding withdrawable assets, multi-epoch claims, dust on share burn, and same-epoch re-requests. (lp_pool/src/test.rs)docs/lp_pool.mdto document the implemented entrypoints (request_deposit,request_withdraw,process_epoch,claim,share_price,pending_*views), the epoch pricing rule, the share-price formula based on total assets minus locked collateral over total shares, the lp_token mint/burn flow, and how pool capital is deployed throughoptions_marketand tagged invaultso it is never commingled with individual writers' collateral. (docs/lp_pool.md)transfer_recipient(stream_id, new_recipient)entrypoint to thestreamscontract. Require authorization from both the current recipient and the new recipient. Leave the stream's sender, token, amount, and schedule unchanged; a sender cannot unilaterally reassign a recipient. Amounts already withdrawable at transfer time stay claimable by the new recipient (schedule untouched), and the previously withdrawable amount is checkpointed in the event for auditability. Reindex the stream under the new recipient atomically (update any per-recipient list if present). Fail with distinct errors for non-existent streams and completed/canceled streams. Emit an event with stream id, old recipient, new recipient, and withdrawable amount at transfer time. Decide and document behavior for transferring to the current recipient (no-op or explicit rejection). (streams/src/lib.rs)transfer_recipient: a distinct error for a completed/canceled stream (reuseStreamCanceledif appropriate) and any error for self-transfer if that path is rejected. Keep existing codes stable. (streams/src/error.rs)recipient_transferredevent helper carrying stream id, old recipient, new recipient, and the withdrawable amount at transfer time. Keep the existingtransferredevent for backward compatibility or replace it consistently with the new entrypoint. (streams/src/events.rs)transfer_recipient: happy path with both auths present, negative tests where only one of the two signatures is provided, where the stream does not exist, and where the stream is complete/canceled. Also test that the old recipient cannot withdraw after the transfer in the same ledger and that the withdrawable amount is checkpointed in the event. (streams/src/test.rs)