From db592166a98bdf52e046eb1751244b176b7816ec Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 30 Nov 2023 14:47:13 -0800 Subject: [PATCH] refactor: config proposal within package.json --- common.ts | 7 ++++--- proposals/16:upgrade-8/config.json | 5 ----- proposals/16:upgrade-8/package.json | 7 +++++++ proposals/29:upgrade-9/config.json | 6 ------ proposals/29:upgrade-9/package.json | 8 ++++++++ proposals/34:upgrade-10/config.json | 6 ------ proposals/34:upgrade-10/package.json | 6 ++++++ proposals/43:upgrade-11/config.json | 6 ------ proposals/43:upgrade-11/package.json | 6 ++++++ proposals/49:smart-wallet-nft/config.json | 3 --- proposals/49:smart-wallet-nft/package.json | 3 +++ proposals/53:kread-start/config.json | 3 --- proposals/53:kread-start/package.json | 3 +++ proposals/55:statom-vaults/config.json | 3 --- proposals/55:statom-vaults/package.json | 3 +++ proposals/63:upgrade-12/config.json | 6 ------ proposals/63:upgrade-12/package.json | 6 ++++++ proposals/b:zoe1/config.json | 3 --- proposals/b:zoe1/package.json | 3 +++ 19 files changed, 49 insertions(+), 44 deletions(-) delete mode 100644 proposals/16:upgrade-8/config.json create mode 100644 proposals/16:upgrade-8/package.json delete mode 100644 proposals/29:upgrade-9/config.json create mode 100644 proposals/29:upgrade-9/package.json delete mode 100644 proposals/34:upgrade-10/config.json delete mode 100644 proposals/43:upgrade-11/config.json delete mode 100644 proposals/49:smart-wallet-nft/config.json delete mode 100644 proposals/53:kread-start/config.json delete mode 100644 proposals/55:statom-vaults/config.json delete mode 100644 proposals/63:upgrade-12/config.json delete mode 100644 proposals/b:zoe1/config.json diff --git a/common.ts b/common.ts index b50d454e..8642afa4 100644 --- a/common.ts +++ b/common.ts @@ -26,11 +26,12 @@ export type CoreEvalProposal = ProposalCommon & { export type ProposalInfo = SoftwareUpgradeProposal | CoreEvalProposal; function readInfo(proposalPath: string): ProposalInfo { - const configPath = path.join('proposals', proposalPath, 'config.json'); - const config = fs.readFileSync(configPath, 'utf-8'); + const packageJsonPath = path.join('proposals', proposalPath, 'package.json'); + const packageJson = fs.readFileSync(packageJsonPath, 'utf-8'); + const { agoricProposal } = JSON.parse(packageJson); const [proposalIdentifier, proposalName] = proposalPath.split(':'); return { - ...JSON.parse(config), + ...agoricProposal, proposalIdentifier, proposalName, }; diff --git a/proposals/16:upgrade-8/config.json b/proposals/16:upgrade-8/config.json deleted file mode 100644 index 156f9c87..00000000 --- a/proposals/16:upgrade-8/config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdkImageTag": "29", - "planName": "agoric-upgrade-8", - "type": "Software Upgrade Proposal" -} diff --git a/proposals/16:upgrade-8/package.json b/proposals/16:upgrade-8/package.json new file mode 100644 index 00000000..8d9e9d09 --- /dev/null +++ b/proposals/16:upgrade-8/package.json @@ -0,0 +1,7 @@ +{ + "agoricProposal": { + "sdkImageTag": "29", + "planName": "agoric-upgrade-8", + "type": "Software Upgrade Proposal" + } +} diff --git a/proposals/29:upgrade-9/config.json b/proposals/29:upgrade-9/config.json deleted file mode 100644 index f475c855..00000000 --- a/proposals/29:upgrade-9/config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "releaseNotes": "https://github.com/Agoric/agoric-sdk/releases/tag/pismoC", - "sdkImageTag": "31", - "planName": "agoric-upgrade-9", - "type": "Software Upgrade Proposal" -} diff --git a/proposals/29:upgrade-9/package.json b/proposals/29:upgrade-9/package.json new file mode 100644 index 00000000..4d5a3166 --- /dev/null +++ b/proposals/29:upgrade-9/package.json @@ -0,0 +1,8 @@ +{ + "agoricProposal": { + "releaseNotes": "https://github.com/Agoric/agoric-sdk/releases/tag/pismoC", + "sdkImageTag": "31", + "planName": "agoric-upgrade-9", + "type": "Software Upgrade Proposal" + } +} diff --git a/proposals/34:upgrade-10/config.json b/proposals/34:upgrade-10/config.json deleted file mode 100644 index 65fe10b0..00000000 --- a/proposals/34:upgrade-10/config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "releaseNotes": "https://github.com/Agoric/agoric-sdk/releases/tag/mainnet1B-rc3", - "sdkImageTag": "35", - "planName": "agoric-upgrade-10", - "type": "Software Upgrade Proposal" -} diff --git a/proposals/34:upgrade-10/package.json b/proposals/34:upgrade-10/package.json index 3f9dd87a..86ead8e9 100644 --- a/proposals/34:upgrade-10/package.json +++ b/proposals/34:upgrade-10/package.json @@ -1,4 +1,10 @@ { + "agoricProposal": { + "releaseNotes": "https://github.com/Agoric/agoric-sdk/releases/tag/mainnet1B-rc3", + "sdkImageTag": "35", + "planName": "agoric-upgrade-10", + "type": "Software Upgrade Proposal" + }, "type": "module", "license": "Apache-2.0", "dependencies": { diff --git a/proposals/43:upgrade-11/config.json b/proposals/43:upgrade-11/config.json deleted file mode 100644 index 687818c3..00000000 --- a/proposals/43:upgrade-11/config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "releaseNotes": "https://github.com/Agoric/agoric-sdk/releases/tag/agoric-upgrade-11", - "sdkImageTag": "36", - "planName": "agoric-upgrade-11", - "type": "Software Upgrade Proposal" -} diff --git a/proposals/43:upgrade-11/package.json b/proposals/43:upgrade-11/package.json index 3f9dd87a..53813c5b 100644 --- a/proposals/43:upgrade-11/package.json +++ b/proposals/43:upgrade-11/package.json @@ -1,4 +1,10 @@ { + "agoricProposal": { + "releaseNotes": "https://github.com/Agoric/agoric-sdk/releases/tag/agoric-upgrade-11", + "sdkImageTag": "36", + "planName": "agoric-upgrade-11", + "type": "Software Upgrade Proposal" + }, "type": "module", "license": "Apache-2.0", "dependencies": { diff --git a/proposals/49:smart-wallet-nft/config.json b/proposals/49:smart-wallet-nft/config.json deleted file mode 100644 index 8acfb07d..00000000 --- a/proposals/49:smart-wallet-nft/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "/agoric.swingset.CoreEvalProposal" -} diff --git a/proposals/49:smart-wallet-nft/package.json b/proposals/49:smart-wallet-nft/package.json index cce81aaf..88192823 100644 --- a/proposals/49:smart-wallet-nft/package.json +++ b/proposals/49:smart-wallet-nft/package.json @@ -1,4 +1,7 @@ { + "agoricProposal": { + "type": "/agoric.swingset.CoreEvalProposal" + }, "type": "module", "license": "Apache-2.0", "dependencies": { diff --git a/proposals/53:kread-start/config.json b/proposals/53:kread-start/config.json deleted file mode 100644 index 8acfb07d..00000000 --- a/proposals/53:kread-start/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "/agoric.swingset.CoreEvalProposal" -} diff --git a/proposals/53:kread-start/package.json b/proposals/53:kread-start/package.json index f13654f5..a7c82063 100644 --- a/proposals/53:kread-start/package.json +++ b/proposals/53:kread-start/package.json @@ -1,4 +1,7 @@ { + "agoricProposal": { + "type": "/agoric.swingset.CoreEvalProposal" + }, "type": "module", "license": "Apache-2.0", "dependencies": { diff --git a/proposals/55:statom-vaults/config.json b/proposals/55:statom-vaults/config.json deleted file mode 100644 index 8acfb07d..00000000 --- a/proposals/55:statom-vaults/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "/agoric.swingset.CoreEvalProposal" -} diff --git a/proposals/55:statom-vaults/package.json b/proposals/55:statom-vaults/package.json index cce81aaf..88192823 100644 --- a/proposals/55:statom-vaults/package.json +++ b/proposals/55:statom-vaults/package.json @@ -1,4 +1,7 @@ { + "agoricProposal": { + "type": "/agoric.swingset.CoreEvalProposal" + }, "type": "module", "license": "Apache-2.0", "dependencies": { diff --git a/proposals/63:upgrade-12/config.json b/proposals/63:upgrade-12/config.json deleted file mode 100644 index d3c13c23..00000000 --- a/proposals/63:upgrade-12/config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "releaseNotes": "https://github.com/Agoric/agoric-sdk/releases/tag/agoric-upgrade-12", - "sdkImageTag": "38", - "planName": "agoric-upgrade-12", - "type": "Software Upgrade Proposal" -} diff --git a/proposals/63:upgrade-12/package.json b/proposals/63:upgrade-12/package.json index c001a9a4..62567749 100644 --- a/proposals/63:upgrade-12/package.json +++ b/proposals/63:upgrade-12/package.json @@ -1,4 +1,10 @@ { + "agoricProposal": { + "releaseNotes": "https://github.com/Agoric/agoric-sdk/releases/tag/agoric-upgrade-12", + "sdkImageTag": "38", + "planName": "agoric-upgrade-12", + "type": "Software Upgrade Proposal" + }, "type": "module", "license": "Apache-2.0", "dependencies": { diff --git a/proposals/b:zoe1/config.json b/proposals/b:zoe1/config.json deleted file mode 100644 index 8acfb07d..00000000 --- a/proposals/b:zoe1/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "/agoric.swingset.CoreEvalProposal" -} diff --git a/proposals/b:zoe1/package.json b/proposals/b:zoe1/package.json index e4be4155..99ec844f 100644 --- a/proposals/b:zoe1/package.json +++ b/proposals/b:zoe1/package.json @@ -1,4 +1,7 @@ { + "agoricProposal": { + "type": "/agoric.swingset.CoreEvalProposal" + }, "type": "module", "license": "Apache-2.0", "dependencies": {