Join our community: https://t.me/+DOylgFv1jyJlNzM0
Description
LoanStatus in contracts/loan_manager/src/lib.rs includes Cancelled and Rejected statuses. However, the events.rs file does not appear to emit a LoanCancelled or LoanRejected event when a loan moves into these terminal states.
The backend indexer in eventIndexer.ts only tracks events that are emitted by the contract. Without LoanCancelled and LoanRejected events, the indexer cannot update loan status in the database. Borrowers would see their cancelled or rejected loans still showing as Pending in the UI indefinitely.
Expected Behavior
Emit events for all loan status transitions, including:
LoanCancelled { loan_id, borrower, cancelled_at_ledger }
LoanRejected { loan_id, borrower, rejected_at_ledger, reason }
Then add parsers for these events in backend/src/services/eventIndexer.ts.
Impact
Medium. Borrowers cannot see their loan was rejected or cancelled in the UI. They may keep trying to interact with a loan that is in a terminal state.
Description
LoanStatusincontracts/loan_manager/src/lib.rsincludesCancelledandRejectedstatuses. However, theevents.rsfile does not appear to emit aLoanCancelledorLoanRejectedevent when a loan moves into these terminal states.The backend indexer in
eventIndexer.tsonly tracks events that are emitted by the contract. WithoutLoanCancelledandLoanRejectedevents, the indexer cannot update loan status in the database. Borrowers would see their cancelled or rejected loans still showing asPendingin the UI indefinitely.Expected Behavior
Emit events for all loan status transitions, including:
LoanCancelled { loan_id, borrower, cancelled_at_ledger }LoanRejected { loan_id, borrower, rejected_at_ledger, reason }Then add parsers for these events in
backend/src/services/eventIndexer.ts.Impact
Medium. Borrowers cannot see their loan was rejected or cancelled in the UI. They may keep trying to interact with a loan that is in a terminal state.