fix(CFv1): skip revocation of already repaid loans on credit lines#62
fix(CFv1): skip revocation of already repaid loans on credit lines#62EvgeniiZaitsevCW merged 7 commits intomainfrom
Conversation
|
✅ No security or compliance issues detected. Reviewed everything up to 81fcb18. Security Overview
Detected Code Changes
|
|
@codex review please |
|
@claude review please |
|
Claude finished @EvgeniiZaitsevCW's task in 1m 45s —— View job Code Review
SummaryThe fix is correct and well-targeted. The bug was that Fix Analysis —
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62 +/- ##
=======================================
Coverage 99.89% 99.89%
=======================================
Files 162 162
Lines 6969 6971 +2
Branches 1164 1222 +58
=======================================
+ Hits 6962 6964 +2
Misses 7 7
🚀 New features to boost your workflow:
|
|
Codex Review: Didn't find any major issues. 🎉 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
de6404e to
81fcb18
Compare
Main Changes
Fixed the
_revokeLoan()internal function to skip theonAfterLoanRevocation()credit line hook for already repaid loans (wheretrackedBalance == 0). Previously, revoking an installment loan that contained fully repaid sub-loans would still call the credit line hook for those sub-loans, incorrectly decrementing the borrower'sactiveLoanCountandtotalActiveLoanAmountin the credit line state. Now the hook is only called for sub-loans that have an outstanding balance at the time of revocation.Migration
CapybaraFinancesmart-contracts.InstallmentLoanRevokedbecause fully repaid ordinary loans cannot be revoked. The installment loans with a single installment can be skipped as well.