feat: add revenue_distributor tests, yield reentrancy fix, backend clean script, SEP-12 upload auth#685
Open
Damola09 wants to merge 2 commits into
Conversation
…laboratory#563 ceejaylaboratory#569 (closes ceejaylaboratory#542, closes ceejaylaboratory#554, closes ceejaylaboratory#563, closes ceejaylaboratory#569) - feat(revenue-distributor): add unit tests for distribution weights, zero balance no-op, full gov share, zero gov share, invalid bps panics, and set_shares re-distribution (ceejaylaboratory#569) - feat(yield-contract): apply CEI pattern to deposit_rewards and stake so state updates precede external token transfers; remove duplicate event publish syntax errors (ceejaylaboratory#563) - feat(devops): add clean script to backend/package.json that deletes SQLite journal files and removes logs/coverage directories (ceejaylaboratory#542) - feat(backend-sep12): add confirmUpload endpoint that verifies session account matches KycCustomer record account, returns 403 on mismatch (ceejaylaboratory#554)
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
feat(revenue-distributor): Added unit tests covering distribution weights (60/40, 30/70, 100/0, 0/100), zero-balance no-op, invalid BPS panics on bothinitializeandset_shares, and post-set_sharesredistribution.feat(yield-contract): Applied CEI (Checks-Effects-Interactions) pattern todeposit_rewardsandstake— state is now updated before external token transfers. Also removed stray duplicate.publish()syntax errors indeposit_rewardsandclaim.feat(devops): Addedcleannpm script tobackend/package.jsonthat removes SQLite journal files (.db-journal,.db-wal,.db-shm) and wipeslogs/andcoverage/directories.feat(backend-sep12): AddedPOST /sep12/customer/:id/confirmendpoint (behindauthMiddleware) that verifies the session account matches theKycCustomerrecord account and returns403 Forbiddenon mismatch. Added corresponding unit tests.Test plan
cargo test --manifest-path contracts/Cargo.toml— all Rust tests passnpm run test:backend(frombackend/) — SEP-12 controller tests pass including newconfirmUploadcasesnpm run clean(frombackend/) — deletes journal files andlogs//coverage/dirscargo check --manifest-path contracts/Cargo.toml— yield contract compiles without errorsAssigned to: chidimj