From 35c05661f93e94bd7660b6de839be049eda39930 Mon Sep 17 00:00:00 2001 From: David Lutterkort Date: Mon, 28 Apr 2025 15:02:09 -0700 Subject: [PATCH] chain: Remove special case for ganache Ganache has been dead for a long time https://archive.trufflesuite.com/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat-partnership/ --- chain/ethereum/src/ethereum_adapter.rs | 11 +---------- .../abis/Contract.abi | 0 .../{ganache-reverts => reverted-calls}/package.json | 4 ++-- .../schema.graphql | 0 .../src/mapping.ts | 0 .../{ganache-reverts => reverted-calls}/subgraph.yaml | 0 tests/tests/integration_tests.rs | 4 ++-- 7 files changed, 5 insertions(+), 14 deletions(-) rename tests/integration-tests/{ganache-reverts => reverted-calls}/abis/Contract.abi (100%) rename tests/integration-tests/{ganache-reverts => reverted-calls}/package.json (93%) rename tests/integration-tests/{ganache-reverts => reverted-calls}/schema.graphql (100%) rename tests/integration-tests/{ganache-reverts => reverted-calls}/src/mapping.ts (100%) rename tests/integration-tests/{ganache-reverts => reverted-calls}/subgraph.yaml (100%) diff --git a/chain/ethereum/src/ethereum_adapter.rs b/chain/ethereum/src/ethereum_adapter.rs index 1c1d214f6a5..7c4d2d38f73 100644 --- a/chain/ethereum/src/ethereum_adapter.rs +++ b/chain/ethereum/src/ethereum_adapter.rs @@ -113,21 +113,12 @@ impl EthereumAdapter { ) -> Self { let web3 = Arc::new(Web3::new(transport)); - // Use the client version to check if it is ganache. For compatibility with unit tests, be - // are lenient with errors, defaulting to false. - let is_ganache = web3 - .web3() - .client_version() - .await - .map(|s| s.contains("TestRPC")) - .unwrap_or(false); - EthereumAdapter { logger, provider, web3, metrics: provider_metrics, - supports_eip_1898: supports_eip_1898 && !is_ganache, + supports_eip_1898, call_only, supports_block_receipts: Arc::new(RwLock::new(None)), } diff --git a/tests/integration-tests/ganache-reverts/abis/Contract.abi b/tests/integration-tests/reverted-calls/abis/Contract.abi similarity index 100% rename from tests/integration-tests/ganache-reverts/abis/Contract.abi rename to tests/integration-tests/reverted-calls/abis/Contract.abi diff --git a/tests/integration-tests/ganache-reverts/package.json b/tests/integration-tests/reverted-calls/package.json similarity index 93% rename from tests/integration-tests/ganache-reverts/package.json rename to tests/integration-tests/reverted-calls/package.json index 849ddeba298..2cfbfdbeecf 100644 --- a/tests/integration-tests/ganache-reverts/package.json +++ b/tests/integration-tests/reverted-calls/package.json @@ -1,6 +1,6 @@ { - "name": "ganache-reverts", - "version": "0.1.0", + "name": "reverted-calls", + "version": "0.1.1", "scripts": { "build-contracts": "../../common/build-contracts.sh", "codegen": "graph codegen --skip-migrations", diff --git a/tests/integration-tests/ganache-reverts/schema.graphql b/tests/integration-tests/reverted-calls/schema.graphql similarity index 100% rename from tests/integration-tests/ganache-reverts/schema.graphql rename to tests/integration-tests/reverted-calls/schema.graphql diff --git a/tests/integration-tests/ganache-reverts/src/mapping.ts b/tests/integration-tests/reverted-calls/src/mapping.ts similarity index 100% rename from tests/integration-tests/ganache-reverts/src/mapping.ts rename to tests/integration-tests/reverted-calls/src/mapping.ts diff --git a/tests/integration-tests/ganache-reverts/subgraph.yaml b/tests/integration-tests/reverted-calls/subgraph.yaml similarity index 100% rename from tests/integration-tests/ganache-reverts/subgraph.yaml rename to tests/integration-tests/reverted-calls/subgraph.yaml diff --git a/tests/tests/integration_tests.rs b/tests/tests/integration_tests.rs index 9df36f7145a..4ef1a8b99cf 100644 --- a/tests/tests/integration_tests.rs +++ b/tests/tests/integration_tests.rs @@ -657,7 +657,7 @@ async fn test_topic_filters(ctx: TestContext) -> anyhow::Result<()> { Ok(()) } -async fn test_ganache_reverts(ctx: TestContext) -> anyhow::Result<()> { +async fn test_reverted_calls_are_indexed(ctx: TestContext) -> anyhow::Result<()> { let subgraph = ctx.subgraph; assert!(subgraph.healthy); @@ -1028,7 +1028,7 @@ async fn integration_tests() -> anyhow::Result<()> { let test_name_to_run = std::env::var("TEST_CASE").ok(); let cases = vec![ - TestCase::new("ganache-reverts", test_ganache_reverts), + TestCase::new("reverted-calls", test_reverted_calls_are_indexed), TestCase::new("host-exports", test_host_exports), TestCase::new("non-fatal-errors", test_non_fatal_errors), TestCase::new("overloaded-functions", test_overloaded_functions),