From 38a11e06ca85206bd7f071bea7fea21314f740fd Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Tue, 7 Nov 2023 12:50:12 -0800 Subject: [PATCH] refactor(ertp): rename reallyPrepareIssuerKit to prepareIssuerKit (#8504) --- packages/ERTP/src/issuerKit.js | 20 ++++--------------- .../src/price/fluxAggregatorContract.js | 4 ++-- packages/vats/src/mintHolder.js | 4 ++-- .../priceAuthorityQuoteMint.js | 4 ++-- packages/zoe/src/zoeService/feeMint.js | 4 ++-- packages/zoe/src/zoeService/makeInvitation.js | 4 ++-- 6 files changed, 14 insertions(+), 26 deletions(-) diff --git a/packages/ERTP/src/issuerKit.js b/packages/ERTP/src/issuerKit.js index 85581030ccf..028ba4fbcd6 100644 --- a/packages/ERTP/src/issuerKit.js +++ b/packages/ERTP/src/issuerKit.js @@ -105,17 +105,6 @@ export const upgradeIssuerKit = ( }; harden(upgradeIssuerKit); -/** - * Confusingly, `prepareIssuerKit` was the original name for `upgradeIssuerKit`, - * even though it is used only to upgrade a predecessor issuerKit. Use - * `makeDurableIssuerKit` to make a new one. - * - * @deprecated Use `upgradeIssuerKit` instead if that's what you want. Or - * `reallyPrepareIssuerKit` if you want the behavior that should have been - * bound to this name. - */ -export const prepareIssuerKit = upgradeIssuerKit; - /** * Does baggage already have an issuerKit? * @@ -183,9 +172,8 @@ export const makeDurableIssuerKit = ( harden(makeDurableIssuerKit); /** - * What _should_ have been named `prepareIssuerKit`. Used to either revive a - * predecessor issuerKit, or to make a new durable one if it is absent, and to - * place it in baggage for the next successor. + * Used to either revive a predecessor issuerKit, or to make a new durable one + * if it is absent, and to place it in baggage for the next successor. * * @template {AssetKind} K The name becomes part of the brand in asset * descriptions. The name is useful for debugging and double-checking @@ -213,7 +201,7 @@ harden(makeDurableIssuerKit); * @param {IssuerOptionsRecord} [options] * @returns {IssuerKit} */ -export const reallyPrepareIssuerKit = ( +export const prepareIssuerKit = ( issuerBaggage, name, // @ts-expect-error K could be instantiated with a different subtype of AssetKind @@ -244,7 +232,7 @@ export const reallyPrepareIssuerKit = ( return issuerKit; } }; -harden(reallyPrepareIssuerKit); +harden(prepareIssuerKit); /** * Used _only_ to make a new issuerKit that is effectively non-durable. This is diff --git a/packages/inter-protocol/src/price/fluxAggregatorContract.js b/packages/inter-protocol/src/price/fluxAggregatorContract.js index 883139b9ea3..f7672c268ed 100644 --- a/packages/inter-protocol/src/price/fluxAggregatorContract.js +++ b/packages/inter-protocol/src/price/fluxAggregatorContract.js @@ -1,6 +1,6 @@ // @jessie-check -import { reallyPrepareIssuerKit } from '@agoric/ertp'; +import { prepareIssuerKit } from '@agoric/ertp'; import { handleParamGovernance } from '@agoric/governance'; import { makeTracer, StorageNodeShape } from '@agoric/internal'; import { prepareDurablePublishKit } from '@agoric/notifier'; @@ -68,7 +68,7 @@ export const start = async (zcf, privateArgs, baggage) => { // xxx uses contract baggage as issuerBagage, assumes one issuer in this contract /** @type {import('./roundsManager.js').QuoteKit} */ - const quoteIssuerKit = reallyPrepareIssuerKit( + const quoteIssuerKit = prepareIssuerKit( baggage, 'quote', 'set', diff --git a/packages/vats/src/mintHolder.js b/packages/vats/src/mintHolder.js index 36a3d45f17d..4f526e7fde4 100644 --- a/packages/vats/src/mintHolder.js +++ b/packages/vats/src/mintHolder.js @@ -1,7 +1,7 @@ // @ts-check // @jessie-check -import { reallyPrepareIssuerKit } from '@agoric/ertp'; +import { prepareIssuerKit } from '@agoric/ertp'; /** @typedef {import('@agoric/vat-data').Baggage} Baggage */ @@ -23,7 +23,7 @@ import { reallyPrepareIssuerKit } from '@agoric/ertp'; */ function provideIssuerKit(zcf, baggage) { const { keyword, assetKind, displayInfo } = zcf.getTerms(); - return reallyPrepareIssuerKit(baggage, keyword, assetKind, displayInfo); + return prepareIssuerKit(baggage, keyword, assetKind, displayInfo); } /** @type {ContractMeta} */ diff --git a/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js b/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js index 866ac4afd91..769b08643ac 100644 --- a/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js +++ b/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js @@ -1,4 +1,4 @@ -import { AssetKind, reallyPrepareIssuerKit } from '@agoric/ertp'; +import { AssetKind, prepareIssuerKit } from '@agoric/ertp'; import { provideDurableMapStore } from '@agoric/vat-data'; /** @@ -11,7 +11,7 @@ export const provideQuoteMint = baggage => { baggage, 'quoteMintIssuerBaggage', ); - const issuerKit = reallyPrepareIssuerKit( + const issuerKit = prepareIssuerKit( issuerBaggage, 'quote', AssetKind.SET, diff --git a/packages/zoe/src/zoeService/feeMint.js b/packages/zoe/src/zoeService/feeMint.js index fe3e405327a..3672c86e123 100644 --- a/packages/zoe/src/zoeService/feeMint.js +++ b/packages/zoe/src/zoeService/feeMint.js @@ -2,7 +2,7 @@ import { AssetKind, IssuerShape, BrandShape, - reallyPrepareIssuerKit, + prepareIssuerKit, hasIssuer, } from '@agoric/ertp'; import { initEmpty, M } from '@agoric/store'; @@ -43,7 +43,7 @@ const prepareFeeMint = (zoeBaggage, feeIssuerConfig, shutdownZoeVat) => { } const feeIssuerKit = /** @type {IssuerKit<'nat'>} */ ( - reallyPrepareIssuerKit( + prepareIssuerKit( mintBaggage, feeIssuerConfig.name, feeIssuerConfig.assetKind, diff --git a/packages/zoe/src/zoeService/makeInvitation.js b/packages/zoe/src/zoeService/makeInvitation.js index 2c3e1be1191..8f132ceb335 100644 --- a/packages/zoe/src/zoeService/makeInvitation.js +++ b/packages/zoe/src/zoeService/makeInvitation.js @@ -2,7 +2,7 @@ import { Fail, q } from '@agoric/assert'; import { provideDurableMapStore } from '@agoric/vat-data'; -import { AssetKind, hasIssuer, reallyPrepareIssuerKit } from '@agoric/ertp'; +import { AssetKind, hasIssuer, prepareIssuerKit } from '@agoric/ertp'; import { InvitationElementShape } from '../typeGuards.js'; /** @@ -28,7 +28,7 @@ export const prepareInvitationKit = (baggage, shutdownZoeVat = undefined) => { // Upgrade this legacy state by simply deleting it. invitationKitBaggage.delete(ZOE_INVITATION_KIT); } - const invitationKit = reallyPrepareIssuerKit( + const invitationKit = prepareIssuerKit( invitationKitBaggage, 'Zoe Invitation', AssetKind.SET,