Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Sync Endo #8651

Merged
merged 17 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type": "module",
"packageManager": "[email protected]",
"devDependencies": {
"@endo/eslint-plugin": "^0.5.1",
"@endo/eslint-plugin": "^2.0.0",
"@jessie.js/eslint-plugin": "^0.4.0",
"@types/express": "^4.17.17",
"@types/node": "^16.13.0",
Expand Down
14 changes: 7 additions & 7 deletions packages/ERTP/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@
"@agoric/notifier": "^0.6.2",
"@agoric/store": "^0.9.2",
"@agoric/vat-data": "^0.5.2",
"@endo/eventual-send": "^0.17.5",
"@endo/far": "^0.2.21",
"@endo/marshal": "^0.8.8",
"@endo/nat": "^4.1.30",
"@endo/patterns": "^0.2.5",
"@endo/promise-kit": "^0.2.59"
"@endo/eventual-send": "^1.0.1",
"@endo/far": "^1.0.1",
"@endo/marshal": "^1.0.1",
"@endo/nat": "^5.0.1",
"@endo/patterns": "^1.0.1",
"@endo/promise-kit": "^1.0.1"
},
"devDependencies": {
"@agoric/swingset-vat": "^0.32.2",
"@endo/bundle-source": "^2.7.0",
"@endo/bundle-source": "^3.0.1",
"@fast-check/ava": "^1.1.5",
"ava": "^5.3.0",
"tsd": "^0.28.1"
Expand Down
32 changes: 16 additions & 16 deletions packages/SwingSet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@
"@agoric/vat-data": "^0.5.2",
"@agoric/xsnap": "^0.14.2",
"@agoric/xsnap-lockdown": "^0.14.0",
"@endo/base64": "^0.2.34",
"@endo/bundle-source": "^2.7.0",
"@endo/captp": "^3.1.4",
"@endo/check-bundle": "^0.2.21",
"@endo/compartment-mapper": "^0.9.1",
"@endo/eventual-send": "^0.17.5",
"@endo/far": "^0.2.21",
"@endo/import-bundle": "^0.4.1",
"@endo/init": "^0.5.59",
"@endo/marshal": "^0.8.8",
"@endo/nat": "^4.1.30",
"@endo/patterns": "^0.2.5",
"@endo/promise-kit": "^0.2.59",
"@endo/ses-ava": "^0.2.43",
"@endo/stream": "^0.3.28",
"@endo/zip": "^0.2.34",
"@endo/base64": "^1.0.0",
"@endo/bundle-source": "^3.0.1",
"@endo/captp": "^4.0.1",
"@endo/check-bundle": "^1.0.1",
"@endo/compartment-mapper": "^1.0.1",
"@endo/eventual-send": "^1.0.1",
"@endo/far": "^1.0.1",
"@endo/import-bundle": "^1.0.1",
"@endo/init": "^1.0.1",
"@endo/marshal": "^1.0.1",
"@endo/nat": "^5.0.1",
"@endo/patterns": "^1.0.1",
"@endo/promise-kit": "^1.0.1",
"@endo/ses-ava": "^1.0.1",
"@endo/stream": "^1.0.1",
"@endo/zip": "^1.0.0",
"ansi-styles": "^6.2.1",
"anylogger": "^0.21.0",
"better-sqlite3": "^9.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/SwingSet/src/controller/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export async function makeSwingsetController(
warehousePolicy,
overrideVatManagerOptions,
};
/** @type { ReturnType<typeof import('../kernel').default> } */
/** @type { ReturnType<typeof import('../kernel/kernel.js').default> } */
const kernel = buildKernel(
kernelEndowments,
deviceEndowments,
Expand Down
2 changes: 1 addition & 1 deletion packages/SwingSet/src/controller/startXSnap.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function makeStartXSnap(options) {
};
}

