diff --git a/scripts/clients.ts b/scripts/clients.ts index 1d8e1bfb..4f7bae9a 100644 --- a/scripts/clients.ts +++ b/scripts/clients.ts @@ -6,17 +6,6 @@ const batchConfig = {batch: {multicall: true}}; const clientCache: Record = {}; -const set = (obj, path, value) => { - // Regex explained: https://regexr.com/58j0k - const pathArray = Array.isArray(path) ? path : path.match(/([^[.\]])+/g); - - pathArray.reduce((acc, key, i) => { - if (acc[key] === undefined) acc[key] = {}; - if (i === pathArray.length - 1) acc[key] = value; - return acc[key]; - }, obj); -}; - export function getClient(chainId: number) { if (!clientCache[chainId]) { const rpcURL = getRPCUrl(chainId as any, {alchemyKey: process.env.ALCHEMY_API_KEY}); diff --git a/tests/__snapshots__/verification.spec.ts.snap b/tests/__snapshots__/verification.spec.ts.snap deleted file mode 100644 index 28465e46..00000000 --- a/tests/__snapshots__/verification.spec.ts.snap +++ /dev/null @@ -1,184 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`verification > should have all contracts verified except for the known set of errors 1`] = ` -[ - { - "item": { - "chainId": 1101, - "path": [ - "GovernanceV3PolygonZkEvm", - "PC_DATA_HELPER", - ], - "value": "0xF1c11BE0b4466728DDb7991A0Ac5265646ec9672", - }, - }, - { - "item": { - "chainId": 1, - "path": [ - "AaveV2EthereumAMM", - "UI_INCENTIVE_DATA_PROVIDER", - ], - "value": "0xD01ab9a6577E1D84F142e44D49380e23A340387d", - }, - }, - { - "item": { - "chainId": 137, - "path": [ - "AaveV2Polygon", - "UI_INCENTIVE_DATA_PROVIDER", - ], - "value": "0x645654D59A5226CBab969b1f5431aA47CBf64ab8", - }, - }, - { - "item": { - "chainId": 43113, - "path": [ - "AaveV2Fuji", - "POOL_IMPL", - ], - "value": "0x6C66d96ACCCCC2E6F576813A480AD230D56FB2F1", - }, - }, - { - "item": { - "chainId": 43113, - "path": [ - "AaveV2Fuji", - "ORACLE", - ], - "value": "0xfa4f5B081632c4709667D467F817C09d9008A46A", - }, - }, - { - "item": { - "chainId": 43113, - "path": [ - "AaveV2Fuji", - "LENDING_RATE_ORACLE", - ], - "value": "0x76Ec7c83aCb6af821E61F1DF1E0aBE684Bc904F8", - }, - }, - { - "item": { - "chainId": 43113, - "path": [ - "AaveV2Fuji", - "DEFAULT_INCENTIVES_CONTROLLER", - ], - "value": "0xa1EF206fb9a8D8186157FC817fCddcC47727ED55", - }, - }, - { - "item": { - "chainId": 43113, - "path": [ - "AaveV2Fuji", - "FAUCET", - ], - "value": "0x90E5BAc5A98fff59617080848959f44eACB4Cd7B", - }, - }, - { - "item": { - "chainId": 43113, - "path": [ - "AaveV2Fuji", - "UI_INCENTIVE_DATA_PROVIDER", - ], - "value": "0x9842E5B7b7C6cEDfB1952a388e050582Ff95645b", - }, - }, - { - "item": { - "chainId": 43114, - "path": [ - "AaveV2Avalanche", - "UI_INCENTIVE_DATA_PROVIDER", - ], - "value": "0x11979886A6dBAE27D7a72c49fCF3F23240D647bF", - }, - }, - { - "item": { - "chainId": 84532, - "path": [ - "AaveV3BaseSepolia", - "COLLECTOR", - ], - "value": "0x6414DE3F58d54Fb90636e8393F065fDFe34Da420", - }, - }, - { - "item": { - "chainId": 84532, - "path": [ - "AaveV3BaseSepolia", - "UMBRELLA", - ], - "value": "0xb939e96168a3953697B64DA8055570dee8735829", - }, - }, - { - "item": { - "chainId": 421614, - "path": [ - "AaveV3ArbitrumSepolia", - "ASSETS", - "USDC", - "INTEREST_RATE_STRATEGY", - ], - "value": "0x5C0A210C9C0df2Ab147BDE7D9583c07cEb3131CD", - }, - }, - { - "item": { - "chainId": 421614, - "path": [ - "AaveV3ArbitrumSepolia", - "ASSETS", - "WETH", - "INTEREST_RATE_STRATEGY", - ], - "value": "0x46d3a2A27E2c700d74f21AD3290A20cB8437F7b7", - }, - }, - { - "item": { - "chainId": 11155420, - "path": [ - "AaveV3OptimismSepolia", - "RATES_FACTORY", - ], - "value": "0x83E0E6095a318446b313f7D27e0c33Ed1e9c0213", - }, - }, - { - "item": { - "chainId": 11155420, - "path": [ - "AaveV3OptimismSepolia", - "ASSETS", - "USDC", - "INTEREST_RATE_STRATEGY", - ], - "value": "0xd6a6339c6C1B5a8792afA6e0E80b1908b8579f51", - }, - }, - { - "item": { - "chainId": 11155420, - "path": [ - "AaveV3OptimismSepolia", - "ASSETS", - "WETH", - "INTEREST_RATE_STRATEGY", - ], - "value": "0xaFb7Bc3f69A8Cc6a49823eFF9E3974CD49181A9c", - }, - }, -] -`; diff --git a/tests/generators/umbrella.spec.ts b/tests/generators/umbrella.spec.ts index 7c63ee80..b36cc769 100644 --- a/tests/generators/umbrella.spec.ts +++ b/tests/generators/umbrella.spec.ts @@ -1,6 +1,5 @@ import {describe, it, expect} from 'vitest'; import {getUmbrellaConfig} from '../../scripts/generator/umbrellaGenerator'; -import {rpcResponseCache} from '../../scripts/clients'; describe('umbrellaGenerator', () => { it('should generate the config', async () => { @@ -89,10 +88,14 @@ describe('umbrellaGenerator', () => { "0x98297F8CE8fBE6Ac21Baa23549389852D28715C4", "0xF045cAB6235e10116319D94B1c5970DAAe9b7136", "0x32735b634571904008D29086C95e90b558758F9f", + "0x7c743cCAE301b558D2DB0c72D6d69C792AA2E4c9", + "0x4Dc9749D5FF960e92b21800CC0a6fC7A2aD606f8", + "0x8d1dF6F3602f1Ca01f01F6e6d1071B205FbB0026", + "0xF2176ACe5DA79291D176C645a725eBa96A8f246D", + "0xC550C904e04C6046122C0271A5D90891870f8824", + "0xA821016E5A282676c07FeC5217016e229B518dE0", ], } `); - - console.log('cache', rpcResponseCache); }); }); diff --git a/tests/sanity/umbrella.spec.ts b/tests/sanity/umbrella.spec.ts index e11edb21..20361d63 100644 --- a/tests/sanity/umbrella.spec.ts +++ b/tests/sanity/umbrella.spec.ts @@ -24,7 +24,6 @@ export async function check(addresses: Record) { address: addresses.UMBRELLA, client, }); - console.log(addresses.UMBRELLA, addresses.CHAIN_ID); const [POOL] = await Promise.all([umbrella.read.POOL()]); expect(POOL).toEqual(addresses.POOL); } diff --git a/tests/verification.spec.ts b/tests/verification.spec.ts index c8d46e73..b4873c1a 100644 --- a/tests/verification.spec.ts +++ b/tests/verification.spec.ts @@ -4,6 +4,8 @@ import {flattenedAddresses, ListItem} from '../ui/src/utils/getAddresses'; import verified from './cache/verified.json'; import {writeFileSync} from 'fs'; import {Hex, PublicClient, zeroAddress} from 'viem'; +import {getCode} from 'viem/actions'; + import {getClient} from '../scripts/clients'; const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY as string; @@ -112,7 +114,7 @@ describe( if (checked.has(key)) continue; checked.add(key); const client = getClient(item.chainId) as PublicClient; - const hasCode = await client.getCode({address: item.value as Hex}); + const hasCode = await getCode(client, {address: item.value as Hex}); if (hasCode) { const {status, result} = (await checkVerified(item)) as { status: string;