fix(project_registry): dead storage/logic wiring, TTL refresh on write, status transitions, EVENTS.md sync - #492
Merged
abayomicornelius merged 2 commits intoAug 25, 2026
Conversation
…n write, add status transitions, sync EVENTS.md - Route lib.rs's Project/Proposal/Whitelist reads and writes through storage.rs's accessors instead of inlining env.storage() calls, and make compute_rate delegate to logic::calculate_interest_rate — the two modules were fully unused/duplicated (Heliobond#331). - Move TTL extension into storage::write_project so every mutating write to a Project entry re-extends its rent, not just create_project (Heliobond#328). - Add an admin-only set_project_status transition (Active/Funded/ Completed), since nothing previously advanced ProjectData::status past Pending; it cannot set or clear Archived, which stays owned by archive_project (Heliobond#329). - Document every event actually emitted by events.rs in EVENTS.md, and fix project_created's documented field name (creator -> owner) (Heliobond#330). - Fix a pre-existing missing closing brace in test.rs (from a prior merge) that made the whole test module fail to compile. Closes Heliobond#328, Heliobond#329, Heliobond#330, Heliobond#331.
|
@Godbrand0 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.
Summary
lib.rs's Project/Proposal/Whitelist reads and writes throughstorage.rs's accessors instead of inliningenv.storage()calls, and makecompute_ratedelegate tologic::calculate_interest_rate— both modules were previously unused/duplicated.storage::write_projectso every mutating write to a Project entry re-extends its rent, not justcreate_project.set_project_statustransition (Active/Funded/Completed) — nothing previously advancedProjectData::statuspastPending. It cannot set or clearArchived, which stays owned byarchive_project.events.rsinEVENTS.md, and fixproject_created's documented field name (creator->owner).test.rs(dropped by an earlier merge) that made the whole test module fail to compile — unrelated to these issues but blocked running the suite at all.Closes #331,
Closes #328,
Closes #329,
Closes #330.
Test plan
cargo test -p project-registry: 114 passed. The only 2 failures (test_full_heliobond_flow,test_score_history_multiple_updates_ordered) reproduce identically on unmodifiedmain(verified via a separate worktree) — pre-existing, unrelated to this change.cargo build --workspacesucceeds.cargo fmt --check -p project-registry: only pre-existing, untouched lines flagged.set_project_statussuccess/no-op/archived-transition rejection.