Skip to content

Commit

Permalink
chore(types): accomodate export changes
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Apr 30, 2024
1 parent 7167a0e commit ff95b42
Show file tree
Hide file tree
Showing 20 changed files with 58 additions and 7 deletions.
4 changes: 4 additions & 0 deletions packages/boot/test/bootstrapTests/ibcClientMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {{
Expand Down
4 changes: 4 additions & 0 deletions packages/boot/test/bootstrapTests/ibcServerMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions packages/deploy-script-support/src/coreProposalBehavior.js
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
1 change: 1 addition & 0 deletions packages/governance/src/contractGovernance/governParam.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
*/
Expand Down
6 changes: 2 additions & 4 deletions packages/governance/src/index.js
Original file line number Diff line number Diff line change
@@ -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';

/// <reference path="./types-ambient.js" />

Expand Down
2 changes: 2 additions & 0 deletions packages/governance/src/types.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@agoric/zoe/src/zoeService/types-ambient.js';

export {};

/** @import {ContractStartFunction} from '@agoric/zoe/src/zoeService/utils.js' */
Expand Down
2 changes: 2 additions & 0 deletions packages/inter-protocol/src/auction/auctionBook.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 1 addition & 0 deletions packages/inter-protocol/src/proposals/econ-behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packages/inter-protocol/src/provisionPoolKit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
*/

/**
Expand Down Expand Up @@ -59,7 +60,6 @@ const { details: X, quote: q, Fail } = assert;
*
* @param {(depositBank: ERef<Bank>) => Promise<void>} sendInitialPayment
* @param {() => void} onProvisioned
* @import {Bank} from '@agoric/vats/src/vat-bank.js'
*/
export const makeBridgeProvisionTool = (sendInitialPayment, onProvisioned) => {
/** @param {ProvisionPoolKitReferences} refs */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/pegasus/src/courier.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
*/

/**
Expand Down
5 changes: 5 additions & 0 deletions packages/pegasus/src/pegasus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 4 additions & 0 deletions packages/pegasus/src/proposals/core-proposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
3 changes: 3 additions & 0 deletions packages/pegasus/src/types.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// @ts-check

/// <reference types="ses"/>
/**
* @import {Bytes, ConnectionHandler} from '@agoric/network';
*/

/**
* @typedef {string} Denom
Expand Down
3 changes: 3 additions & 0 deletions packages/smart-wallet/src/invitations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions packages/smart-wallet/src/offers.js
Original file line number Diff line number Diff line change
@@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions packages/smart-wallet/src/smartWallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 4 additions & 0 deletions packages/smart-wallet/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 6 additions & 2 deletions packages/vats/src/ibc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<AttemptDescription>} OnConnectP */
Expand Down

0 comments on commit ff95b42

Please sign in to comment.