Skip to content

Commit

Permalink
chore(types): compat with swingset-liveslots exports (#10875)
Browse files Browse the repository at this point in the history
refs: #6343

## Description

A recent PR broke the `dependency-graph` check because it's not **Required**. The implication of this is that NPM packages won't publish until a fix is made in master.

This PR fixes it by explicitly importing types that are no long available ambiently. This is an improvement overall.

### Security Considerations
none

### Scaling Considerations
none

### Documentation Considerations
none

### Testing Considerations
no additional

### Upgrade Considerations
none
  • Loading branch information
mergify[bot] authored Jan 23, 2025
2 parents 79df2da + 500e126 commit b78165c
Show file tree
Hide file tree
Showing 20 changed files with 60 additions and 10 deletions.
2 changes: 2 additions & 0 deletions packages/SwingSet/src/vats/timer/vat-timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { makeScalarWeakMapStore } from '@agoric/store';
import { TimeMath } from '@agoric/time';

/**
* @import {LegacyWeakMap, WeakMapStore} from '@agoric/store';
* @import {MapStore} from '@agoric/swingset-liveslots';
* @import {Passable, RemotableObject} from '@endo/pass-style';
* @import {Key} from '@endo/patterns';
*/
Expand Down
1 change: 1 addition & 0 deletions packages/governance/src/binaryVoteCounter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
import { makeQuorumCounter } from './quorumCounter.js';

/**
* @import {MapStore} from '@agoric/swingset-liveslots';
* @import {BuildVoteCounter, OutcomeRecord, Position, QuestionSpec, VoteStatistics} from './types.js';
*/

Expand Down
1 change: 1 addition & 0 deletions packages/governance/src/committee.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { ElectorateCreatorI, ElectoratePublicI } from './typeGuards.js';
import { prepareVoterKit } from './voterKit.js';

/**
* @import {MapStore} from '@agoric/swingset-liveslots';
* @import {ElectorateCreatorFacet, CommitteeElectoratePublic, QuestionDetails, OutcomeRecord, AddQuestion} from './types.js';
*/

Expand Down
1 change: 1 addition & 0 deletions packages/governance/src/contractGovernance/paramManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
import { CONTRACT_ELECTORATE } from './governParam.js';

/**
* @import {MapStore} from '@agoric/swingset-liveslots';
* @import {AnyParamManager, GovernanceSubscriptionState, ParamManagerBase, ParamStateRecord, ParamValueTyped, UpdateParams} from '../types.js';
*/

Expand Down
1 change: 1 addition & 0 deletions packages/governance/src/electorateTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { E } from '@endo/eventual-send';
import { deeplyFulfilled, Far } from '@endo/marshal';

/**
* @import {MapStore} from '@agoric/swingset-liveslots';
* @import {VoteCounterCreatorFacet, VoteCounterPublicFacet, QuestionSpec, OutcomeRecord, AddQuestion, AddQuestionReturn} from './types.js';
*/

Expand Down
1 change: 1 addition & 0 deletions packages/governance/src/multiCandidateVoteCounter.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { makeQuorumCounter } from './quorumCounter.js';
import { breakTie } from './breakTie.js';

/**
* @import {MapStore} from '@agoric/swingset-liveslots';
* @import {QuestionSpec, BuildMultiVoteCounter, MultiOutcomeRecord, Position, VoteStatistics} from './types.js';
*/

Expand Down
2 changes: 1 addition & 1 deletion packages/vat-data/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export {
*/
// Copy this type because aliasing it by `import('@agoric/swingset-liveslots').Baggage`
// causes this error in typedoc: Expected a symbol for node with kind Identifier
/** @typedef {MapStore<string, any>} Baggage */
/** @typedef {import('@agoric/swingset-liveslots').MapStore<string, any>} Baggage */

// //////////////////////////// deprecated /////////////////////////////////////

Expand Down
5 changes: 5 additions & 0 deletions packages/zoe/src/contractFacet/offerHandlerStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import { canBeDurable, provideDurableWeakMapStore } from '@agoric/vat-data';

import { defineDurableHandle } from '../makeHandle.js';

/**
* @import {LegacyWeakMap, WeakMapStore} from '@agoric/store';
* @import {MapStore} from '@agoric/swingset-liveslots';
*/

/**
* The following should work. But for some reason, @endo/errors does
* not export the type `Details`.
Expand Down
4 changes: 4 additions & 0 deletions packages/zoe/src/contractFacet/reallocate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { makeScalarMapStore } from '@agoric/vat-data';
import { assertRightsConserved } from './rightsConservation.js';
import { addToAllocation, subtractFromAllocation } from './allocationMath.js';

/**
* @import {MapStore} from '@agoric/swingset-liveslots';
*/

/** @typedef {Array<AmountKeywordRecord>} TransactionList */

/**
Expand Down
5 changes: 5 additions & 0 deletions packages/zoe/src/contractFacet/zcfSeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ import {
import { makeAllocationMap } from './reallocate.js';
import { TransferPartShape } from '../contractSupport/atomicTransfer.js';

/**
* @import {LegacyWeakMap, WeakMapStore} from '@agoric/store';
* @import {MapStore} from '@agoric/swingset-liveslots';
*/

/**
* The SeatManager holds the active zcfSeats and can reallocate and
* make new zcfSeats.
Expand Down
4 changes: 4 additions & 0 deletions packages/zoe/src/contractSupport/durability.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { allValues, objectMap } from '@agoric/internal';
import { provide } from '@agoric/vat-data';
import { E } from '@endo/eventual-send';

/**
* @import {MapStore} from '@agoric/swingset-liveslots';
*/

/**
* SCALE: Only for low cardinality provisioning. Every value from init() will
* remain in the map for the lifetime of the heap. If a key object is GCed, its
Expand Down
4 changes: 4 additions & 0 deletions packages/zoe/src/contractSupport/zoeHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import { fromUniqueEntries } from '@agoric/internal';
import { satisfiesWant } from '../contractFacet/offerSafety.js';
import { atomicTransfer, fromOnly, toOnly } from './atomicTransfer.js';

/**
* @import {Pattern} from '@endo/patterns';
*/

export const defaultAcceptanceMsg = `The offer has been accepted. Once the contract has been completed, please check your payout`;

const getKeysSorted = obj => harden(Reflect.ownKeys(obj || {}).sort());
Expand Down
4 changes: 4 additions & 0 deletions packages/zoe/src/issuerStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import { makeIssuerRecord } from './issuerRecord.js';

const STORAGE_INSTANTIATED_KEY = 'IssuerStorageInstantiated';

/**
* @import {LegacyWeakMap, WeakMapStore} from '@agoric/store';
*/

/**
* Make the Issuer Storage.
*
Expand Down
4 changes: 4 additions & 0 deletions packages/zoe/src/zoeService/escrowStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import './internal-types.js';

import { cleanKeywords } from '../cleanProposal.js';

/**
* @import {LegacyWeakMap, WeakMapStore} from '@agoric/store';
*/

/**
* Store the pool purses whose purpose is to escrow assets, with one
* purse per brand.
Expand Down
9 changes: 6 additions & 3 deletions packages/zoe/src/zoeService/installationStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ import {
UnwrappedInstallationShape,
} from '../typeGuards.js';

/** @typedef { import('@agoric/swingset-vat').BundleCap} BundleCap */
/** @typedef { import('@agoric/swingset-vat').BundleID} BundleID */
/** @import {Baggage} from '@agoric/vat-data' */
/**
* @import {Baggage} from '@agoric/swingset-liveslots';
* @import {LegacyWeakMap, WeakMapStore} from '@agoric/store';
* @import {MapStore} from '@agoric/swingset-liveslots';
* @import {BundleID, BundleCap} from '@agoric/swingset-vat';
*/

/**
* @param {GetBundleCapForID} getBundleCapForID
Expand Down
4 changes: 4 additions & 0 deletions packages/zoe/src/zoeService/instanceAdminStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import {
} from '../typeGuards.js';
import { makeZoeSeatAdminFactory } from './zoeSeat.js';

/**
* @import {WeakMapStore} from '@agoric/store';
*/

/**
* @file Two objects are defined here, both called InstanceAdminSomething.
* InstanceAdminStorage is a container for individual InstanceAdmins. Each
Expand Down
2 changes: 1 addition & 1 deletion packages/zoe/src/zoeService/internal-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
* @property {GetInstallationForInstance} getInstallationForInstance
* @property {GetInstanceAdmin} getInstanceAdmin
* @property {UnwrapInstallation} unwrapInstallation
* @property {(invitationHandle: InvitationHandle) => Pattern | undefined} getProposalShapeForInvitation
* @property {(invitationHandle: InvitationHandle) => import('@endo/patterns').Pattern | undefined} getProposalShapeForInvitation
*/

/**
Expand Down
7 changes: 5 additions & 2 deletions packages/zoe/src/zoeService/startInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ import {

// import '../internal-types.js';

/** @import {Baggage} from '@agoric/vat-data' */
/** @typedef { import('@agoric/swingset-vat').BundleCap} BundleCap */
/**
* @import {Baggage} from '@agoric/vat-data';
* @import {LegacyWeakMap, WeakMapStore} from '@agoric/store';
* @import {BundleCap, EndoZipBase64Bundle} from '@agoric/swingset-vat';
*/

/**
* @param {Pick<ZoeStorageManager, 'makeZoeInstanceStorageManager' | 'unwrapInstallation'>} startInstanceAccess
Expand Down
2 changes: 1 addition & 1 deletion packages/zoe/src/zoeService/types-ambient.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* @property {GetFeeIssuer} getFeeIssuer
* @property {GetConfiguration} getConfiguration
* @property {GetBundleIDFromInstallation} getBundleIDFromInstallation
* @property {(invitationHandle: InvitationHandle) => Pattern | undefined} getProposalShapeForInvitation
* @property {(invitationHandle: InvitationHandle) => import('@endo/patterns').Pattern | undefined} getProposalShapeForInvitation
* Return the pattern (if any) associated with the invitationHandle that a
* proposal is required to match to be accepted by zoe.offer().
*/
Expand Down
7 changes: 5 additions & 2 deletions packages/zoe/tools/fakeVatAdmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ import { handlePKitWarning } from '../src/handleWarning.js';
import { makeHandle } from '../src/makeHandle.js';
import zcfBundle from '../bundles/bundle-contractFacet.js';

/** @typedef { import('@agoric/swingset-vat').BundleID} BundleID */
/** @typedef { import('@agoric/swingset-vat').EndoZipBase64Bundle} EndoZipBase64Bundle */
/**
* @import {LegacyWeakMap, WeakMapStore} from '@agoric/store';
* @import {MapStore} from '@agoric/swingset-liveslots';
* @import {BundleID, EndoZipBase64Bundle} from '@agoric/swingset-vat';
*/

// this simulates a bundlecap, which is normally a swingset "device node"
/** @typedef { import('@agoric/swingset-vat').BundleCap } BundleCap */
Expand Down

0 comments on commit b78165c

Please sign in to comment.