Skip to content

Commit

Permalink
chore: review cleanups: types and variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Hibbert committed Jan 5, 2024
1 parent b2ace08 commit 70dccf5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
13 changes: 6 additions & 7 deletions packages/inter-protocol/test/vaultFactory/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ const setupServices = async (t, initialPrice, priceBase) => {
t.context.consume = consume;

// priceAuthorityReg is the registry, which contains and multiplexes multiple
// individual priceAuthorities, including aethPriceAuthority.
// individual priceAuthorities, including aethManualPA.
// priceAuthorityAdmin supports registering more individual priceAuthorities
// with the registry.
const aethPriceAuthority = makeManualPriceAuthority({
const aethManualPA = makeManualPriceAuthority({
actualBrandIn: aeth.brand,
actualBrandOut: run.brand,
initialPrice: makeRatioFromAmounts(initialPrice, priceBase),
Expand All @@ -234,7 +234,7 @@ const setupServices = async (t, initialPrice, priceBase) => {
const { priceAuthority: priceAuthorityReg, adminFacet: priceAuthorityAdmin } =
providePriceAuthorityRegistry(baggage);
await E(priceAuthorityAdmin).registerPriceAuthority(
aethPriceAuthority,
aethManualPA,
aeth.brand,
run.brand,
);
Expand Down Expand Up @@ -307,7 +307,7 @@ const setupServices = async (t, initialPrice, priceBase) => {
},
priceAuthority: priceAuthorityReg,
priceAuthorityAdmin,
aethPriceAuthority,
aethManualPA,
};
};

Expand All @@ -326,7 +326,7 @@ export const makeManagerDriver = async (
const { zoe, aeth, run } = t.context;
const {
vaultFactory: { lender, vaultFactory, vfPublic },
aethPriceAuthority,
aethManualPA,
timer,
} = services;
const publicTopics = await E(lender).getPublicTopics();
Expand Down Expand Up @@ -512,8 +512,7 @@ export const makeManagerDriver = async (
});
},
/** @param {Amount<'nat'>} p */
setPrice: p =>
aethPriceAuthority.setPrice(makeRatioFromAmounts(p, priceBase)),
setPrice: p => aethManualPA.setPrice(makeRatioFromAmounts(p, priceBase)),
// XXX the paramPath should be implied by the object `setGovernedParam` is being called on.
// e.g. the manager driver should know the paramPath is `{ key: { collateralBrand: aeth.brand } }`
// and the director driver should `{ key: 'governedParams }`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,7 @@ export const setupElectorateReserveAndAuction = async (
// individual priceAuthorities, including aethPriceAuthority.
// priceAuthorityAdmin supports registering more individual priceAuthorities
// with the registry.
/**
* @type {PriceAuthority & {
* setPrice: (Ratio) => void;
* disable: () => void;
* }}
*/
/** @type {import('@agoric/zoe/tools/manualPriceAuthority.js').ManualPriceAuthority} */
// @ts-expect-error scriptedPriceAuthority doesn't actually match this, but manualPriceAuthority does
const aethPriceAuthority = Array.isArray(priceOrList)
? makeScriptedPriceAuthority({
Expand Down

0 comments on commit 70dccf5

Please sign in to comment.