Skip to content

fix: align repay function name between XDR builder and transaction checker#90

Open
khaylebfortune wants to merge 1 commit into
StepFi-app:mainfrom
khaylebfortune:fix/align-repay-function-name
Open

fix: align repay function name between XDR builder and transaction checker#90
khaylebfortune wants to merge 1 commit into
StepFi-app:mainfrom
khaylebfortune:fix/align-repay-function-name

Conversation

@khaylebfortune

Copy link
Copy Markdown
Contributor

Fix repayment function name mismatch

Problem

The XDR builder (creditline.client.ts) builds transactions using repay_installment but the transaction status checker was looking for repay_loan. This mismatch meant the follow-up loan balance deduction never triggered after successful on-chain repayments — loans appeared unpaid indefinitely.

Root Cause

The function name was changed in one place but not the other during development, as documented in ISSUES.md.

Changes

File Change
src/jobs/transaction-status-checker/transaction-status-checker.service.ts Check for repay_installment instead of repay_loan
src/stellar/contracts/clients/creditline.client.ts Fix error log to match actual function name
src/modules/loans/loans.controller.ts Update Swagger description
src/modules/loans/dto/loan-payment-response.dto.ts Update Swagger description
test/unit/stellar/contract-function-name.spec.ts New: verifies XDR builder and checker use the same function name

Verification

  • npm run build passes
  • npm test — 25 suites, 290 tests pass
  • New alignment test passes (2/2)

Closes #62

…ecker

The deployed creditline contract function is 'repay_installment' but the
transaction status checker was looking for 'repay_loan'. This mismatch
meant successful on-chain repayments never triggered the follow-up
loan balance deduction — loans appeared unpaid indefinitely.

Changes:
- transaction-status-checker.service.ts: check for 'repay_installment'
- creditline.client.ts: fix error log to match actual function name
- loans.controller.ts, loan-payment-response.dto.ts: update Swagger docs
- Add alignment test to prevent future drift

Closes StepFi-app#62
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.

critical: align repayment function name between XDR builder and status checker

1 participant