Update gas test metadata

From propeller-heads/tycho-indexer · View interactive version

Update gas test metadata is an AI agent skill from the GitHub repository propeller-heads/tycho-indexer. Keep crates/tycho-execution/.gas-compare/test_metadata.json in sync with the high-level TychoRouter test files. Scans crates/tycho-execution/contracts/test/TychoRouter*.t.sol files, diffs against the existing JSON, and adds/removes/updates entries. Use when tests have been added, removed, or renamed

How to use this skill

Skill file

Update Gas Test Metadata

Keep crates/tycho-execution/.gas-compare/test_metadata.json in sync with the current high-level TychoRouter test files.

When to Use

Workflow

Step 1: Read the current metadata

Read crates/tycho-execution/.gas-compare/test_metadata.json. Note the last_updated date and the current set of test names.

Step 2: Scan the test files

Read each of these files in parallel:

For each function test... found, determine:

router_function — the TychoRouter entry-point called in the test body. One of:

singleSwap, singleSwapPermit2, singleSwapUsingVault,

sequentialSwap, sequentialSwapPermit2, sequentialSwapUsingVault,

splitSwap, splitSwapPermit2, splitSwapUsingVault,

exposedSplitSwap, exposedSequentialSwap

protocols — sorted, deduplicated list. Infer from executor variables and encode helpers used in the test body:

| Variable / helper | Protocol |

|---|---|

| usv2Executor | UniswapV2 |

| usv3Executor | UniswapV3 |

| usv4Executor | UniswapV4 |

| balancerv2Executor | BalancerV2 |

| balancerv3Executor | BalancerV3 |

| curveExecutor | Curve |

| ekuboExecutor | Ekubo |

| rocketpoolExecutor | Rocketpool |

| bebopExecutor | Bebop |

| hashflowExecutor | Hashflow |

| erc4626Executor | ERC4626 |

| wethExecutor | WETH |

| fluidExecutor | FluidV1 |

| maverickExecutor | MaverickV2 |

| slipstreamsExecutor | Slipstreams |

For tests that load calldata from a file (loadCallDataFromFile("test_...")), infer protocols from the filename:

skipped — true if the test body contains vm.skip(true) (omit field if false).

Exclude:

Step 3: Diff and report

Compare the scanned tests against the existing JSON:

Print a summary of changes before writing, e.g.:

Added (2):
  testNewFeatureSwap  [TychoRouterSingleSwap.t.sol]  singleSwap  [UniswapV2]
  testAnotherTest     [TychoRouterFees.t.sol]         singleSwap  [UniswapV2]

Removed (1):
  testOldTest  [TychoRouterSingleSwap.t.sol]

Changed (1):
  testUSV3CurveIntegration: protocols [UniswapV3] → [Curve, UniswapV3]

If there are no changes, say so and stop — do not write the file.

Step 4: Write the updated metadata

If there are changes, write the updated JSON to crates/tycho-execution/.gas-compare/test_metadata.json. Update last_updated to today's date. Preserve all existing entries that are unchanged; add new ones at the end of their file's group; remove deleted ones.

Keep entries sorted: by file (in the order the source files are listed in Step 2), then alphabetically by test name within each file.

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.