Skip to content

refactor: remove dead storage helpers and unify interest-rate calculation (Closes #331) - #357

Open
laurentketterle-hub wants to merge 1 commit into
Heliobond:mainfrom
laurentketterle-hub:fix/issue-331-dead-code
Open

refactor: remove dead storage helpers and unify interest-rate calculation (Closes #331)#357
laurentketterle-hub wants to merge 1 commit into
Heliobond:mainfrom
laurentketterle-hub:fix/issue-331-dead-code

Conversation

@laurentketterle-hub

Copy link
Copy Markdown

Summary

Removes dead code from project_registry and unifies the interest-rate calculation into a single implementation.

Changes

  • storage.rs exposed six accessor helpers (read_project / write_project / read_proposal / write_proposal / read_whitelist / write_whitelist) that lib.rs never referenced (lib.rs inlines env.storage() calls directly). These drift-prone dead abstractions are removed.
  • logic::calculate_interest_rate duplicated the private compute_rate formula in lib.rs, but with an underflow guard the local copy lacked. compute_rate now delegates to logic::calculate_interest_rate, unifying the formula into one implementation.
  • Removed the now-unused imports from logic.rs.

Verification

cargo build -p project-registry compiles with zero warnings (previously 9 dead-code/unused-import warnings).

Closes #331

…tion (Closes Heliobond#331)

storage.rs exposed six accessor helpers (read/write_project, read/write_proposal, read/write_whitelist) that lib.rs never referenced, and logic::calculate_interest_rate duplicated the private compute_rate formula in lib.rs.

This removes the dead storage helpers and makes compute_rate delegate to logic::calculate_interest_rate (which already includes the underflow guard the local copy lacked), unifying the rate formula into a single implementation.

Signed-off-by: laurentketterle-hub <laurentketterle-hub@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dead/duplicate interest-rate and storage-accessor code in logic.rs and storage.rs

2 participants