From cd7c7eecffe85b07c36af1341a331821724261f0 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 15 Sep 2023 12:33:02 -0700 Subject: [PATCH] refactor(types): ContractInstallationPromises helper --- packages/vats/src/core/types.d.ts | 76 ++++++++----------------------- 1 file changed, 20 insertions(+), 56 deletions(-) diff --git a/packages/vats/src/core/types.d.ts b/packages/vats/src/core/types.d.ts index fb06efaa811f..77142ef45fd5 100644 --- a/packages/vats/src/core/types.d.ts +++ b/packages/vats/src/core/types.d.ts @@ -198,6 +198,10 @@ type WellKnownName = { uiConfig: 'VaultFactory'; }; +type ContractInstallationPromises = { + [Property in keyof StartFns]: Promise>; +}; + type WellKnownSpaces = { issuer: { produce: Record>; @@ -225,62 +229,22 @@ type WellKnownSpaces = { consume: Record< WellKnownName['installation'], Promise> - > & { - auctioneer: Promise< - Installation< - typeof import('@agoric/inter-protocol/src/auction/auctioneer.js').start - > - >; - centralSupply: Promise< - Installation - >; - committee: Promise< - Installation< - typeof import('@agoric/governance/src/committee.js')['start'] - > - >; - contractGovernor: Promise< - Installation< - typeof import('@agoric/governance/src/contractGovernor.js')['start'] - > - >; - econCommitteeCharter: Promise< - Installation< - typeof import('@agoric/inter-protocol/src/econCommitteeCharter.js')['start'] - > - >; - feeDistributor: Promise< - Installation< - typeof import('@agoric/inter-protocol/src/feeDistributor.js').start - > - >; - mintHolder: Promise< - Installation - >; - psm: Promise< - Installation< - typeof import('@agoric/inter-protocol/src/psm/psm.js')['start'] - > - >; - provisionPool: Promise< - Installation< - typeof import('@agoric/inter-protocol/src/provisionPool.js')['start'] - > - >; - reserve: Promise< - Installation< - typeof import('@agoric/inter-protocol/src/reserve/assetReserve.js')['start'] - > - >; - VaultFactory: Promise< - Installation< - typeof import('@agoric/inter-protocol/src/vaultFactory/vaultFactory.js')['start'] - > - >; - walletFactory: Promise< - Installation - >; - }; + > & + ContractInstallationPromises<{ + auctioneer: typeof import('@agoric/inter-protocol/src/auction/auctioneer.js').start; + centralSupply: typeof import('@agoric/vats/src/centralSupply.js').start; + committee: typeof import('@agoric/governance/src/committee.js').start; + contractGovernor: typeof import('@agoric/governance/src/contractGovernor.js').start; + econCommitteeCharter: typeof import('@agoric/inter-protocol/src/econCommitteeCharter.js').start; + feeDistributor: typeof import('@agoric/inter-protocol/src/feeDistributor.js').start; + mintHolder: typeof import('@agoric/vats/src/mintHolder.js').start; + psm: typeof import('@agoric/inter-protocol/src/psm/psm.js').start; + provisionPool: typeof import('@agoric/inter-protocol/src/provisionPool.js').start; + reserve: typeof import('@agoric/inter-protocol/src/reserve/assetReserve.js').start; + VaultFactory: typeof import('@agoric/inter-protocol/src/vaultFactory/vaultFactory.js').start; + // no typeof because walletFactory is exporting `start` as a type + walletFactory: import('@agoric/smart-wallet/src/walletFactory.js').start; + }>; }; instance: { produce: Record>;