Context
The Across decoder (src/intents/across.rs, PR #3) has a decode_deposit_event pure-function entry point that's perfect for golden-file testing, but right now our coverage is shallow. Agents downstream of resolver trust the decoder to produce stable, normalized Intents — we should lock that behavior with fixture-based tests that fail loudly if the decoder's output drifts.
Scope
- Create
tests/fixtures/ at repo root.
- For each supported decoder (Across, UniswapX), capture 3 real JSON fixtures:
tests/fixtures/across_v3_deposit_eth_to_arb.json — a real V3FundsDeposited event JSON (you can pull one from Etherscan logs or the Across subgraph).
tests/fixtures/across_v3_deposit_base_to_arb.json
tests/fixtures/across_v3_expired.json — one where fill_deadline < now, to pin expiry-handling behavior.
- Corresponding UniswapX fixtures for mainnet and Arbitrum.
- For each fixture, create a matching
<name>.expected.json that captures the normalized Intent output (pretty-printed JSON). These become golden files.
- Add
tests/intent_decoders.rs that:
- Loads each fixture.
- Runs it through the decoder.
- Serializes the resulting
Intent with serde_json::to_string_pretty.
- Asserts
== against the .expected.json.
- Document fixture format in
tests/fixtures/README.md so future decoders can add their own.
Acceptance criteria
cargo test --test intent_decoders green.
cargo clippy --tests clean.
- If a contributor breaks decoder output, the failing diff is human-readable (use
pretty_assertions crate — add as dev-dep).
- At least 6 fixtures total across the two decoders.
Reference: src/intents/across.rs decode_deposit_event, and PR #3 for the testing conventions already in place.
Estimated effort
S (4–6 hours) — the work is collecting real data and committing the goldens.
— kcolbchain / Abhishek Krishna
Context
The Across decoder (
src/intents/across.rs, PR #3) has adecode_deposit_eventpure-function entry point that's perfect for golden-file testing, but right now our coverage is shallow. Agents downstream ofresolvertrust the decoder to produce stable, normalizedIntents — we should lock that behavior with fixture-based tests that fail loudly if the decoder's output drifts.Scope
tests/fixtures/at repo root.tests/fixtures/across_v3_deposit_eth_to_arb.json— a realV3FundsDepositedevent JSON (you can pull one from Etherscan logs or the Across subgraph).tests/fixtures/across_v3_deposit_base_to_arb.jsontests/fixtures/across_v3_expired.json— one wherefill_deadline< now, to pin expiry-handling behavior.<name>.expected.jsonthat captures the normalizedIntentoutput (pretty-printed JSON). These become golden files.tests/intent_decoders.rsthat:Intentwithserde_json::to_string_pretty.==against the.expected.json.tests/fixtures/README.mdso future decoders can add their own.Acceptance criteria
cargo test --test intent_decodersgreen.cargo clippy --testsclean.pretty_assertionscrate — add as dev-dep).Reference:
src/intents/across.rsdecode_deposit_event, and PR #3 for the testing conventions already in place.Estimated effort
S (4–6 hours) — the work is collecting real data and committing the goldens.
— kcolbchain / Abhishek Krishna