From b25af50ec302056aa4f14d27bb16d87b20776f2d Mon Sep 17 00:00:00 2001 From: Bruno Menezes Date: Tue, 18 Jun 2024 10:14:45 +1200 Subject: [PATCH] feat: Add support to base and base-sepolia. (#34) --- .env | 2 + package-lock.json | 131 +++++++--------------------------------- package.json | 3 +- src/config.ts | 63 +++++++++++++++++-- tests/processor.test.ts | 96 +++++++++++++++++++++++++++++ 5 files changed, 177 insertions(+), 118 deletions(-) diff --git a/.env b/.env index bcb2f4c..303b76a 100644 --- a/.env +++ b/.env @@ -9,6 +9,8 @@ CHAIN_ID="11155111" # RPC_URL_31337= # RPC_URL_10= # RPC_URL_11155420= +# RPC_URL_8453= +# RPC_URL_84532= # NORMALLY FOR USE WITH LOCAL/DEV # GENESIS_BLOCK_31337=22 # BLOCK_CONFIRMATIONS_31337=1 diff --git a/package-lock.json b/package-lock.json index 47787fd..aa455f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,7 @@ "version": "0.1.0", "license": "Apache-2.0", "dependencies": { - "@cartesi/rollups": "1.2.0", - "@subsquid/archive-registry": "^3.2.0", + "@cartesi/rollups": "1.4.0", "@subsquid/evm-processor": "^1.4.0", "@subsquid/file-store": "^2.0.0", "@subsquid/graphql-server": "^4.2.0", @@ -217,18 +216,18 @@ "dev": true }, "node_modules/@cartesi/rollups": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@cartesi/rollups/-/rollups-1.2.0.tgz", - "integrity": "sha512-oLm/JYuRpUD6bg8UKFZjdSJRZ1CWOd5SM6xnjvRKMisGZcJzULYHuuzZMSMONpnFVQhFXrwJF4q0tzcOAK4oDw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@cartesi/rollups/-/rollups-1.4.0.tgz", + "integrity": "sha512-remwnm4Rgkhzoc3F2YQw4nXJk0ggvmwdgGQxF5Gps7Ej3zY2qLCUS7OscMX5P9RFjpWnJ7mtlEXydVaUR4XXrQ==", "dependencies": { - "@cartesi/util": "6.1.0", + "@cartesi/util": "6.3.0", "@openzeppelin/contracts": "4.9.2" } }, "node_modules/@cartesi/util": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@cartesi/util/-/util-6.1.0.tgz", - "integrity": "sha512-j92nSoMHCyu6h7nZgn+MeXjkp8oa1Cy6qaImyxVXmPN2Rcqzl/TkWm/RkhbODU9rh4U3OuUteYqKRjefI3/XIQ==" + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@cartesi/util/-/util-6.3.0.tgz", + "integrity": "sha512-UgsyTklI4mf3ZbnPHQTuYJcMyldM3y9Xm+ib9xBgDzDq6TxMO81xkrPv/gwA23seHL2/bkJ5flXJEhCE8poW8Q==" }, "node_modules/@colors/colors": { "version": "1.5.0", @@ -16599,21 +16598,6 @@ "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==" }, - "node_modules/@subsquid/archive-registry": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@subsquid/archive-registry/-/archive-registry-3.3.2.tgz", - "integrity": "sha512-8Zt+Kr8z/mapouRsr90EbfMH2t5KaaSOg7oQYmIqF8ndUeEwa2b23Bb8xNaoo3uvVL2UUM9oxxuxmCf9ixZC7Q==", - "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", - "dependencies": { - "@subsquid/util-internal": "^1.0.0", - "commander": "^10.0.0", - "easy-table": "^1.2.0", - "sync-fetch": "^0.5.2" - }, - "bin": { - "squid-archive-registry": "bin/run.js" - } - }, "node_modules/@subsquid/cli": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/@subsquid/cli/-/cli-2.11.0.tgz", @@ -17192,11 +17176,6 @@ "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-3.2.0.tgz", "integrity": "sha512-foNCjOmZaP8MKMa9sNe2GXTjFSDM9UqA0I0C0/ZvCxM1lCmG3mxZb70f8Wyi7TePXC/eV8eARbIqFyz0GjQmzA==" }, - "node_modules/@subsquid/util-internal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-1.1.0.tgz", - "integrity": "sha512-O6m666RDcWEw4vb3bmeNZKlAa1rGOHQvS0nhZFTBXnxZpqK/pU5N0jrQ7X/3is0pY2RKxFoxTurZjhv4QdxtqA==" - }, "node_modules/@subsquid/util-internal-archive-client": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@subsquid/util-internal-archive-client/-/util-internal-archive-client-0.1.2.tgz", @@ -18857,7 +18836,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", - "devOptional": true, + "dev": true, "engines": { "node": ">=0.8" } @@ -18921,14 +18900,6 @@ "node": ">= 0.8" } }, - "node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "engines": { - "node": ">=14" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -19142,7 +19113,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", - "devOptional": true, + "dev": true, "dependencies": { "clone": "^1.0.2" }, @@ -19289,17 +19260,6 @@ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, - "node_modules/easy-table": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.2.0.tgz", - "integrity": "sha512-OFzVOv03YpvtcWGe5AayU5G2hgybsg3iqA6drU8UaoZyB9jLGMTrz9+asnLp/E+6qPh88yEI1gvyZFZ41dmgww==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "optionalDependencies": { - "wcwidth": "^1.0.1" - } - }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -23585,17 +23545,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/sync-fetch": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/sync-fetch/-/sync-fetch-0.5.2.tgz", - "integrity": "sha512-6gBqqkHrYvkH65WI2bzrDwrIKmt3U10s4Exnz3dYuE5Ah62FIfNv/F63inrNhu2Nyh3GH5f42GKU3RrSJoaUyQ==", - "dependencies": { - "node-fetch": "^2.6.1" - }, - "engines": { - "node": ">=14" - } - }, "node_modules/targz": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/targz/-/targz-1.0.1.tgz", @@ -24620,7 +24569,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", - "devOptional": true, + "dev": true, "dependencies": { "defaults": "^1.0.3" } @@ -25090,18 +25039,18 @@ "dev": true }, "@cartesi/rollups": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@cartesi/rollups/-/rollups-1.2.0.tgz", - "integrity": "sha512-oLm/JYuRpUD6bg8UKFZjdSJRZ1CWOd5SM6xnjvRKMisGZcJzULYHuuzZMSMONpnFVQhFXrwJF4q0tzcOAK4oDw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@cartesi/rollups/-/rollups-1.4.0.tgz", + "integrity": "sha512-remwnm4Rgkhzoc3F2YQw4nXJk0ggvmwdgGQxF5Gps7Ej3zY2qLCUS7OscMX5P9RFjpWnJ7mtlEXydVaUR4XXrQ==", "requires": { - "@cartesi/util": "6.1.0", + "@cartesi/util": "6.3.0", "@openzeppelin/contracts": "4.9.2" } }, "@cartesi/util": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@cartesi/util/-/util-6.1.0.tgz", - "integrity": "sha512-j92nSoMHCyu6h7nZgn+MeXjkp8oa1Cy6qaImyxVXmPN2Rcqzl/TkWm/RkhbODU9rh4U3OuUteYqKRjefI3/XIQ==" + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@cartesi/util/-/util-6.3.0.tgz", + "integrity": "sha512-UgsyTklI4mf3ZbnPHQTuYJcMyldM3y9Xm+ib9xBgDzDq6TxMO81xkrPv/gwA23seHL2/bkJ5flXJEhCE8poW8Q==" }, "@colors/colors": { "version": "1.5.0", @@ -36792,17 +36741,6 @@ "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==" }, - "@subsquid/archive-registry": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@subsquid/archive-registry/-/archive-registry-3.3.2.tgz", - "integrity": "sha512-8Zt+Kr8z/mapouRsr90EbfMH2t5KaaSOg7oQYmIqF8ndUeEwa2b23Bb8xNaoo3uvVL2UUM9oxxuxmCf9ixZC7Q==", - "requires": { - "@subsquid/util-internal": "^1.0.0", - "commander": "^10.0.0", - "easy-table": "^1.2.0", - "sync-fetch": "^0.5.2" - } - }, "@subsquid/cli": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/@subsquid/cli/-/cli-2.11.0.tgz", @@ -37276,11 +37214,6 @@ } } }, - "@subsquid/util-internal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-1.1.0.tgz", - "integrity": "sha512-O6m666RDcWEw4vb3bmeNZKlAa1rGOHQvS0nhZFTBXnxZpqK/pU5N0jrQ7X/3is0pY2RKxFoxTurZjhv4QdxtqA==" - }, "@subsquid/util-internal-archive-client": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@subsquid/util-internal-archive-client/-/util-internal-archive-client-0.1.2.tgz", @@ -38623,7 +38556,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", - "devOptional": true + "dev": true }, "cluster-key-slot": { "version": "1.1.2", @@ -38672,11 +38605,6 @@ "delayed-stream": "~1.0.0" } }, - "commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==" - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -38850,7 +38778,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", - "devOptional": true, + "dev": true, "requires": { "clone": "^1.0.2" } @@ -38951,15 +38879,6 @@ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, - "easy-table": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.2.0.tgz", - "integrity": "sha512-OFzVOv03YpvtcWGe5AayU5G2hgybsg3iqA6drU8UaoZyB9jLGMTrz9+asnLp/E+6qPh88yEI1gvyZFZ41dmgww==", - "requires": { - "ansi-regex": "^5.0.1", - "wcwidth": "^1.0.1" - } - }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -42049,14 +41968,6 @@ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" }, - "sync-fetch": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/sync-fetch/-/sync-fetch-0.5.2.tgz", - "integrity": "sha512-6gBqqkHrYvkH65WI2bzrDwrIKmt3U10s4Exnz3dYuE5Ah62FIfNv/F63inrNhu2Nyh3GH5f42GKU3RrSJoaUyQ==", - "requires": { - "node-fetch": "^2.6.1" - } - }, "targz": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/targz/-/targz-1.0.1.tgz", @@ -42712,7 +42623,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", - "devOptional": true, + "dev": true, "requires": { "defaults": "^1.0.3" } diff --git a/package.json b/package.json index 6198f83..d4a5498 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,7 @@ "serve:prod": "node deploy/run --npmScriptName=sqd:graphql:prod" }, "dependencies": { - "@cartesi/rollups": "1.2.0", - "@subsquid/archive-registry": "^3.2.0", + "@cartesi/rollups": "1.4.0", "@subsquid/evm-processor": "^1.4.0", "@subsquid/file-store": "^2.0.0", "@subsquid/graphql-server": "^4.2.0", diff --git a/src/config.ts b/src/config.ts index 8a9f910..12514b3 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,3 +1,7 @@ +import CartesiDAppFactoryBase from '@cartesi/rollups/deployments/base/CartesiDAppFactory.json'; +import inputBoxBase from '@cartesi/rollups/deployments/base/InputBox.json'; +import CartesiDAppFactoryBaseSepolia from '@cartesi/rollups/deployments/base_sepolia/CartesiDAppFactory.json'; +import InputBoxBaseSepolia from '@cartesi/rollups/deployments/base_sepolia/InputBox.json'; import CartesiDAppFactoryMainnet from '@cartesi/rollups/deployments/mainnet/CartesiDAppFactory.json'; import InputBoxMainnet from '@cartesi/rollups/deployments/mainnet/InputBox.json'; import CartesiDAppFactoryOptimism from '@cartesi/rollups/deployments/optimism/CartesiDAppFactory.json'; @@ -7,9 +11,8 @@ import InputBoxOptimismSepolia from '@cartesi/rollups/deployments/optimism_sepol import CartesiDAppFactorySepolia from '@cartesi/rollups/deployments/sepolia/CartesiDAppFactory.json'; import InputBoxSepolia from '@cartesi/rollups/deployments/sepolia/InputBox.json'; import mainnet from '@cartesi/rollups/export/abi/mainnet.json'; -import { lookupArchive } from '@subsquid/archive-registry'; import { DataSource } from '@subsquid/evm-processor'; -import { optimism, optimismSepolia } from 'viem/chains'; +import { base, baseSepolia, optimism, optimismSepolia } from 'viem/chains'; // addresses are the same on all chains export const CartesiDAppFactoryAddress = @@ -30,6 +33,22 @@ export type ProcessorConfig = { finalityConfirmation?: number; }; +/** + * Archive nodes raw gateway URLs more info {@link https://docs.subsquid.io/glossary/#archive-registry} + * + * To find a new URL run the following command + * @example + * npm run sqd gateways ls + */ +const archiveNodes = { + base: 'https://v2.archive.subsquid.io/network/base-mainnet', + baseSepolia: 'https://v2.archive.subsquid.io/network/base-sepolia', + optimism: 'https://v2.archive.subsquid.io/network/optimism-mainnet', + optimismSepolia: 'https://v2.archive.subsquid.io/network/optimism-sepolia', + mainnet: 'https://v2.archive.subsquid.io/network/ethereum-mainnet', + sepolia: 'https://v2.archive.subsquid.io/network/ethereum-sepolia', +} as const; + const FINALITY_CONFIRMATION = 10 as const; const LOCAL_GENESIS_BLOCK = 22 as const; @@ -41,7 +60,7 @@ export const getConfig = (chainId: number): ProcessorConfig => { case 1: // mainnet return { dataSource: { - archive: lookupArchive('eth-mainnet'), + archive: archiveNodes.mainnet, chain: process.env[RPC_URL] ?? 'https://rpc.ankr.com/eth', }, from: Math.min( @@ -56,7 +75,7 @@ export const getConfig = (chainId: number): ProcessorConfig => { case 11155111: // sepolia return { dataSource: { - archive: lookupArchive('eth-sepolia'), + archive: archiveNodes.sepolia, chain: process.env[RPC_URL] ?? 'https://rpc.ankr.com/eth_sepolia', @@ -73,7 +92,7 @@ export const getConfig = (chainId: number): ProcessorConfig => { case 10: //Optimism-Mainnet return { dataSource: { - archive: lookupArchive('optimism-mainnet'), + archive: archiveNodes.optimism, chain: process.env[RPC_URL] ?? optimism.rpcUrls.default.http[0], @@ -90,7 +109,7 @@ export const getConfig = (chainId: number): ProcessorConfig => { case 11155420: //Optimism-Sepolia return { dataSource: { - archive: lookupArchive('optimism-sepolia'), + archive: archiveNodes.optimismSepolia, chain: process.env[RPC_URL] ?? optimismSepolia.rpcUrls.default.http[0], @@ -104,6 +123,38 @@ export const getConfig = (chainId: number): ProcessorConfig => { value: process.env[BLOCK_CONFIRMATIONS], }), }; + case 8453: //Base-Mainnet + return { + dataSource: { + archive: archiveNodes.base, + chain: process.env[RPC_URL] ?? base.rpcUrls.default.http[0], + }, + from: Math.min( + CartesiDAppFactoryBase.receipt.blockNumber, + inputBoxBase.receipt.blockNumber, + ), + finalityConfirmation: parseIntOr({ + defaultVal: FINALITY_CONFIRMATION, + value: process.env[BLOCK_CONFIRMATIONS], + }), + }; + case 84532: //Base-Sepolia + return { + dataSource: { + archive: archiveNodes.baseSepolia, + chain: + process.env[RPC_URL] ?? + baseSepolia.rpcUrls.default.http[0], + }, + from: Math.min( + CartesiDAppFactoryBaseSepolia.receipt.blockNumber, + InputBoxBaseSepolia.receipt.blockNumber, + ), + finalityConfirmation: parseIntOr({ + defaultVal: FINALITY_CONFIRMATION, + value: process.env[BLOCK_CONFIRMATIONS], + }), + }; case 31337: // anvil return { dataSource: { diff --git a/tests/processor.test.ts b/tests/processor.test.ts index 14d993c..15c4a99 100644 --- a/tests/processor.test.ts +++ b/tests/processor.test.ts @@ -27,6 +27,8 @@ const mainnet = 1; const local = 31337; const optimism = 10; const optimismSepolia = 11155420; +const base = 8453; +const baseSepolia = 84532; describe('Processor creation', () => { beforeEach(() => { @@ -47,6 +49,100 @@ describe('Processor creation', () => { } }); + test('Required configs for base', () => { + const processor = createProcessor(base); + const applicationMetadata = loadApplications(base); + + expect(processor.setDataSource).toHaveBeenCalledWith({ + archive: 'https://v2.archive.subsquid.io/network/base-mainnet', + chain: 'https://mainnet.base.org', + }); + + expect(processor.setFinalityConfirmation).toHaveBeenCalledWith(10); + expect(processor.setFields).toHaveBeenCalledWith({ + transaction: { + chainId: true, + from: true, + hash: true, + value: true, + }, + }); + expect(processor.setBlockRange).toHaveBeenCalledWith({ + from: 12987716, + }); + + const addLog = processor.addLog as unknown as MockInstance; + + expect(addLog).toHaveBeenCalledTimes(3); + expect(addLog.mock.calls[0][0]).toEqual({ + address: ['0x7122cd1221c20892234186facfe8615e6743ab02'], + topic0: [ + '0xe73165c2d277daf8713fd08b40845cb6bb7a20b2b543f3d35324a475660fcebd', + ], + }); + expect(addLog.mock.calls[1][0]).toEqual({ + address: ['0x59b22d57d4f067708ab0c00552767405926dc768'], + topic0: [ + '0x6aaa400068bf4ca337265e2a1e1e841f66b8597fd5b452fdc52a44bed28a0784', + ], + transaction: true, + }); + + expect(addLog.mock.calls[2][0]).toEqual({ + topic0: [ + '0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0', + ], + transaction: true, + }); + }); + + test('Required configs for base-sepolia', () => { + const processor = createProcessor(baseSepolia); + const applicationMetadata = loadApplications(baseSepolia); + + expect(processor.setDataSource).toHaveBeenCalledWith({ + archive: 'https://v2.archive.subsquid.io/network/base-sepolia', + chain: 'https://sepolia.base.org', + }); + + expect(processor.setFinalityConfirmation).toHaveBeenCalledWith(10); + expect(processor.setFields).toHaveBeenCalledWith({ + transaction: { + chainId: true, + from: true, + hash: true, + value: true, + }, + }); + expect(processor.setBlockRange).toHaveBeenCalledWith({ + from: 8688714, + }); + + const addLog = processor.addLog as unknown as MockInstance; + + expect(addLog).toHaveBeenCalledTimes(3); + expect(addLog.mock.calls[0][0]).toEqual({ + address: ['0x7122cd1221c20892234186facfe8615e6743ab02'], + topic0: [ + '0xe73165c2d277daf8713fd08b40845cb6bb7a20b2b543f3d35324a475660fcebd', + ], + }); + expect(addLog.mock.calls[1][0]).toEqual({ + address: ['0x59b22d57d4f067708ab0c00552767405926dc768'], + topic0: [ + '0x6aaa400068bf4ca337265e2a1e1e841f66b8597fd5b452fdc52a44bed28a0784', + ], + transaction: true, + }); + + expect(addLog.mock.calls[2][0]).toEqual({ + topic0: [ + '0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0', + ], + transaction: true, + }); + }); + test('Required configs for sepolia', () => { const processor = createProcessor(sepolia); const applicationMetadata = loadApplications(sepolia);