Skip to content

Commit

Permalink
chore: PSMCharter->EconCharter
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Dec 6, 2022
1 parent 2ce225a commit 77c5d31
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions packages/inter-protocol/scripts/add-collateral-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ export const psmGovernanceBuilder = async ({
psm: publishRef(
install('../src/psm/psm.js', '../bundles/bundle-psm.js'),
),
psmCharter: publishRef(
econCommitteeCharter: publishRef(
install(
'../src/psm/psmCharter.js',
'../bundles/bundle-psmCharter.js',
'../src/econCommitteeCharter.js',
'../bundles/bundle-econCommitteeCharter.js',
),
),
contractGovernor: publishRef(
Expand Down
19 changes: 12 additions & 7 deletions packages/inter-protocol/src/proposals/committee-proposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@ harden(inviteCommitteeMembers);
* @param {import('./econ-behaviors').EconomyBootstrapPowers} powers
*/
export const startEconCharter = async ({
consume: { zoe, agoricNames },
consume: { zoe },
produce: { econCharterStartResult },
installation: {
consume: { binaryVoteCounter: counterP },
consume: { binaryVoteCounter: counterP, econCommitteeCharter: installP },
},
instance: {
produce: { econCommitteeCharter: instanceP },
},
}) => {
// FIXME: why doesn't this use the promise space?
/** @type {[Installation, Installation]} */
const [charterInstall, counterInstall] = await Promise.all([
E(agoricNames).lookup('installation', 'econCommitteeCharter'),
installP,
counterP,
]);
const terms = await deeplyFulfilledObject(
Expand All @@ -66,6 +67,7 @@ export const startEconCharter = async ({
/** @type {Promise<import('./econ-behaviors').EconCharterStartResult>} */
const startResult = E(zoe).startInstance(charterInstall, undefined, terms);
econCharterStartResult.resolve(startResult);
instanceP.resolve(E.get(startResult).instance);
};
harden(startEconCharter);

Expand Down Expand Up @@ -139,10 +141,13 @@ export const getManifestForInviteCommittee = async (
consume: { namesByAddressAdmin: t, economicCommitteeCreatorFacet: t },
},
[startEconCharter.name]: {
consume: { zoe: t, agoricNames: t },
consume: { zoe: t },
produce: { econCharterStartResult: t },
installation: {
consume: { binaryVoteCounter: t },
consume: { binaryVoteCounter: t, econCommitteeCharter: t },
},
instance: {
produce: { econCommitteeCharter: t },
},
},
[addGovernorsToEconCharter.name]: {
Expand Down
8 changes: 3 additions & 5 deletions packages/inter-protocol/src/proposals/startPSM.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Stable } from '@agoric/vats/src/tokens.js';
import { deeplyFulfilledObject } from '@agoric/internal';
import { makeScalarMapStore } from '@agoric/vat-data';

import { reserveThenDeposit, reserveThenGetNamePaths } from './utils.js';
import { reserveThenGetNamePaths } from './utils.js';

import {
inviteCommitteeMembers,
Expand All @@ -18,8 +18,6 @@ import {
const BASIS_POINTS = 10000n;
const { details: X } = assert;

const { values } = Object;

export { inviteCommitteeMembers, startEconCharter, inviteToEconCharter };

/**
Expand Down Expand Up @@ -338,7 +336,7 @@ export const PSM_GOV_MANIFEST = {
},
},
[startEconCharter.name]: {
consume: { zoe: 'zoe' },
consume: { zoe: 'zoe', agoricNames: true },
produce: {
econCharterStartResult: 'econCommitteeCharter',
},
Expand Down Expand Up @@ -411,7 +409,7 @@ export const getManifestForPsmGovernance = (
return {
manifest,
installations: {
psmCharter: restoreRef(installKeys.psmCharter),
econCommitteeCharter: restoreRef(installKeys.econCommitteeCharter),
contractGovernor: restoreRef(installKeys.contractGovernor),
committee: restoreRef(installKeys.committee),
binaryVoteCounter: restoreRef(installKeys.binaryVoteCounter),
Expand Down
4 changes: 2 additions & 2 deletions packages/inter-protocol/test/psm/setupPsm.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
withAmountUtils,
} from '../supports.js';
import { startEconomicCommittee } from '../../src/proposals/startEconCommittee.js';
import { startPSM, startPSMCharter } from '../../src/proposals/startPSM.js';
import { startPSM, startEconCharter } from '../../src/proposals/startPSM.js';
import { allValues } from '../../src/collect.js';

const psmRoot = './src/psm/psm.js'; // package relative
Expand Down Expand Up @@ -141,7 +141,7 @@ export const setupPsm = async (
startEconomicCommittee(space, {
options: { econCommitteeOptions: electorateTerms },
}),
startPSMCharter(space),
startEconCharter(space),
startPSM(space, {
options: {
anchorOptions: {
Expand Down
3 changes: 0 additions & 3 deletions packages/vats/decentral-main-psm-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@
"psm": {
"sourceSpec": "@agoric/inter-protocol/src/psm/psm.js"
},
"psmCharter": {
"sourceSpec": "@agoric/inter-protocol/src/psm/psmCharter.js"
},
"bank": {
"sourceSpec": "@agoric/vats/src/vat-bank.js"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/vats/src/core/boot-psm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import {
installGovAndPSMContracts,
makeAnchorAsset,
startPSM,
inviteToPSMCharter,
inviteToEconCharter,
inviteCommitteeMembers,
PSM_MANIFEST,
PSM_GOV_MANIFEST,
startPSMCharter,
startEconCharter,
INVITE_PSM_COMMITTEE_MANIFEST,
} from '@agoric/inter-protocol/src/proposals/startPSM.js';
import * as startPSMmod from '@agoric/inter-protocol/src/proposals/startPSM.js';
Expand Down Expand Up @@ -201,7 +201,7 @@ export const buildRootObject = (vatPowers, vatParameters) => {
inviteCommitteeMembers(powersFor('inviteCommitteeMembers'), {
options: { voterAddresses: economicCommitteeAddresses },
}),
inviteToPSMCharter(powersFor('inviteToPSMCharter'), {
inviteToEconCharter(powersFor('inviteToEconCharter'), {
options: { voterAddresses: economicCommitteeAddresses },
}),
...anchorAssets.map(anchorOptions =>
Expand All @@ -214,7 +214,7 @@ export const buildRootObject = (vatPowers, vatParameters) => {
options: { anchorOptions },
}),
),
startPSMCharter(powersFor('startPSMCharter')),
startEconCharter(powersFor('startEconCharter')),
// Allow bootstrap powers to be granted by governance
// to code to be evaluated after initial bootstrap.
bridgeCoreEval(powersFor('bridgeCoreEval')),
Expand Down

0 comments on commit 77c5d31

Please sign in to comment.