diff --git a/package.json b/package.json index 881cf0d7..46ef12cd 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,8 @@ "start": "tsx scripts/generateABIs.ts && tsx scripts/generateAddresses.ts && npm run prettier", "build": "tsup", "test": "vitest run tests", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "test:snapshot": "npx vitest -u" }, "repository": { "type": "git", diff --git a/tests/__snapshots__/verification.spec.ts.snap b/tests/__snapshots__/verification.spec.ts.snap index 14d7f161..471f4218 100644 --- a/tests/__snapshots__/verification.spec.ts.snap +++ b/tests/__snapshots__/verification.spec.ts.snap @@ -12,6 +12,76 @@ exports[`verification > should have all contracts verified except for the known "value": "0xF1c11BE0b4466728DDb7991A0Ac5265646ec9672", }, }, + { + "item": { + "chainId": 42220, + "path": [ + "GovernanceV3Celo", + "CROSS_CHAIN_CONTROLLER", + ], + "value": "0x50F4dAA86F3c747ce15C3C38bD0383200B61d6Dd", + }, + }, + { + "item": { + "chainId": 42220, + "path": [ + "GovernanceV3Celo", + "CL_EMERGENCY_ORACLE", + ], + "value": "0x91b21900E91CD302EBeD05E45D8f270ddAED944d", + }, + }, + { + "item": { + "chainId": 42220, + "path": [ + "GovernanceV3Celo", + "PAYLOADS_CONTROLLER", + ], + "value": "0xE48E10834C04E394A04BF22a565D063D40b9FA42", + }, + }, + { + "item": { + "chainId": 42220, + "path": [ + "GovernanceV3Celo", + "PC_DATA_HELPER", + ], + "value": "0x8657Cd5a0957e8C5BE15c69C67078b5d730D720a", + }, + }, + { + "item": { + "chainId": 42220, + "path": [ + "GovernanceV3Celo", + "GRANULAR_GUARDIAN", + ], + "value": "0xbE815420A63A413BB8D508d8022C0FF150Ea7C39", + }, + }, + { + "item": { + "chainId": 42220, + "path": [ + "GovernanceV3Celo", + "GOVERNANCE_GUARDIAN", + ], + "value": "0x056E4C4E80D1D14a637ccbD0412CDAAEc5B51F4E", + }, + }, + { + "item": { + "chainId": 42220, + "path": [ + "GovernanceV3Celo", + "EXECUTOR_LVL_1", + ], + "value": "0x1dF462e2712496373A347f8ad10802a5E95f053D", + }, + }, { "item": { "chainId": 1, @@ -42,5 +112,35 @@ exports[`verification > should have all contracts verified except for the known "value": "0x11979886A6dBAE27D7a72c49fCF3F23240D647bF", }, }, + { + "item": { + "chainId": 42220, + "path": [ + "MiscCelo", + "TRANSPARENT_PROXY_FACTORY", + ], + "value": "0xAe13e4DA0952f0B8fE04E21df53716fCF799a923", + }, + }, + { + "item": { + "chainId": 42220, + "path": [ + "MiscCelo", + "PROXY_ADMIN", + ], + "value": "0x54BDcc37c4143f944A3EE51C892a6cBDF305E7a0", + }, + }, + { + "item": { + "chainId": 42220, + "path": [ + "MiscCelo", + "PROTOCOL_GUARDIAN", + ], + "value": "0x38BC0ED9d90Bc2309A436f4ED6Ca6Bc4D5C0DFA6", + }, + }, ] `; diff --git a/tests/verification.spec.ts b/tests/verification.spec.ts index 0ea8cbac..be94bc44 100644 --- a/tests/verification.spec.ts +++ b/tests/verification.spec.ts @@ -105,35 +105,35 @@ describe( // unique set of addresses checked on this iteration // used to prevent double checking the same address const checked = new Set(); - // for (const item of addressesToCheck) { - // const hasBeenCheckedBefore = verified[item.chainId][item.value]; - // if (!hasBeenCheckedBefore && item.value !== zeroAddress) { - // const key = `${item.chainId}-${item.value}`; - // if (checked.has(key)) continue; - // checked.add(key); - // const {status, result} = (await checkVerified(item)) as { - // status: string; - // result: {ContractName: string}[]; - // }; - // await sleep(300); - // if (status !== '1' || !result[0].ContractName) { - // errors.push({item}); - // console.log(result); - // } else { - // newVerified = true; - // if (!verified[item.chainId]) verified[item.chainId] = {}; - // verified[item.chainId][item.value] = { - // name: result[0].ContractName, - // }; - // } - // } - // } - // if (newVerified) { - // writeFileSync('./tests/cache/verified.json', JSON.stringify(verified, null, 2), { - // encoding: 'utf-8', - // }); - // } - // expect(errors).toMatchSnapshot(); + for (const item of addressesToCheck) { + const hasBeenCheckedBefore = verified[item.chainId]?.[item.value]; + if (!hasBeenCheckedBefore && item.value !== zeroAddress) { + const key = `${item.chainId}-${item.value}`; + if (checked.has(key)) continue; + checked.add(key); + const {status, result} = (await checkVerified(item)) as { + status: string; + result: {ContractName: string}[]; + }; + await sleep(300); + if (status !== '1' || !result[0].ContractName) { + errors.push({item}); + console.log(result); + } else { + newVerified = true; + if (!verified[item.chainId]) verified[item.chainId] = {}; + verified[item.chainId][item.value] = { + name: result[0].ContractName, + }; + } + } + } + if (newVerified) { + writeFileSync('./tests/cache/verified.json', JSON.stringify(verified, null, 2), { + encoding: 'utf-8', + }); + } + expect(errors).toMatchSnapshot(); }); }, {timeout: 120_000},