Testing¶
Home · Top · Table of Contents
Table of Contents¶
- Install Dependencies
- Solidity Tests
- Frontend Tests
- Current Added Coverage
- Linting
- Build Checks
- CI Profiles
- Authors and Contributors
- Legal
Kevin K. Le (LinkedIn) — Founder, Founding Engineer, and Current Lead Engineer; Software Engineer at the Oregon Blockchain Group, University of Oregon.
Kellen Snider — Founding Engineer; Software Engineer at the Oregon Blockchain Group, University of Oregon. His vision, ideas, and dedication during TrustLedger's Ethereum development were invaluable to the codebase we build on today.
See
CREDITS.md.
This document explains how to run TrustLedger tests and quality gates. Use it before opening a PR or debugging a failing GitHub Actions job.
Install Dependencies¶
Home · Top · Table of Contents
Solidity Tests¶
Home · Top · Table of Contents
Run all Foundry tests:
Run the staging Foundry profile:
Run Foundry fork tests:
The default fork command is sandbox-safe and skips live RPC execution unless it is explicitly enabled. Run live fork tests with:
Live Foundry fork tests read SEPOLIA_RPC_URL and FORK_BLOCK_NUMBER directly.
Set SEPOLIA_RPC_URL before running fork tests that require live Sepolia state.
tools/foundry-sandbox.mjs strips proxy-related environment variables before
invoking forge, which avoids macOS system proxy access panics in sandboxed
agent sessions.
Run Hardhat TypeScript/Mocha tests:
Hardhat forks only when FORK_URL is set. Otherwise it uses a fresh in-memory
chain. Foundry owns Solidity .t.sol execution; npm run hardhat:test runs the
Hardhat Mocha subtask so the same Solidity suites are not double-run through
Hardhat. Use npm run foundry:gas for gas reports; hardhat-gas-reporter still
peers on Hardhat 2 and is intentionally not installed in the Hardhat 3
toolchain. Use Foundry deploy scripts with --verify for explorer verification
because the Hardhat 3 verify plugin currently reintroduces unfixed ethers v5
advisories.
Frontend Tests¶
Home · Top · Table of Contents
Run unit tests:
Run the strict locale and visible-copy scanner:
Install the Chromium browser used by Playwright:
Run Playwright E2E tests:
The Playwright web server binds to localhost by default to avoid managed
sandbox failures on direct 127.0.0.1 binds. Set
PLAYWRIGHT_WEB_SERVER_HOST=127.0.0.1 only when a runner requires IPv4
loopback.
Run the interactive Playwright UI:
Run headed browser tests:
Sandboxed agent sessions may block DNS for external wallet metadata endpoints such as Reown/Web3Modal. Frontend builds must treat those fetch failures as non-fatal fallback warnings, not application errors. For live wallet-provider checks that genuinely require network access, run the specific command with an approved sandbox escalation and keep the command scoped to the frontend test or build being verified.
Current Added Coverage¶
Home · Top · Table of Contents
The current testing sweep added focused frontend tests for:
- Legal document localization and translation prompt guardrails.
- Solana cluster resolution, address-shape validation, and Explorer URLs.
- Home-page interactive contract preview phase selection and CTA advancement.
These tests complement existing wallet, validation, health, oracle, route, contract-error, and public route checks.
Linting¶
Home · Top · Table of Contents
Run all root lint checks:
Run frontend lint checks:
Run Solidity lint checks:
Run markdown lint checks:
Run ignored local artifact retention checks:
Run direct log retention checks:
Run Python docstring and type checks for the project-owned Python helper scripts:
npm run lint:py runs tools/check-python-docstrings.py before mypy. The
docstring gate scans only project-owned Python files and excludes vendored
contract libraries, generated outputs, caches, and dependency directories.
Build Checks¶
Home · Top · Table of Contents
Compile Hardhat contracts:
Build Foundry contracts:
Build the frontend:
CI Profiles¶
Home · Top · Table of Contents
The Solidity CI workflow uses FOUNDRY_PROFILE=ci, which lowers fuzz runs to
keep CI fast. The default local Foundry profile runs more fuzz cases. The
staging profile keeps production optimizer settings with intermediate fuzz and
invariant coverage.
Authors and Contributors¶
Home · Top · Table of Contents
- Kevin K. Le — Founder, Founding Engineer, and Current Lead Engineer (LinkedIn)
- Kellen Snider — Founding Engineer (LinkedIn)
See CREDITS.md for the complete acknowledgement list.
Legal¶
Home · Top · Table of Contents
This document is part of TrustLedger, an open-source decentralized escrow and
arbitration protocol. Use of this software and documentation is subject to the
Terms and Conditions,
Privacy Policy, and Risk Disclosure.
See LEGAL.md for the full compliance and licensing overview.