Skip to content

Commit

Permalink
refactor(daemon): Make least-authority formula numbered (merge #2064)
Browse files Browse the repository at this point in the history
Converts the `least-authority` formula to a numbered, id512 equivalent. The formula number used will always be the zero id512, but this can be changed in the future.
  • Loading branch information
rekmarks authored Feb 13, 2024
2 parents 6353a3f + 9f04c3b commit fbdcc69
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 3 additions & 1 deletion packages/daemon/src/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ const makeEndoBootstrap = (
// Behold, self-referentiality:
// eslint-disable-next-line no-use-before-define
return { external: endoBootstrap, internal: undefined };
} else if (formulaIdentifier === 'least-authority') {
} else if (formulaType === 'least-authority-id512') {
return { external: leastAuthority, internal: undefined };
} else if (formulaIdentifier === 'web-page-js') {
if (persistencePowers.webPageBundlerFormula === undefined) {
Expand Down Expand Up @@ -449,6 +449,7 @@ const makeEndoBootstrap = (
const storeFormulaIdentifier = `pet-store-id512:${formulaNumber}`;
const inspectorFormulaIdentifier = `pet-inspector-id512:${formulaNumber}`;
const workerFormulaIdentifier = `worker-id512:${formulaNumber}`;
const leastAuthorityFormulaIdentifier = `least-authority-id512:${zero512}`;

// Behold, recursion:
// eslint-disable-next-line no-use-before-define
Expand All @@ -457,6 +458,7 @@ const makeEndoBootstrap = (
storeFormulaIdentifier,
inspectorFormulaIdentifier,
workerFormulaIdentifier,
leastAuthorityFormulaIdentifier,
terminator,
);
} else if (
Expand Down
6 changes: 1 addition & 5 deletions packages/daemon/src/formula-identifier.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
const { quote: q } = assert;

const numberlessFormulasIdentifiers = new Set([
'endo',
'least-authority',
'web-page-js',
]);
const numberlessFormulasIdentifiers = new Set(['endo', 'web-page-js']);

/**
* @param {string} formulaIdentifier
Expand Down
4 changes: 3 additions & 1 deletion packages/daemon/src/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ export const makeHostMaker = ({
* @param {string} storeFormulaIdentifier
* @param {string} inspectorFormulaIdentifier
* @param {string} mainWorkerFormulaIdentifier
* @param {string} leastAuthorityFormulaIdentifier
* @param {import('./types.js').Terminator} terminator
*/
const makeIdentifiedHost = async (
hostFormulaIdentifier,
storeFormulaIdentifier,
inspectorFormulaIdentifier,
mainWorkerFormulaIdentifier,
leastAuthorityFormulaIdentifier,
terminator,
) => {
terminator.thisDiesIfThatDies(storeFormulaIdentifier);
Expand Down Expand Up @@ -62,7 +64,7 @@ export const makeHostMaker = ({
specialNames: {
SELF: hostFormulaIdentifier,
INFO: inspectorFormulaIdentifier,
NONE: 'least-authority',
NONE: leastAuthorityFormulaIdentifier,
ENDO: 'endo',
},
terminator,
Expand Down

0 comments on commit fbdcc69

Please sign in to comment.