/** @type { import('@agoric/xsnap/src/xsnap').XSnapOptions } */
/** @type { import('@agoric/xsnap/src/xsnap.js').XSnapOptions } */
const xsnapOpts = {
os: osType(),
fs: { ...fs, ...fs.promises, tmpName },
Expand Down
2 changes: 1 addition & 1 deletion packages/SwingSet/src/kernel/vat-warehouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export function makeVatWarehouse({
// console.debug('makeVatWarehouse', { warehousePolicy });

/**
* @typedef { ReturnType<typeof import('./vatTranslator').makeVatTranslators> } VatTranslators
* @typedef { ReturnType<typeof import('./vatTranslator.js').makeVatTranslators> } VatTranslators
* @typedef {{
* manager: VatManager,
* translators: VatTranslators,
Expand Down
4 changes: 2 additions & 2 deletions packages/SwingSet/src/types-external.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ export {};
* @typedef { DeviceInvocationResultOk | DeviceInvocationResultError } DeviceInvocationResult
*
* @typedef { { transcriptCount: number } } VatStats
* @typedef { ReturnType<typeof import('./kernel/state/vatKeeper').makeVatKeeper> } VatKeeper
* @typedef { ReturnType<typeof import('./kernel/state/kernelKeeper').default> } KernelKeeper
* @typedef { ReturnType<typeof import('./kernel/state/vatKeeper.js').makeVatKeeper> } VatKeeper
* @typedef { ReturnType<typeof import('./kernel/state/kernelKeeper.js').default> } KernelKeeper
* @typedef { Awaited<ReturnType<typeof import('@agoric/xsnap').xsnap>> } XSnap
* @typedef { (dr: VatDeliveryResult) => void } SlogFinishDelivery
* @typedef { (ksr: KernelSyscallResult, vsr: VatSyscallResult) => void } SlogFinishSyscall
Expand Down
8 changes: 4 additions & 4 deletions packages/SwingSet/test/snapshots/test-xsnap-store.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ Generated by [AVA](https://avajs.dev).
{
compressSeconds: 0,
dbSaveSeconds: 0,
hash: 'f44205908c32d4013e8f72ecf61d14d6e4a3799c7684562b14542c3a172cb2da',
uncompressedSize: 780707,
hash: 'ca5dca976b5691999e936f3c6fbfb16e85c45b6fc15471106390b245ed8db5f9',
uncompressedSize: 781363,
}

> after use of harden() - sensitive to SES-shim, XS, and supervisor

{
compressSeconds: 0,
dbSaveSeconds: 0,
hash: '0389ff81a632fe0e37e2319a1152e2799fe1c2e45fcacccedec38a772d92747e',
uncompressedSize: 780867,
hash: 'cd60cb92856ec37ee649f2b5fe234a2adf6e132bcbb143304bf0ceb965623388',
uncompressedSize: 781523,
}
Binary file modified packages/SwingSet/test/snapshots/test-xsnap-store.js.snap
Binary file not shown.
18 changes: 9 additions & 9 deletions packages/agoric-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@
"@cosmjs/math": "^0.30.1",
"@cosmjs/proto-signing": "^0.30.1",
"@cosmjs/stargate": "^0.30.1",
"@endo/bundle-source": "^2.7.0",
"@endo/captp": "^3.1.4",
"@endo/compartment-mapper": "^0.9.1",
"@endo/far": "^0.2.21",
"@endo/init": "^0.5.59",
"@endo/marshal": "^0.8.8",
"@endo/nat": "^4.1.30",
"@endo/patterns": "^0.2.6",
"@endo/promise-kit": "^0.2.59",
"@endo/bundle-source": "^3.0.1",
"@endo/captp": "^4.0.1",
"@endo/compartment-mapper": "^1.0.1",
"@endo/far": "^1.0.1",
"@endo/init": "^1.0.1",
"@endo/marshal": "^1.0.1",
"@endo/nat": "^5.0.1",
"@endo/patterns": "^1.0.1",
"@endo/promise-kit": "^1.0.1",
"@iarna/toml": "^2.2.3",
"anylogger": "^0.21.0",
"chalk": "^5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/agoric-cli/src/commands/gov.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const makeGovCommand = (_logger, io = {}) => {
* given a sendFrom address; else print it.
*
* @param {{
* toOffer: (agoricNames: *, current: import('@agoric/smart-wallet/src/smartWallet').CurrentWalletRecord | undefined) => OfferSpec,
* toOffer: (agoricNames: *, current: import('@agoric/smart-wallet/src/smartWallet.js').CurrentWalletRecord | undefined) => OfferSpec,
* sendFrom?: string | undefined,
* keyringBackend: string,
* instanceName?: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/agoric-cli/src/commands/inter.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const bidInvitationShape = harden({
});

/** @typedef {import('@agoric/vats/tools/board-utils.js').VBankAssetDetail } AssetDescriptor */
/** @typedef {import('@agoric/smart-wallet/src/smartWallet').TryExitOfferAction } TryExitOfferAction */
/** @typedef {import('@agoric/smart-wallet/src/smartWallet.js').TryExitOfferAction } TryExitOfferAction */
/** @typedef {import('@agoric/inter-protocol/src/auction/auctionBook.js').OfferSpec} BidSpec */
/** @typedef {import('@agoric/inter-protocol/src/auction/scheduler.js').ScheduleNotification} ScheduleNotification */
/** @typedef {import('@agoric/inter-protocol/src/auction/auctionBook.js').BookDataNotification} BookDataNotification */
Expand Down
6 changes: 3 additions & 3 deletions packages/agoric-cli/src/lib/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ harden(normalizeAddressWithOptions);

/**
* @param {ReadonlyArray<string>} swingsetArgs
* @param {import('./rpc').MinimalNetworkConfig & {
* @param {import('./rpc.js').MinimalNetworkConfig & {
* from: string,
* fees?: string,
* dryRun?: boolean,
Expand Down Expand Up @@ -110,7 +110,7 @@ export const fetchSwingsetParams = net => {
harden(fetchSwingsetParams);

/**
* @param {import('./rpc').MinimalNetworkConfig & {
* @param {import('./rpc.js').MinimalNetworkConfig & {
* execFileSync: typeof import('child_process').execFileSync,
* delay: (ms: number) => Promise<void>,
* period?: number,
Expand Down Expand Up @@ -150,7 +150,7 @@ export const pollBlocks = opts => async lookup => {

/**
* @param {string} txhash
* @param {import('./rpc').MinimalNetworkConfig & {
* @param {import('./rpc.js').MinimalNetworkConfig & {
* execFileSync: typeof import('child_process').execFileSync,
* delay: (ms: number) => Promise<void>,
* period?: number,
Expand Down
4 changes: 2 additions & 2 deletions packages/agoric-cli/src/lib/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const asBoardRemote = x => {
/**
* Summarize the balances array as user-facing informative tuples
*
* @param {import('@agoric/smart-wallet/src/smartWallet').CurrentWalletRecord['purses']} purses
* @param {import('@agoric/smart-wallet/src/smartWallet.js').CurrentWalletRecord['purses']} purses
* @param {AssetDescriptor[]} assets
*/
export const purseBalanceTuples = (purses, assets) => {
Expand Down Expand Up @@ -172,7 +172,7 @@ export const offerStatusTuples = (state, agoricNames) => {
};

/**
* @param {import('@agoric/smart-wallet/src/smartWallet').CurrentWalletRecord} current
* @param {import('@agoric/smart-wallet/src/smartWallet.js').CurrentWalletRecord} current
* @param {ReturnType<import('@agoric/smart-wallet/src/utils.js').makeWalletStateCoalescer>['state']} coalesced
* @param {import('./wallet.js').AgoricNamesRemotes} agoricNames
*/
Expand Down
18 changes: 9 additions & 9 deletions packages/agoric-cli/src/lib/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ const emptyCurrentRecord = {
/**
* @param {string} addr
* @param {Pick<import('./rpc.js').RpcUtils, 'readLatestHead'>} io
* @returns {Promise<import('@agoric/smart-wallet/src/smartWallet').CurrentWalletRecord>}
* @returns {Promise<import('@agoric/smart-wallet/src/smartWallet.js').CurrentWalletRecord>}
*/
export const getCurrent = async (addr, { readLatestHead }) => {
// Partial because older writes may not have had all properties
// NB: assumes changes are only additions
let current =
/** @type {Partial<import('@agoric/smart-wallet/src/smartWallet').CurrentWalletRecord> | undefined} */ (
/** @type {Partial<import('@agoric/smart-wallet/src/smartWallet.js').CurrentWalletRecord> | undefined} */ (
await readLatestHead(`published.wallet.${addr}.current`)
);
if (current === undefined) {
Expand Down Expand Up @@ -58,15 +58,15 @@ export const getCurrent = async (addr, { readLatestHead }) => {
/**
* @param {string} addr
* @param {Pick<import('./rpc.js').RpcUtils, 'readLatestHead'>} io
* @returns {Promise<import('@agoric/smart-wallet/src/smartWallet').UpdateRecord>}
* @returns {Promise<import('@agoric/smart-wallet/src/smartWallet.js').UpdateRecord>}
*/
export const getLastUpdate = (addr, { readLatestHead }) => {
// @ts-expect-error cast
return readLatestHead(`published.wallet.${addr}`);
};

/**
* @param {import('@agoric/smart-wallet/src/smartWallet').BridgeAction} bridgeAction
* @param {import('@agoric/smart-wallet/src/smartWallet.js').BridgeAction} bridgeAction
* @param {Pick<import('stream').Writable,'write'>} [stdout]
*/
export const outputAction = (bridgeAction, stdout = process.stdout) => {
Expand All @@ -79,7 +79,7 @@ export const sendHint =
'Now use `agoric wallet send ...` to sign and broadcast the offer.\n';

/**
* @param {import('@agoric/smart-wallet/src/smartWallet').BridgeAction} bridgeAction
* @param {import('@agoric/smart-wallet/src/smartWallet.js').BridgeAction} bridgeAction
* @param {{
* stdout: Pick<import('stream').Writable,'write'>,
* stderr: Pick<import('stream').Writable,'write'>,
Expand All @@ -100,7 +100,7 @@ export const outputExecuteOfferAction = (
stdout = process.stdout,
stderr = process.stderr,
) => {
/** @type {import('@agoric/smart-wallet/src/smartWallet').BridgeAction} */
/** @type {import('@agoric/smart-wallet/src/smartWallet.js').BridgeAction} */
const spendAction = {
method: 'executeOffer',
offer,
Expand All @@ -111,7 +111,7 @@ export const outputExecuteOfferAction = (

/**
* @deprecated use `.current` node for current state
* @param {import('@agoric/casting').Follower<import('@agoric/casting').ValueFollowerElement<import('@agoric/smart-wallet/src/smartWallet').UpdateRecord>>} follower
* @param {import('@agoric/casting').Follower<import('@agoric/casting').ValueFollowerElement<import('@agoric/smart-wallet/src/smartWallet.js').UpdateRecord>>} follower
* @param {Brand<'set'>} [invitationBrand]
*/
export const coalesceWalletState = async (follower, invitationBrand) => {
Expand Down Expand Up @@ -141,8 +141,8 @@ export const coalesceWalletState = async (follower, invitationBrand) => {
* Sign and broadcast a wallet-action.
*
* @throws { Error & { code: number } } if transaction fails
* @param {import('@agoric/smart-wallet/src/smartWallet').BridgeAction} bridgeAction
* @param {import('./rpc').MinimalNetworkConfig & {
* @param {import('@agoric/smart-wallet/src/smartWallet.js').BridgeAction} bridgeAction
* @param {import('./rpc.js').MinimalNetworkConfig & {
* from: string,
* fees?: string,
* verbose?: boolean,
Expand Down
2 changes: 1 addition & 1 deletion packages/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"lint:types": "tsc"
},
"devDependencies": {
"@endo/init": "^0.5.59",
"@endo/init": "^1.0.1",
"ava": "^5.3.0"
},
"ava": {
Expand Down
10 changes: 5 additions & 5 deletions packages/base-zone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
"license": "Apache-2.0",
"dependencies": {
"@agoric/store": "^0.9.2",
"@endo/exo": "^0.2.5",
"@endo/far": "^0.2.21",
"@endo/pass-style": "^0.1.6",
"@endo/patterns": "^0.2.5"
"@endo/exo": "^1.0.1",
"@endo/far": "^1.0.1",
"@endo/pass-style": "^1.0.1",
"@endo/patterns": "^1.0.1"
},
"devDependencies": {
"@endo/init": "^0.5.59",
"@endo/init": "^1.0.1",
"ava": "^5.3.0"
},
"publishConfig": {
Expand Down
2 changes: 0 additions & 2 deletions packages/base-zone/tools/greeter.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export const GreeterWithAdminI = M.interface('GreeterWithAdmin', {
*/
export const prepareGreeterSingleton = (zone, label, nick) => {
const myThis = Object.freeze({ state: { nick } });
// @ts-expect-error Until https://github.com/endojs/endo/pull/1771
return zone.exo(label, GreeterWithAdminI, {
...bindAllMethodsTo(greetFacet, myThis),
...bindAllMethodsTo(adminFacet, myThis),
Expand All @@ -55,7 +54,6 @@ export const prepareGreeterSingleton = (zone, label, nick) => {
* @param {import('../src/types.js').Zone} zone
*/
export const prepareGreeter = zone =>
// @ts-expect-error Until https://github.com/endojs/endo/pull/1771
zone.exoClass('Greeter', GreeterWithAdminI, nick => ({ nick }), {
...greetFacet,
...adminFacet,
Expand Down
4 changes: 2 additions & 2 deletions packages/base-zone/tools/testers.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const secondThrows = (t, fn, spec = alreadyExceptionSpec) => {

/**
* @param {import('ava').Assertions} t
* @param {import('../src/index').Zone} rootZone
* @param {import('../src/index.js').Zone} rootZone
*/
export const testFirstZoneIncarnation = (t, rootZone) => {
const subZone = secondThrows(t, () => rootZone.subZone('sub'));
Expand Down Expand Up @@ -94,7 +94,7 @@ export const testFirstZoneIncarnation = (t, rootZone) => {

/**
* @param {import('ava').Assertions} t
* @param {import('../src/index').Zone} rootZone
* @param {import('../src/index.js').Zone} rootZone
*/
export const testSecondZoneIncarnation = (t, rootZone) => {
const subZone = secondThrows(t, () => rootZone.subZone('sub'));
Expand Down
2 changes: 1 addition & 1 deletion packages/benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@agoric/inter-protocol": "^0.16.1",
"@agoric/vats": "^0.15.1",
"@agoric/zoe": "^0.26.2",
"@endo/init": "^0.5.59"
"@endo/init": "^1.0.1"
},
"devDependencies": {},
"files": [
Expand Down
16 changes: 8 additions & 8 deletions packages/boot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
"@agoric/vats": "^0.15.1",
"@agoric/vm-config": "^0.1.0",
"@agoric/zoe": "^0.26.2",
"@endo/marshal": "^0.8.8",
"@endo/bundle-source": "^2.7.0",
"@endo/captp": "^3.1.4",
"@endo/eventual-send": "^0.17.5",
"@endo/init": "^0.5.59",
"@endo/far": "^0.2.21",
"@endo/promise-kit": "^0.2.59",
"@endo/stream": "^0.3.28",
"@endo/marshal": "^1.0.1",
"@endo/bundle-source": "^3.0.1",
"@endo/captp": "^4.0.1",
"@endo/eventual-send": "^1.0.1",
"@endo/init": "^1.0.1",
"@endo/far": "^1.0.1",
"@endo/promise-kit": "^1.0.1",
"@endo/stream": "^1.0.1",
"import-meta-resolve": "^2.2.1"
},
"devDependencies": {
Expand Down
Loading
Loading