Skip to content

Commit

Permalink
fix: review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Aug 17, 2022
1 parent 94a9fad commit 0493dc1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
9 changes: 3 additions & 6 deletions packages/SwingSet/src/liveslots/virtualObjectManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ export function makeVirtualObjectManager(
// We normally consider `this` unsafe because of the hazard of a
// method of one abstraction being applied to an instance of
// another abstraction. To prevent that attack, the bound method
// checks that it is in the map in which such its representatives
// checks that it's `this` is in the map in which its representatives
// are registered.
const { method } = {
method(...args) {
Expand Down Expand Up @@ -769,14 +769,13 @@ export function makeVirtualObjectManager(
unweakable.add(state);
if (!facetNames) {
const context = { state };
// `context` does not need a linkToCohort because it holds the facets (which hold the cohort)
// `context` does not need a linkToCohort because it holds the
// facets (which hold the cohort)
unweakable.add(context);
const self = harden({ __proto__: prototypeTemplate });
context.self = self;
contextMapTemplate.set(self, context);
toHold = self;
// linkToCohort.set(Object.getPrototypeOf(toHold), toHold);
// unweakable.add(Object.getPrototypeOf(toHold));
toExpose = toHold;
harden(context);
} else {
Expand All @@ -790,8 +789,6 @@ export function makeVirtualObjectManager(
});
contextMapTemplate[name].set(facet, context);
facets[name] = facet;
// linkToCohort.set(Object.getPrototypeOf(facet), facet);
// unweakable.add(Object.getPrototypeOf(facet));
toExpose[name] = facet;
toHold.push(facet);
linkToCohort.set(facet, toHold);
Expand Down
4 changes: 2 additions & 2 deletions packages/governance/src/contractHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { Far } from '@endo/marshal';
import { makeStoredPublisherKit } from '@agoric/notifier';
import { keyEQ } from '@agoric/store';
import { getMethodNames, keyEQ } from '@agoric/store';
import { objectMap, ignoreContext } from '@agoric/vat-data';
import { assertElectorateMatches } from './contractGovernance/paramManager.js';
import { makeParamManagerFromTerms } from './contractGovernance/typedParamManager.js';
Expand Down Expand Up @@ -140,7 +140,7 @@ const facetHelpers = (zcf, paramManager) => {
// methods it has. There's no clean way to have contracts specify the APIs
// without also separately providing their names.
getGovernedApiNames: ({ facets }) =>
Object.keys(facets.governedApis || {}),
getMethodNames(facets.governedApis || {}),
});

return { governorFacet, limitedCreatorFacet };
Expand Down
2 changes: 1 addition & 1 deletion packages/inter-protocol/src/vaultFactory/vaultManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ const collateralBehavior = {
makeVaultInvitation: ({ state, facets: { self } }) => {
const { zcf } = provideEphemera(state.collateralBrand);
assert(zcf);
return zcf.makeInvitation(self.makeVaultKit, 'MakeVault');
return zcf.makeInvitation(seat => self.makeVaultKit(seat), 'MakeVault');
},
/** @param {MethodContext} context */
getSubscriber: ({ state }) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/store/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const { getPrototypeOf, create, fromEntries } = Object;
const { ownKeys, apply } = Reflect;

const compareStringifies = (left, right) => {
const compareStringified = (left, right) => {
left = String(left);
right = String(right);
// eslint-disable-next-line no-nested-ternary
Expand All @@ -21,7 +21,7 @@ export const getMethodNames = obj => {
result.push(...mNames);
obj = getPrototypeOf(obj);
}
result.sort(compareStringifies);
result.sort(compareStringified);
return harden(result);
};
harden(getMethodNames);
Expand Down
2 changes: 1 addition & 1 deletion packages/zoe/src/zoeService/zoe.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const makeZoeKit = (
} = makeZoeStorageManager(
createZCFVat,
getBundleCapForID,
feeMint.getFeeIssuerKit,
feeMintAccess => feeMint.getFeeIssuerKit(feeMintAccess),
shutdownZoeVat,
feeMint.getFeeIssuer(),
feeMint.getFeeBrand(),
Expand Down

0 comments on commit 0493dc1

Please sign in to comment.