Skip to content

fix: resolve issues #705, #706, #707, #708 — a11y tests, proptest netting, SEP-24 timeouts, RUNBOOK circuit breaker#754

Open
Mystery-CLI wants to merge 4 commits into
Haroldwonder:mainfrom
Mystery-CLI:main
Open

fix: resolve issues #705, #706, #707, #708 — a11y tests, proptest netting, SEP-24 timeouts, RUNBOOK circuit breaker#754
Mystery-CLI wants to merge 4 commits into
Haroldwonder:mainfrom
Mystery-CLI:main

Conversation

@Mystery-CLI
Copy link
Copy Markdown
Contributor

Summary

This PR addresses four issues across documentation, backend tests, frontend tests, and smart contract tests.


#708 — RUNBOOK.md: Document circuit breaker multi-admin vote-to-unpause procedure

File: RUNBOOK.md

The runbook covered emergency pause and unpause but left operators without guidance on coordinating the multi-admin quorum vote required by the circuit breaker. Added a new Section 2 — Circuit Breaker: Multi-Admin Vote-to-Unpause covering:

  • Phase 1: How to trigger an emergency pause (with the exact emergency_pause command)
  • Phase 2: How to check current vote count and quorum status via health, coordinate each admin's vote_unpause call, and track progress during a live incident
  • Phase 3: When and how to use emergency_unpause as a break-glass last resort (bypassing quorum), including the post-incident review obligation

Subsequent sections renumbered from 3–8 accordingly.

Closes #708


#707 — SEP-24 service test: timeout simulation in MockSep24AnchorServer

File: backend/src/__tests__/sep24-service.test.ts

The mock anchor server only simulated success and failure responses; network timeout paths were untested. Changes:

  • Added enableTimeoutSimulation(paths?) and disableTimeoutSimulation() methods to MockSep24AnchorServer — when enabled, matching endpoints silently hang (never respond), replicating a real network timeout
  • Added a new Timeout Handling describe block with four tests:
    1. Deposit initiation rejects when the anchor does not respond
    2. Withdrawal initiation rejects when the anchor does not respond
    3. pollAllTransactions resolves without throwing when the status endpoint hangs (graceful degradation)
    4. The thrown error is an Error instance with a meaningful timeout-related message (not a raw network object)

Closes #707


#705 — Frontend component tests: accessibility (a11y) checks with jest-axe

Files: frontend/package.json, frontend/src/test-setup.ts, frontend/src/components/__tests__/*.{tsx,jsx}

Component tests verified functional behaviour but had no accessibility assertions. Changes:

  • Added jest-axe@^9.0.0 and @types/jest-axe@^3.5.9 to devDependencies
  • Configured configureAxe in test-setup.ts with color-contrast, label, and aria-required-attr rules
  • Added axe() assertions inside dedicated accessibility describe blocks in all eleven test files:
    • AnchorSelector.test.tsx — loading, error, list, and open-dropdown states
    • AnchorSelectorKeyboard.test.tsx — trigger and open-listbox states
    • ErrorBoundary.test.jsx — error fallback and normal-children states
    • ProofOfPayout.test.tsx — loading and data-displayed states
    • SendMoneyFlow.test.tsx — initial render and confirmation step
    • SendMoneyFlowMemo.test.tsx — memo input step
    • TransactionHistory.pagination.test.tsx — first and second page
    • TransactionHistoryMemo.test.tsx — list view and expanded memo row
    • TransactionStatusTracker.test.tsx — initiated, processing, completed, failed, and with-refresh-button states
    • VerificationBadge.test.tsx — verified, unverified, loading, and details-modal-open states
    • WalletConnection.test.tsx — disconnected and connected states

Closes #705


#706 — Netting algorithm: property-based tests with proptest

File: src/netting.rs

The netting algorithm had deterministic unit tests but no property-based tests covering random inputs. Changes:

  • Added use proptest::prelude::* (proptest was already a dev-dependency in Cargo.toml)
  • Added a make_remittance helper to reduce boilerplate inside proptest bodies
  • Added three proptest! tests verifying the core mathematical invariants:
    1. Fee preservation — sum of total_fees across all net transfers equals the sum of fee fields across all pending input remittances, for any random set of A→B and B→A flows (up to 8 each)
    2. Net amount correctness — for a single party pair, the net transfer amount equals |sum(A→B amounts) − sum(B→A amounts)|; fully-offsetting inputs produce zero transfers
    3. Order independence — reversing the input order (all A→B first vs. all B→A first) produces identical net_amount and total_fees in the output

Proptest generates random (amount, fee) pairs; soroban Address objects are created inside each test body (they require an Env instance and cannot be produced by proptest strategies directly).

Closes #706


Test plan

  • cargo test — existing unit tests + new proptest property tests pass
  • cd backend && npx vitest run src/__tests__/sep24-service.test.ts — timeout tests pass
  • cd frontend && npx vitest run — all component a11y tests pass
  • Manual review of RUNBOOK.md Section 2 for operator clarity

🤖 Generated with Claude Code

Mystery-CLI and others added 4 commits June 1, 2026 11:29
…npause in RUNBOOK.md

Adds Section 2 covering the three-phase circuit breaker procedure:
trigger emergency pause, coordinate vote-to-unpause quorum, and use
emergency_unpause as a last-resort break-glass action. Renumbers
subsequent sections accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ckSep24AnchorServer

Adds enableTimeoutSimulation()/disableTimeoutSimulation() to
MockSep24AnchorServer so individual endpoints can be made to hang
indefinitely. Adds a 'Timeout Handling' describe block with four tests
verifying deposit, withdrawal, poll, and error-message behaviour when
the anchor server does not respond.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…end component tests

Adds jest-axe as a dev dependency and configures it in test-setup.ts.
Adds axe() a11y assertions in dedicated 'accessibility' describe blocks
across all eleven component test files, covering loading, error,
connected, and interactive states.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…algorithm invariants

Adds three proptest-driven tests verifying:
1. Fee preservation — total fees in net transfers equal total fees in input remittances
2. Net amount correctness — net equals |sum(A->B) - sum(B->A)| for a single pair
3. Order independence — reversing input order produces identical net transfers

Uses proptest to generate random amounts/fees; soroban Addresses are
created inside each test body since they require an Env instance.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

@Mystery-CLI is attempting to deploy a commit to the Harold's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@Mystery-CLI Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant