Skip to content

Commit

Permalink
feat: builder script for replacing committee and charter
Browse files Browse the repository at this point in the history
  • Loading branch information
rabi-siddique committed Sep 26, 2024
1 parent cfe20f4 commit fff596d
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 2 deletions.
35 changes: 35 additions & 0 deletions packages/builders/scripts/inter-protocol/ec-changes-core.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* global process */

Check failure on line 1 in packages/builders/scripts/inter-protocol/ec-changes-core.js

View workflow job for this annotation

GitHub Actions / lint-rest

'process' is defined but never used. Allowed unused vars must match /^_/u

import { makeHelpers } from '@agoric/deploy-script-support';
import { getManifestForReplaceCommitteeAndCharter } from '@agoric/inter-protocol/src/proposals/replaceCommitteeAndCharter';

/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
return harden({
sourceSpec:
'@agoric/inter-protocol/src/proposals/replaceCommitteeAndCharter.js',
getManifestCall: [
getManifestForReplaceCommitteeAndCharter.name,
{
...opts,
economicCommitteeRef: publishRef(
install(
'@agoric/governance/src/committee.js',
'@agoric/governance/bundles/bundle-committee.js',
),
),
economicCharterRef: publishRef(
install(
'@agoric/inter-protocol/src/econCommitteeCharter.js',
'@agoric/inter-protocol/bundles/bundle-econCommitteeCharter.js',
),
),
},
],
});
};

export default async (homeP, endowments) => {
const { writeCoreEval } = await makeHelpers(homeP, endowments);
await writeCoreEval('replace-committee-and-charter', defaultProposalBuilder);
};
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ const shutdown = async ({
trace('EC Charter shutdown successful');
};

const main = async permittedPowers => {
const replaceCommitteeAndCharter = async permittedPowers => {
await shutdown(permittedPowers);
await startNewEconomicCommittee(permittedPowers);
await startNewEconCharter(permittedPowers);
Expand Down Expand Up @@ -377,4 +377,52 @@ const main = async permittedPowers => {
trace('Installed New Economic Committee');
};

main;
export const getManifestForReplaceCommitteeAndCharter = async ({
economicCommitteeRef: _economicCommitteeRef,
economicCharterRef: _economicCharterRef,
}) => ({
manifest: {
[replaceCommitteeAndCharter.name]: {
consume: {
board: true,
chainStorage: true,
econCharterKit: true,
economicCommitteeCreatorFacet: true,
highPrioritySendersManager: true,
instancePrivateArgs: true,
namesByAddressAdmin: true,
priceAuthority: true,
priceAuthorityAdmin: true,
reserveKit: true,
vaultFactoryKit: true,
auctioneerKit: true,
psmKit: true,
zoe: true,
},
produce: {
economicCommittee: true,
economicCommitteeCreatorFacet: true,
econCharterKit: true,
econCommitteeCharter: true,
},
installation: {
consume: {
committee: true,
econCommitteeCharter: true,
binaryVoteCounter: true,
},
},
instance: {
consume: {
reserve: true,
VaultFactory: true,
auctioneer: true,
},
produce: {
economicCommittee: true,
econCommitteeCharter: true,
},
},
},
},
});

0 comments on commit fff596d

Please sign in to comment.