Skip to content

[Frontend] useRepaymentOperation.executeRepayment is fully simulated - it never builds, signs, or submits a transaction yet reports success and awards XP #1220

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

useRepaymentOperation.ts:54-107 runs only setTimeout delays, fabricates a fake hash tx_${Date.now()} (line 73), invalidates queries and resolves status: success - it imports useWallet/submitPoolTransaction but never calls them (those are used only by the deposit/withdraw variants). Its sole consumer, LoanRepaymentForm.tsx:108, shows a real repayment UI and triggers gamification XP on this fake success. The form is currently unrendered, but the exported hook is a wired trap that would report a successful repayment with no on-chain effect if mounted.

Acceptance criteria

  • Implement the real build -> sign -> submit flow (mirror useDepositOperation) or remove the simulated hook + dead LoanRepaymentForm
  • Do not award XP / mark complete until a real submitPoolTransaction/submitLoanTransaction txHash returns
  • Remove the Math.random() > 0.5 fake streak award in LoanRepaymentForm.tsx:41 if the form is kept

Files to touch

  • frontend/src/app/hooks/useRepaymentOperation.ts
  • frontend/src/app/components/borrower/LoanRepaymentForm.tsx

Out of scope

  • The separate real repay flow in [locale]/repay/[loanId]/page.tsx

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingfrontendIssues related to frontend development

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions