From f1df33e557024b4ca879e9a1292e2f580f703ba3 Mon Sep 17 00:00:00 2001 From: Agustincito Date: Mon, 30 Dec 2024 15:03:02 -0300 Subject: [PATCH] Fix deployments type --- .changeset/clean-rivers-repeat.md | 5 +++++ deployments.ts | 12 +++++++++++- scripts/build-deployment-address.ts | 17 ++++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 .changeset/clean-rivers-repeat.md diff --git a/.changeset/clean-rivers-repeat.md b/.changeset/clean-rivers-repeat.md new file mode 100644 index 0000000..78b21f6 --- /dev/null +++ b/.changeset/clean-rivers-repeat.md @@ -0,0 +1,5 @@ +--- +'@secure-ci/core': patch +--- + +Fix deployments types diff --git a/deployments.ts b/deployments.ts index 23978a4..b71a594 100644 --- a/deployments.ts +++ b/deployments.ts @@ -1,4 +1,14 @@ -export const deployments = { +type DeploymentKeys = +| 'ProxyModule#SCI' +| 'SciRegistry#SciRegistry' +| 'EnsRegistrar#EnsRegistrar' +| 'PublicListVerifier#PublicListVerifier' +| 'ProxyModule#TransparentUpgradeableProxy' +| 'ProxyModule#ProxyAdmin' +| 'SciModule#SCI' +| 'SciRegstrar#SciRegistrar'; + +export const deployments: { [key: string]: { [key: DeploymentKeys]: string } } = { '10': { 'ProxyModule#SCI': '0xe324A37594561b3Bfe3f535Aa7108224a703710F', 'SciRegistry#SciRegistry': '0xaDD75Aecd98f0ADAD899729c88BfED4f8951c02A', diff --git a/scripts/build-deployment-address.ts b/scripts/build-deployment-address.ts index 79012fc..4e18a03 100644 --- a/scripts/build-deployment-address.ts +++ b/scripts/build-deployment-address.ts @@ -31,7 +31,22 @@ async function main() { } // Convert the output data into a TypeScript file - const tsContent = `export const deployments = ${JSON.stringify(outputData, null, 2) + const tsContent = +`type DeploymentKeys = +| 'ProxyModule#SCI' +| 'SciRegistry#SciRegistry' +| 'EnsRegistrar#EnsRegistrar' +| 'PublicListVerifier#PublicListVerifier' +| 'ProxyModule#TransparentUpgradeableProxy' +| 'ProxyModule#ProxyAdmin' +| 'SciModule#SCI' +| 'SciRegstrar#SciRegistrar'; + +export const deployments: { [key: string]: { [key: DeploymentKeys]: string } } = ${JSON.stringify( + outputData, + null, + 2, + ) .replace(/"/g, "'") .replace(/(?<=['}\]]),?\n/g, ',\n')};\n`;