From 1c5cf42d005bee5759a115b1df6fe4c6cab459ab Mon Sep 17 00:00:00 2001 From: TAMARA LIPOWSKI Date: Fri, 19 Sep 2025 01:46:22 -0400 Subject: [PATCH] feat: Add test for UniswapV2 - Used a random post-Shanghai-created USV2 pool state with enough liquidity for the test Necessary fixes: - Don't hardcode to EVMPoolState - Don't expect adapter to always be set. - UniswapV2 names its module differently for some reason... this seems like a special case so instead of updating all integration test yamls, I'm just hardcoding it in test_runner.rs. Perhaps not the best decision? - Log the static attributes if not found. - Get the substreams yaml path from config instead of hardcoding it. --- .../integration_test.tycho.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 substreams/ethereum-uniswap-v2/integration_test.tycho.yaml diff --git a/substreams/ethereum-uniswap-v2/integration_test.tycho.yaml b/substreams/ethereum-uniswap-v2/integration_test.tycho.yaml new file mode 100644 index 0000000..bcbac88 --- /dev/null +++ b/substreams/ethereum-uniswap-v2/integration_test.tycho.yaml @@ -0,0 +1,19 @@ +substreams_yaml_path: ./ethereum-uniswap-v2.yaml +protocol_system: "uniswap_v2" +protocol_type_names: + - "uniswap_v2_pool" +skip_balance_check: true +initialized_accounts: +tests: + - name: test_spx_weth_pool + start_block: 17924533 + stop_block: 17924534 + expected_components: + - id: "0x52c77b0CB827aFbAD022E6d6CAF2C44452eDbc39" + tokens: + - "0xe0f63a424a4439cbe457d80e4f4b51ad25b2c56c" + - "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" + static_attributes: + fee: "0x1e" + creation_tx: "0xf09ac8ad7e21d15ded627a176ec718903baae5e5a9ce671a611bd852691b24f9" + skip_simulation: false