kleros/foresight/indexer-testing
Claude Code and agent skill by kleros/foresight
- community
Checking that the SKILL.md file is still in the repository.
Write and run tests for Envio Indexer projects using Vitest and createTestIndexer(). Covers test setup, processing block ranges, asserting entity changes with toMatchInlineSnapshot, and TDD workflow. Use when writing tests, debugging handler output, or verifying indexer behavior.
Install
npx vskill@latest install kleros/foresight/indexer-testingSKILL.md
Envio Indexer Testing
Setup
The Envio Indexer uses Vitest with createTestIndexer() from envio. The simplest way to start is auto-exit mode — no block ranges needed. The indexer automatically finds the first block with events and processes it.
Run pnpm test — Vitest auto-fills the snapshots on first run. Review and commit.
Process API
Auto-exit (recommended for getting started)
Processes the first block with matching events, then exits. Each subsequent call continues from where the previous one stopped.
Explicit block range
Process a specific block range. Use when you need deterministic, pinned snapshots.
Simulate (mock events)
Feed synthetic events without hitting the network. Best for unit-testing handler logic.
Entity State API
Preset state before processing and read entities after.
result.changes
result.changes is an array of per-block change objects. Each entry has block, chainId, eventsProcessed, plus entity names as keys with sets arrays of created/updated entities. Dynamic contract registrations appear under addresses.sets.
Assertions
TDD Workflow
- Write a failing test with expected entity output
- Implement the handler until the test passes
- Capture the snapshot — run
pnpm testto filltoMatchInlineSnapshot - Review and commit the snapshot for regression testing
Running Tests
Advanced: Finding Block Ranges with HyperSync
Auto-exit mode eliminates the need for manual block discovery in most cases. Use this when you need specific block ranges for pinned snapshots.
Do NOT web-search for block ranges. Query HyperSync directly. Endpoint pattern: https://{chainId}.hypersync.xyz (e.g., chain 1 → https://1.hypersync.xyz).
Common chain IDs: 1 (Ethereum), 8453 (Base), 42161 (Arbitrum), 10 (Optimism), 137 (Polygon), 56 (BSC), 43114 (Avalanche), 100 (Gnosis), 59144 (Linea), 534352 (Scroll), 81457 (Blast), 42220 (Celo).
Returns the earliest matching blocks. Use from_block to paginate forward. Pick a tight range (50–200 blocks) for fast, deterministic tests.
If something is unclear, use theenvio-docsskill to search and read the latest documentation.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingapps/indexer/.claude/skills/indexer-testing/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kleros/foresight/indexer-testing)