Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CreditContract/contracts/score/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub enum Error {
MetaInvalida = 11,
}

// ─── Storage Keys ─────────────────────────────────────────────────────────────
// Storage Keys

#[contracttype]
pub enum DataKey {
Expand All @@ -56,7 +56,7 @@ pub enum DataKey {
UsdcToken,
}

// ─── Constantes del modelo de negocio ─────────────────────────────────────────
// Constantes del modelo de negocio

/// Depósito mínimo: 2 USDC (en stroops, 7 decimales Stellar).
const MIN_DEPOSIT: i128 = 20_000_000;
Expand All @@ -71,7 +71,7 @@ const PRESTAMO_MAX_MESES: u32 = 24;
/// 1 USDC = 10_000_000 stroops.
const STROOP: i128 = 10_000_000;

// ─── Contrato ─────────────────────────────────────────────────────────────────
// Contrato

#[contract]
pub struct MananaSeguroContract;
Expand Down
12 changes: 6 additions & 6 deletions CreditContract/contracts/score/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@ fn test_depositar_minimo() {
#[test]
fn test_depositar_bajo_minimo() {
let (_env, cliente, _admin, usuario, _usdc) = setup();
// $1 USDC = 10_000_000 stroops debe fallar con MontoBajoMinimo
// $1 USDC = 10_000_000 stroops, debe fallar con MontoBajoMinimo
let res = cliente.try_depositar(&usuario, &10_000_000, &20);
assert_eq!(res, Err(Ok(Error::MontoBajoMinimo)));
}

#[test]
fn test_depositar_anios_bloqueo_invalidos() {
let (_env, cliente, _admin, usuario, _usdc) = setup();
// Bloqueo 0 años debe fallar con AniosBloqueoInvalidos
// Bloqueo 0 años, debe fallar con AniosBloqueoInvalidos
let res_cero = cliente.try_depositar(&usuario, &20_000_000, &0);
assert_eq!(res_cero, Err(Ok(Error::AniosBloqueoInvalidos)));

// Bloqueo 41 años debe fallar con AniosBloqueoInvalidos
// Bloqueo 41 años, debe fallar con AniosBloqueoInvalidos
let res_excede = cliente.try_depositar(&usuario, &20_000_000, &41);
assert_eq!(res_excede, Err(Ok(Error::AniosBloqueoInvalidos)));
}
Expand Down Expand Up @@ -113,7 +113,7 @@ fn test_retirar_meta_alcanzada() {
let primer_deposito = 100_000_000i128;
cliente.depositar(&usuario, &primer_deposito, &1);

// Meta = 1_000_000_000 depositar más para alcanzarla
// Meta = 1_000_000_000, depositar más para alcanzarla
let usdc_admin = token::StellarAssetClient::new(&env, &usdc);
usdc_admin.mint(&usuario, &2_000_000_000);

Expand Down Expand Up @@ -185,7 +185,7 @@ fn test_autoprestamo_excede_limite() {
let (_env, cliente, _admin, usuario, _usdc) = setup();

cliente.depositar(&usuario, &100_000_000, &20);
// Solicitar 40% debe fallar con ExcedeLimitePrestamo
// Solicitar 40%, debe fallar con ExcedeLimitePrestamo
let res = cliente.try_solicitar_prestamo(&usuario, &40_000_000);
assert_eq!(res, Err(Ok(Error::ExcedeLimitePrestamo)));
}
Expand Down Expand Up @@ -223,7 +223,7 @@ fn test_no_retirar_con_prestamo_activo() {
l.timestamp += 365 * 24 * 3600 + 1;
});

// Intentar retirar con préstamo activo debe fallar con PrestamoPendiente
// Intentar retirar con préstamo activo, debe fallar con PrestamoPendiente
let res = cliente.try_retirar(&usuario);
assert_eq!(res, Err(Ok(Error::PrestamoPendiente)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn deploy(env: &Env) -> RetiroChainClient<'_> {
RetiroChainClient::new(env, &contract_id)
}

// ─── Core tests ──────────────────────────────────────────────────────────────
// Core tests

// inicializar computes ver_retiro = now + anos * seconds_per_year
#[test]
Expand Down Expand Up @@ -79,7 +79,7 @@ fn test_puede_retirar_true_after_date() {
assert!(client.puede_retirar());
}

// ─── Edge cases ──────────────────────────────────────────────────────────────
// Edge cases

// anos = 0 → retirement date equals the current timestamp
// the >= check means puede_retirar is immediately true
Expand Down Expand Up @@ -149,7 +149,7 @@ fn test_ver_balance_sin_inicializar() {
assert_eq!(client.ver_balance(), 0);
}

// depositar also works before inicializar unwrap_or(0) seeds the missing balance key
// depositar also works before inicializar , unwrap_or(0) seeds the missing balance key
#[test]
fn test_depositar_sin_inicializar() {
let env = Env::default();
Expand All @@ -160,7 +160,7 @@ fn test_depositar_sin_inicializar() {
}

// re-calling inicializar overwrites the retirement date because there is no
// re-initialization guard this test documents that behaviour so it is explicit
// re-initialization guard , this test documents that behaviour so it is explicit
#[test]
fn test_inicializar_sobrescribe_retiro() {
let env = Env::default();
Expand Down
14 changes: 7 additions & 7 deletions CreditRoot/src/components/ErrorBoundary.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// src/components/ErrorBoundary.jsx
//
//
// Error Boundary global de la app.
//
//
// React requiere que los Error Boundaries sean componentes de clase: los
// hooks (useState/useEffect) NO pueden capturar errores de renderizado de los
// hijos. Por eso este componente es una clase y no una función.
//
//
// Captura cualquier error que se lance durante el render / lifecycle de los
// componentes hijos (p. ej. DepositFlow o WithdrawalFlow cuando el polling
// contra /api/etherfuse/order-status devuelve una forma inesperada) y muestra
// una pantalla de respaldo amigable en lugar de dejar la app en blanco.
//
//
// Props:
// children árbol a proteger
// onReset (opcional) callback extra al pulsar "Reintentar"
// children , árbol a proteger
// onReset , (opcional) callback extra al pulsar "Reintentar"

import { Component, Fragment } from 'react'
import { Link } from 'react-router-dom'
Expand All @@ -38,7 +38,7 @@ export class ErrorBoundary extends Component {
console.error('[ErrorBoundary] Componente capturado:', error, errorInfo)

// TODO(Sentry): reportar a Sentry cuando esté configurado, p. ej.
// Sentry.captureException(error, { extra: { componentStack: errorInfo?.componentStack } })
// Sentry.captureException(error, { extra: { componentStack: errorInfo?.componentStack } })

this.setState({ errorInfo })
}
Expand Down
6 changes: 3 additions & 3 deletions CreditRoot/src/data/retirementContent.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ─── Mañana Seguro Constantes del modelo de negocio ───────────────────────
// Mañana Seguro , Constantes del modelo de negocio

export const MANANA_SEGURO_RATES = {
cetesRate: 6.5, // tasa bruta actual de Banxico (CETES 28 días)
Expand All @@ -16,7 +16,7 @@ export const MANANA_SEGURO_RATES = {
constancyMinDeposit: 20,
}

// Incentivos cada 5 años máximo 7%
// Incentivos cada 5 años , máximo 7%
export const INCENTIVE_SCENARIOS = [
{ key: 'solo_fidelidad', label: 'Solo fidelidad', pct: 5, description: 'Mantienes tu ahorro sin retirar' },
{ key: 'fidelidad_constancia', label: 'Fidelidad + constancia ($20/mes)', pct: 7, description: '+$20 USDC mensuales mínimo' },
Expand All @@ -31,7 +31,7 @@ export const plannerDefaults = {
}

// NOTA: retirementStats.value se actualiza dinámicamente en HomeScreen
// usando useEtherfuseRate() este valor es solo el fallback inicial
// usando useEtherfuseRate() , este valor es solo el fallback inicial
export const retirementStats = [
{ label: 'Mexicanos sin pensión', value: '32M', caption: 'Trabajadores informales sin acceso al sistema tradicional.', tone: 'accent' },
{ label: 'Rendimiento vía Etherfuse', value: '~5.5%', caption: 'APY en USDC que recibe el usuario. Respaldado por CETES.', tone: 'brand' },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// src/features/access/components/ConnectAccountCard.jsx
//
//
// Muestra la información del usuario autenticado con Google.
// Ya no pide conectar Freighter el modelo es custodial via Supabase.
// Ya no pide conectar Freighter , el modelo es custodial via Supabase.

import { useTranslation } from 'react-i18next'

Expand Down Expand Up @@ -35,7 +35,7 @@ export function ConnectAccountCard({ usuario }) {
)
}

// Usuario autenticado mostrar sus datos
// Usuario autenticado , mostrar sus datos
const panels = [
{
label: t('connectCard.panelEstado'),
Expand Down
18 changes: 9 additions & 9 deletions CreditRoot/src/features/dashboard/components/AutoloanCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function AutoloanCard({ lockedBalance = 0, walletAddress = null }) {
setFase('form')
}
} catch {
/* contrato sin datos aún mostramos formulario */
/* contrato sin datos aún, mostramos formulario */
setFase('form')
}
}
Expand Down Expand Up @@ -103,7 +103,7 @@ export function AutoloanCard({ lockedBalance = 0, walletAddress = null }) {
setRequested(Math.max(10, Math.min(250, Math.floor(maxLoan))))
}

// ── FASE: Cargando ────────────────────────────────────────────────────────────
// FASE: Cargando
if (fase === 'cargando') return (
<div className="p-6 rounded-2xl bg-white dark:bg-white/5 border border-ink/8 dark:border-white/8 text-center">
<svg className="animate-spin mx-auto mb-3 text-yellow-500" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
Expand All @@ -116,7 +116,7 @@ export function AutoloanCard({ lockedBalance = 0, walletAddress = null }) {
return (
<div className="flex flex-col gap-4">

{/* ── Header ── */}
{/* Header */}
<div className="bg-white dark:bg-white/5 border border-ink/8 dark:border-white/8 rounded-2xl p-6">
<div className="flex items-start justify-between flex-wrap gap-3">
<div>
Expand All @@ -136,7 +136,7 @@ export function AutoloanCard({ lockedBalance = 0, walletAddress = null }) {
</div>
</div>

{/* ── Sin saldo bloqueado ── */}
{/* Sin saldo bloqueado */}
{lockedBalance === 0 && fase === 'form' && (
<div className="bg-white dark:bg-white/5 border border-dashed border-ink/10 dark:border-white/10 rounded-2xl p-6 text-center">
<div className="mb-3"><Lock size={36} aria-hidden="true" className="inline-block text-ink/30 dark:text-white/30" /></div>
Expand All @@ -148,7 +148,7 @@ export function AutoloanCard({ lockedBalance = 0, walletAddress = null }) {
</div>
)}

{/* ── FASE: Formulario ── */}
{/* FASE: Formulario */}
{fase === 'form' && lockedBalance > 0 && (
<div className="bg-white dark:bg-white/5 border border-ink/8 dark:border-white/8 rounded-2xl p-6 flex flex-col gap-4">

Expand Down Expand Up @@ -266,7 +266,7 @@ export function AutoloanCard({ lockedBalance = 0, walletAddress = null }) {
</div>
)}

{/* ── FASE: Confirmando ── */}
{/* FASE: Confirmando */}
{fase === 'confirmando' && (
<div className="bg-white dark:bg-white/5 border border-ink/8 dark:border-white/8 rounded-2xl p-6 text-center">
<div className="mb-4"><TriangleAlert size={48} aria-hidden="true" className="inline-block text-yellow-500" /></div>
Expand Down Expand Up @@ -294,7 +294,7 @@ export function AutoloanCard({ lockedBalance = 0, walletAddress = null }) {
</div>
)}

{/* ── FASE: Procesando ── */}
{/* FASE: Procesando */}
{fase === 'procesando' && (
<div className="bg-white dark:bg-white/5 border border-ink/8 dark:border-white/8 rounded-2xl p-6 text-center">
<svg className="animate-spin mx-auto mb-3 text-yellow-500" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
Expand All @@ -304,7 +304,7 @@ export function AutoloanCard({ lockedBalance = 0, walletAddress = null }) {
</div>
)}

{/* ── FASE: Error ── */}
{/* FASE: Error */}
{fase === 'error' && (
<div className="bg-red-500/5 border border-red-500/20 rounded-2xl p-6 text-center">
<div className="mb-3"><XCircle size={36} aria-hidden="true" className="inline-block text-red-500" /></div>
Expand All @@ -318,7 +318,7 @@ export function AutoloanCard({ lockedBalance = 0, walletAddress = null }) {
</div>
)}

{/* ── FASE: Activo ── */}
{/* FASE: Activo */}
{fase === 'activo' && (
<div className="bg-white dark:bg-white/5 border border-ink/8 dark:border-white/8 rounded-2xl p-6 flex flex-col gap-4">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// src/features/dashboard/components/ContributionHistory.jsx
//
// Historial de aportaciones lee órdenes reales de Supabase
//
// Historial de aportaciones , lee órdenes reales de Supabase
// Ya no usa Stellar/Soroban ni localStorage

import { useState, useEffect } from 'react'
Expand Down Expand Up @@ -40,7 +40,7 @@ export function ContributionHistory() {
return (
<div className="flex flex-col gap-4">

{/* ── Resumen ── */}
{/* Resumen */}
<div className="bg-white dark:bg-white/5 border border-ink/8 dark:border-white/8 rounded-2xl p-6">
<div className="flex items-center gap-2 mb-5">
<h5 className="font-display font-black text-ink dark:text-white text-lg">
Expand Down Expand Up @@ -83,7 +83,7 @@ export function ContributionHistory() {
</div>
</div>

{/* ── Lista de órdenes ── */}
{/* Lista de órdenes */}
<div className="bg-white dark:bg-white/5 border border-ink/8 dark:border-white/8 rounded-2xl p-6">
<div className="mb-5">
<h5 className="font-display font-black text-ink dark:text-white text-lg mb-1">
Expand Down
Loading
Loading