Skip to content

Feature/loan manager view accrual issue 7#32

Merged
ogazboiz merged 3 commits into
LabsCrypt:mainfrom
Francis6-git:feature/loan-manager-view-accrual-issue-7
Jun 19, 2026
Merged

Feature/loan manager view accrual issue 7#32
ogazboiz merged 3 commits into
LabsCrypt:mainfrom
Francis6-git:feature/loan-manager-view-accrual-issue-7

Conversation

@Francis6-git

Copy link
Copy Markdown
Contributor

Description:
This PR resolves Issue #7, fixing a discrepancy where the get_loan view function was evaluating interest and late fee accruals on a localized copy of the Loan struct without updating persistent storage. This caused returned states to diverge from subsequent state-changing contract entries.

Closes #7

@ogazboiz ogazboiz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean addition. the read-only quote_total_debt view delegates to the same current_total_debt helper that repay uses, so the quote always matches what actually gets charged, and the test proves it by asserting balance_before minus balance_after equals the quoted debt and the loan ends Repaid. no state mutation beyond the ttl bump (which the rest of the file does too), accrual is by elapsed ledgers not call count, and it returns LoanNotFound on a missing loan rather than panicking. ci is green. merging.

if you want to keep contributing, join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0

@ogazboiz ogazboiz merged commit 9d9dad5 into LabsCrypt:main Jun 19, 2026
1 check passed
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.

[Contracts] LoanManager get_loan is a view but accrues interest/late fees without persisting, diverging from on-chain state

2 participants