From 70dccf50f342536eb30a6d62addad08dbc503950 Mon Sep 17 00:00:00 2001 From: Chris Hibbert Date: Thu, 4 Jan 2024 16:23:48 -0800 Subject: [PATCH] chore: review cleanups: types and variable names --- packages/inter-protocol/test/vaultFactory/driver.js | 13 ++++++------- .../test/vaultFactory/vaultFactoryUtils.js | 7 +------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/packages/inter-protocol/test/vaultFactory/driver.js b/packages/inter-protocol/test/vaultFactory/driver.js index 7f16f1b7f692..40e3296ae7dd 100644 --- a/packages/inter-protocol/test/vaultFactory/driver.js +++ b/packages/inter-protocol/test/vaultFactory/driver.js @@ -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), @@ -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, ); @@ -307,7 +307,7 @@ const setupServices = async (t, initialPrice, priceBase) => { }, priceAuthority: priceAuthorityReg, priceAuthorityAdmin, - aethPriceAuthority, + aethManualPA, }; }; @@ -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(); @@ -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 }` diff --git a/packages/inter-protocol/test/vaultFactory/vaultFactoryUtils.js b/packages/inter-protocol/test/vaultFactory/vaultFactoryUtils.js index 89630dac60df..a078e7440f52 100644 --- a/packages/inter-protocol/test/vaultFactory/vaultFactoryUtils.js +++ b/packages/inter-protocol/test/vaultFactory/vaultFactoryUtils.js @@ -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({