diff --git a/indexers-v2/patches/@subsquid+squid-gen-evm+1.2.1.patch b/indexers-v2/patches/@subsquid+squid-gen-evm+1.2.1.patch index 5dfff0e60..a9fbace85 100644 --- a/indexers-v2/patches/@subsquid+squid-gen-evm+1.2.1.patch +++ b/indexers-v2/patches/@subsquid+squid-gen-evm+1.2.1.patch @@ -1,27 +1,16 @@ diff --git a/node_modules/@subsquid/squid-gen-evm/lib/core.js b/node_modules/@subsquid/squid-gen-evm/lib/core.js -index 2839b6f..823fce0 100644 +index 2839b6f..902f4eb 100644 --- a/node_modules/@subsquid/squid-gen-evm/lib/core.js +++ b/node_modules/@subsquid/squid-gen-evm/lib/core.js -@@ -28,6 +28,11 @@ class CoreCodegen { - this.printImports(); - this.out.line(); - let targetPrinter = this.getTargetPrinter(); -+ this.out.line(`import { loadNetworkConfig } from './config'`); -+ this.out.line(`const networkName = process.env.NETWORK_NAME || 'arbitrum_mainnet'`); -+ this.out.line(`const configName = process.env.CONFIG_NAME || 'default'`); -+ this.out.line(`const config = loadNetworkConfig(networkName)`); -+ this.out.line(`const rangeTo = config.configs[configName].range.to`); - this.out.line(`processor.run(db, async (ctx) => {`); - this.out.indentation(() => { - targetPrinter.printPreBatch(); -@@ -38,6 +43,13 @@ class CoreCodegen { +@@ -38,6 +38,14 @@ class CoreCodegen { `new Date(block.header.timestamp)`, ]); this.out.line(); -+ this.out.block(`if (typeof rangeTo !== 'undefined' && block.header.height >= Number(rangeTo))`, () => { ++ let rangeTo = this.options.contracts[0].range.to; ++ this.out.block(`if (typeof ${rangeTo} !== 'undefined' && block.header.height >= Number(${rangeTo}))`, () => { + this.out.line(`ctx.store.setForceFlush(true)`); + }); -+ this.out.block(`else if (typeof rangeTo === 'undefined')`, () => { ++ this.out.block(`else if (typeof ${rangeTo} === 'undefined')`, () => { + this.out.line(`ctx.store.setForceFlush(true)`); + }); + this.out.line();