From 001d8e44070ff14c1956be51f95619bb0340394e Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 30 Apr 2024 11:36:01 -0700 Subject: [PATCH] chore(types): accomodate export changes --- packages/boot/test/bootstrapTests/ibcClientMock.js | 4 ++++ packages/boot/test/bootstrapTests/ibcServerMock.js | 4 ++++ .../deploy-script-support/src/coreProposalBehavior.js | 4 ++++ packages/governance/src/contractGovernance/governParam.js | 1 + packages/governance/src/index.js | 6 ++---- packages/governance/src/types.js | 2 ++ packages/inter-protocol/src/auction/auctionBook.js | 2 ++ packages/inter-protocol/src/proposals/econ-behaviors.js | 1 + packages/inter-protocol/src/provisionPoolKit.js | 2 +- .../orchestration/src/proposals/orchestration-proposal.js | 1 + packages/pegasus/src/courier.js | 2 ++ packages/pegasus/src/pegasus.js | 5 +++++ packages/pegasus/src/proposals/core-proposal.js | 4 ++++ packages/pegasus/src/types.js | 3 +++ packages/smart-wallet/src/invitations.js | 3 +++ packages/smart-wallet/src/offers.js | 3 +++ .../src/proposals/upgrade-wallet-factory2-proposal.js | 3 +++ packages/smart-wallet/src/smartWallet.js | 3 +++ packages/smart-wallet/src/utils.js | 4 ++++ packages/vats/src/ibc.js | 8 ++++++-- 20 files changed, 58 insertions(+), 7 deletions(-) diff --git a/packages/boot/test/bootstrapTests/ibcClientMock.js b/packages/boot/test/bootstrapTests/ibcClientMock.js index 33458da604e..9578d6dfe41 100644 --- a/packages/boot/test/bootstrapTests/ibcClientMock.js +++ b/packages/boot/test/bootstrapTests/ibcClientMock.js @@ -3,6 +3,10 @@ import { Far } from '@endo/far'; import { V as E } from '@agoric/vat-data/vow.js'; +/** + * @import {ListenHandler, PortAllocator} from '@agoric/network'; + */ + /** * @param {ZCF} zcf * @param {{ diff --git a/packages/boot/test/bootstrapTests/ibcServerMock.js b/packages/boot/test/bootstrapTests/ibcServerMock.js index 1370146c65e..11367cbf3fb 100644 --- a/packages/boot/test/bootstrapTests/ibcServerMock.js +++ b/packages/boot/test/bootstrapTests/ibcServerMock.js @@ -7,6 +7,10 @@ import { V as E } from '@agoric/vat-data/vow.js'; const { quote: q, Fail } = assert; const { log } = console; +/** + * @import {ListenHandler, PortAllocator} from '@agoric/network'; + */ + /** * * @param {ZCF} zcf diff --git a/packages/deploy-script-support/src/coreProposalBehavior.js b/packages/deploy-script-support/src/coreProposalBehavior.js index f473edf2a94..6551b0dfb92 100644 --- a/packages/deploy-script-support/src/coreProposalBehavior.js +++ b/packages/deploy-script-support/src/coreProposalBehavior.js @@ -1,6 +1,10 @@ // @ts-check const t = 'makeCoreProposalBehavior'; +/** + * @import {Installation} from '@agoric/zoe/src/zoeService/utils.js'; + */ + /** * TODO import these from @agoric/vats when the types are better managed * diff --git a/packages/governance/src/contractGovernance/governParam.js b/packages/governance/src/contractGovernance/governParam.js index 003877c0ae3..f06c7d4bb19 100644 --- a/packages/governance/src/contractGovernance/governParam.js +++ b/packages/governance/src/contractGovernance/governParam.js @@ -9,6 +9,7 @@ import { QuorumRule, } from '../question.js'; import { ParamChangesQuestionDetailsShape } from '../typeGuards.js'; + /** * @import {ParamValue, ParamChangePositions, QuestionSpec, ChangeParamsPosition, ParamChangeIssue, ParamGovernor, ParamManagerRetriever, PoserFacet, VoteOnParamChanges} from '../types.js'; */ diff --git a/packages/governance/src/index.js b/packages/governance/src/index.js index 481cff9b3d0..b3e2cc5a24d 100644 --- a/packages/governance/src/index.js +++ b/packages/governance/src/index.js @@ -1,9 +1,7 @@ // XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512 +import '@agoric/internal/exported.js'; import '@agoric/ertp/exported.js'; - -import '@agoric/zoe/src/contractFacet/types-ambient.js'; -import '@agoric/zoe/tools/types-ambient.js'; -import '@agoric/zoe/src/types.js'; +import '@agoric/zoe/exported.js'; /// diff --git a/packages/governance/src/types.js b/packages/governance/src/types.js index 23c8e3ddec7..cced1b34245 100644 --- a/packages/governance/src/types.js +++ b/packages/governance/src/types.js @@ -1,3 +1,5 @@ +import '@agoric/zoe/src/zoeService/types-ambient.js'; + export {}; /** @import {ContractStartFunction} from '@agoric/zoe/src/zoeService/utils.js' */ diff --git a/packages/inter-protocol/src/auction/auctionBook.js b/packages/inter-protocol/src/auction/auctionBook.js index 47f00e0e1c2..e819fe8f53c 100644 --- a/packages/inter-protocol/src/auction/auctionBook.js +++ b/packages/inter-protocol/src/auction/auctionBook.js @@ -1,3 +1,5 @@ +// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512 +import '@agoric/internal/exported.js'; import '@agoric/governance/exported.js'; import '@agoric/zoe/exported.js'; import '@agoric/zoe/src/contracts/exported.js'; diff --git a/packages/inter-protocol/src/proposals/econ-behaviors.js b/packages/inter-protocol/src/proposals/econ-behaviors.js index f683e6357d1..ed220917ee4 100644 --- a/packages/inter-protocol/src/proposals/econ-behaviors.js +++ b/packages/inter-protocol/src/proposals/econ-behaviors.js @@ -3,6 +3,7 @@ // XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512 import '../../exported.js'; import '@agoric/governance/exported.js'; +import '@agoric/vats/src/core/types-ambient.js'; import { AmountMath } from '@agoric/ertp'; import { deeplyFulfilledObject, makeTracer } from '@agoric/internal'; diff --git a/packages/inter-protocol/src/provisionPoolKit.js b/packages/inter-protocol/src/provisionPoolKit.js index 7e2ee30f192..179c562b281 100644 --- a/packages/inter-protocol/src/provisionPoolKit.js +++ b/packages/inter-protocol/src/provisionPoolKit.js @@ -26,6 +26,7 @@ const { details: X, quote: q, Fail } = assert; /** * @import {ERef} from '@endo/far' * @import {Amount} from '@agoric/ertp/src/types.js' + * @import {Bank, BankManager} from '@agoric/vats/src/vat-bank.js' */ /** @@ -59,7 +60,6 @@ const { details: X, quote: q, Fail } = assert; * * @param {(depositBank: ERef) => Promise} sendInitialPayment * @param {() => void} onProvisioned - * @import {Bank} from '@agoric/vats/src/vat-bank.js' */ export const makeBridgeProvisionTool = (sendInitialPayment, onProvisioned) => { /** @param {ProvisionPoolKitReferences} refs */ diff --git a/packages/orchestration/src/proposals/orchestration-proposal.js b/packages/orchestration/src/proposals/orchestration-proposal.js index c889383bcda..c48eb0a4ef6 100644 --- a/packages/orchestration/src/proposals/orchestration-proposal.js +++ b/packages/orchestration/src/proposals/orchestration-proposal.js @@ -2,6 +2,7 @@ import { V as E } from '@agoric/vat-data/vow.js'; /** + * @import {Connection, Port, PortAllocator} from '@agoric/network'; * @import { OrchestrationService } from '../service.js' * @import { OrchestrationVat } from '../vat-orchestration.js' */ diff --git a/packages/pegasus/src/courier.js b/packages/pegasus/src/courier.js index 8ddd587ccfc..59eed5b1858 100644 --- a/packages/pegasus/src/courier.js +++ b/packages/pegasus/src/courier.js @@ -8,6 +8,8 @@ import { makeOncePromiseKit } from './once-promise-kit.js'; /** * @import {DepositFacet} from '@agoric/ertp/exported.js' + * @import {Connection} from '@agoric/network'; + * @import {Remote} from '@agoric/vow'; */ /** diff --git a/packages/pegasus/src/pegasus.js b/packages/pegasus/src/pegasus.js index b9ca77220fb..649eb4d40e7 100644 --- a/packages/pegasus/src/pegasus.js +++ b/packages/pegasus/src/pegasus.js @@ -17,6 +17,11 @@ import { IBCSourceTraceDenomTransformer } from './ibc-trace.js'; import { ICS20TransferProtocol } from './ics20.js'; import { makeCourierMaker, getCourierPK } from './courier.js'; +/** + * @import {CloseReason, Connection} from '@agoric/network'; + * @import {Remote} from '@agoric/vow'; + */ + const DEFAULT_DENOM_TRANSFORMER = IBCSourceTraceDenomTransformer; const DEFAULT_TRANSFER_PROTOCOL = ICS20TransferProtocol; diff --git a/packages/pegasus/src/proposals/core-proposal.js b/packages/pegasus/src/proposals/core-proposal.js index dde255ccad1..0bbfe5f71b3 100644 --- a/packages/pegasus/src/proposals/core-proposal.js +++ b/packages/pegasus/src/proposals/core-proposal.js @@ -3,6 +3,10 @@ import { E, Far } from '@endo/far'; import { makeNameHubKit } from '@agoric/vats/src/nameHub.js'; import { observeIteration, subscribeEach } from '@agoric/notifier'; +/** + * @import {Connection, Port, PortAllocator} from '@agoric/network'; + */ + export const CONTRACT_NAME = 'Pegasus'; const t = 'pegasus'; diff --git a/packages/pegasus/src/types.js b/packages/pegasus/src/types.js index 0747712963b..921139ce8f8 100644 --- a/packages/pegasus/src/types.js +++ b/packages/pegasus/src/types.js @@ -1,6 +1,9 @@ // @ts-check /// +/** + * @import {Bytes, ConnectionHandler} from '@agoric/network'; + */ /** * @typedef {string} Denom diff --git a/packages/smart-wallet/src/invitations.js b/packages/smart-wallet/src/invitations.js index 5acd5e7d428..34d34a6d872 100644 --- a/packages/smart-wallet/src/invitations.js +++ b/packages/smart-wallet/src/invitations.js @@ -4,6 +4,9 @@ import { InvitationHandleShape } from '@agoric/zoe/src/typeGuards.js'; import { E } from '@endo/far'; import { shape } from './typeGuards.js'; +// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512 +import '@agoric/zoe/exported.js'; + const { Fail } = assert; // A safety limit diff --git a/packages/smart-wallet/src/offers.js b/packages/smart-wallet/src/offers.js index 6c78021ff9c..bd4b73c0f01 100644 --- a/packages/smart-wallet/src/offers.js +++ b/packages/smart-wallet/src/offers.js @@ -1,3 +1,6 @@ +// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512 +import '@agoric/zoe/src/zoeService/types-ambient.js'; + /** * @typedef {number | string} OfferId */ diff --git a/packages/smart-wallet/src/proposals/upgrade-wallet-factory2-proposal.js b/packages/smart-wallet/src/proposals/upgrade-wallet-factory2-proposal.js index 60252d54616..2ebb86e3fc5 100644 --- a/packages/smart-wallet/src/proposals/upgrade-wallet-factory2-proposal.js +++ b/packages/smart-wallet/src/proposals/upgrade-wallet-factory2-proposal.js @@ -2,6 +2,9 @@ import { E } from '@endo/far'; import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js'; +// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512 +import '@agoric/vats/src/core/types-ambient.js'; + /** * @param {BootstrapPowers & ChainBootstrapSpace} powers * @param {object} options diff --git a/packages/smart-wallet/src/smartWallet.js b/packages/smart-wallet/src/smartWallet.js index 270edb892e0..9ef0da19135 100644 --- a/packages/smart-wallet/src/smartWallet.js +++ b/packages/smart-wallet/src/smartWallet.js @@ -42,6 +42,9 @@ import { shape } from './typeGuards.js'; import { objectMapStoragePath } from './utils.js'; import { prepareOfferWatcher, watchOfferOutcomes } from './offerWatcher.js'; +// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512 +import '@agoric/zoe/exported.js'; + const { Fail, quote: q } = assert; const trace = makeTracer('SmrtWlt'); diff --git a/packages/smart-wallet/src/utils.js b/packages/smart-wallet/src/utils.js index 9740bda9405..39dee3cbbd2 100644 --- a/packages/smart-wallet/src/utils.js +++ b/packages/smart-wallet/src/utils.js @@ -2,6 +2,10 @@ import { deeplyFulfilledObject, objectMap, makeTracer } from '@agoric/internal'; import { observeIteration, subscribeEach } from '@agoric/notifier'; import { E } from '@endo/far'; +// XXX ambient types runtime imports until https://github.com/Agoric/agoric-sdk/issues/6512 +import '@agoric/internal/exported.js'; +import '@agoric/notifier/exported.js'; + export const NO_SMART_WALLET_ERROR = 'no smart wallet'; const trace = makeTracer('WUTIL', false); diff --git a/packages/vats/src/ibc.js b/packages/vats/src/ibc.js index a48718bc8cc..a1e0e1c9486 100644 --- a/packages/vats/src/ibc.js +++ b/packages/vats/src/ibc.js @@ -14,7 +14,10 @@ import { encodeRemoteIbcAddress, } from '../tools/ibc-utils.js'; -/** @import {LocalIbcAddress, RemoteIbcAddress} from '../tools/ibc-utils.js' */ +/** + * @import {LocalIbcAddress, RemoteIbcAddress} from '../tools/ibc-utils.js'; + * @import {AttemptDescription} from '@agoric/network'; + */ // CAVEAT: IBC acks cannot be empty, as the Cosmos IAVL tree cannot represent // empty acknowledgements as distinct from unacknowledged packets. @@ -24,9 +27,10 @@ const DEFAULT_ACKNOWLEDGEMENT = '\x00'; const DEFAULT_PACKET_TIMEOUT_NS = 60n * 60n * 1_000_000_000n; /** + * @import {Endpoint, Connection, ConnectionHandler, InboundAttempt, Bytes, ProtocolHandler, ProtocolImpl} from '@agoric/network'; * @import {BridgeHandler, ScopedBridgeManager, ConnectingInfo, IBCChannelID, IBCChannelOrdering, IBCEvent, IBCPacket, IBCPortID, IBCDowncallPacket, IBCDowncallMethod, IBCDowncall, IBCBridgeEvent} from './types.js'; * @import {Zone} from '@agoric/base-zone'; - * @import {Remote, VowKit, VowResolver, VowTools} from '@agoric/vow'; + * @import {PromiseVow, Remote, VowKit, VowResolver, VowTools} from '@agoric/vow'; */ /** @typedef {VowKit} OnConnectP */