Skip to content

chain: Remove special case for ganache #5975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chain: Remove special case for ganache
  • Loading branch information
lutter committed May 9, 2025
commit 35c05661f93e94bd7660b6de839be049eda39930
11 changes: 1 addition & 10 deletions chain/ethereum/src/ethereum_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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),
Expand Down
Loading