From 7c43b436db1d669cb32cc9e1532522c4a16de65d Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 8 May 2024 10:22:29 -0700 Subject: [PATCH 01/57] style: format scripts --- a3p-integration/scripts/generate-a3p-submissions.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/a3p-integration/scripts/generate-a3p-submissions.sh b/a3p-integration/scripts/generate-a3p-submissions.sh index 1b01b7cc85f2..a8d179f89efd 100755 --- a/a3p-integration/scripts/generate-a3p-submissions.sh +++ b/a3p-integration/scripts/generate-a3p-submissions.sh @@ -2,15 +2,15 @@ set -ueo pipefail # cd prints its target, so without the redirect, we get two copies -SCRIPT_DIR=$( cd ${0%/*} > /dev/null && pwd -P ) +SCRIPT_DIR=$(cd ${0%/*} > /dev/null && pwd -P) IFS=$'\n' for proposal in ./proposals/?:*; do cd $proposal while read -r line; do - IFS=' ' parts=( $line ) + IFS=' ' parts=($line) $SCRIPT_DIR/generate-a3p-submission.sh $proposal ${parts[@]} - done < <(jq -r < package.json '.agoricProposal["sdk-generate"][]') + done < <(jq -r '.agoricProposal["sdk-generate"][]' < package.json) cd - done From 9e45ad7f9a6d01f71fec86fbda62c9e846274bd5 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 8 May 2024 09:20:44 -0700 Subject: [PATCH 02/57] chore: rename generate-a3p-submissions --- a3p-integration/README.md | 6 +++--- a3p-integration/package.json | 2 +- a3p-integration/proposals/c:stake-bld/README.md | 2 +- ...generate-a3p-submissions.sh => build-all-submissions.sh} | 2 +- .../{generate-a3p-submission.sh => build-submission.sh} | 0 5 files changed, 6 insertions(+), 6 deletions(-) rename a3p-integration/scripts/{generate-a3p-submissions.sh => build-all-submissions.sh} (83%) rename a3p-integration/scripts/{generate-a3p-submission.sh => build-submission.sh} (100%) diff --git a/a3p-integration/README.md b/a3p-integration/README.md index 9139b146c85f..192f3b40042c 100644 --- a/a3p-integration/README.md +++ b/a3p-integration/README.md @@ -88,7 +88,7 @@ access SDK code, a script can be used to generate the `submission` content. Until there is [native support for build scripts in the `synthetic-chain` tool](https://github.com/Agoric/agoric-3-proposals/issues/87), `a3p-integration`'s `build:submissions` step invokes -`generate-a3p-submissions.sh` in `agoric-sdk` before starting the upgrade test. +`build-all-submissions.sh` in `agoric-sdk` before starting the upgrade test. For core eval proposals executing before the chain software upgrade, the `submission` should be checked in, since bundles built from newer software may not be compatible with older chains. @@ -127,7 +127,7 @@ make -C ../packages/deployment docker-build-sdk In a3p-integration, many core-eval proposals' `submission` content has to be generated from the local `agoric-sdk`, and must be rebuilt every time there is a -change. The `scripts/generate-a3p-submissions.sh` script contains commands to +change. The `scripts/build-all-submissions.sh` script contains commands to generate the core-eval content and move it to the expected proposal package's submission directory. The generation is executed as part of `a3p-integration`'s `build:submissions` step. Each proposal that requires such a build step should @@ -145,7 +145,7 @@ If the submission does require bundle references or other options to be provided, it should be written as two parts: a core eval (in `.../vats/proposals`) and a builder for it (in `.../builders/scripts/vats`). -The `generate-a3p-submissions.sh` script reads instructions from +The `build-all-submissions.sh` script reads instructions from `agoricProposal.sdk-generate` in `package.json`. That field contains a list of strings, each of which describes a single submission. If there is only one submission, it can use the default directory name `submission` by specifying diff --git a/a3p-integration/package.json b/a3p-integration/package.json index fe183229c7bd..b367d82189cf 100644 --- a/a3p-integration/package.json +++ b/a3p-integration/package.json @@ -6,7 +6,7 @@ "scripts": { "build": "yarn run build:sdk && yarn run build:submissions && yarn run build:synthetic-chain", "build:sdk": "make -C ../packages/deployment docker-build-sdk", - "build:submissions": "scripts/generate-a3p-submissions.sh", + "build:submissions": "scripts/build-all-submissions.sh", "build:synthetic-chain": "yarn synthetic-chain build", "test": "yarn synthetic-chain test", "doctor": "yarn synthetic-chain doctor" diff --git a/a3p-integration/proposals/c:stake-bld/README.md b/a3p-integration/proposals/c:stake-bld/README.md index 00964d4ff771..2ffe6d515f2d 100644 --- a/a3p-integration/proposals/c:stake-bld/README.md +++ b/a3p-integration/proposals/c:stake-bld/README.md @@ -2,4 +2,4 @@ CoreEvalProposal to install stakeBld contract The `submission` for the proposal is automatically generated during `yarn build` in `a3p-integration` using the code in agoric-sdk through -`script/generate-a3p-submissions.sh`. and `script/generate-a3p-submission.sh` +`script/build-all-submissions.sh`. and `script/build-submission.sh` diff --git a/a3p-integration/scripts/generate-a3p-submissions.sh b/a3p-integration/scripts/build-all-submissions.sh similarity index 83% rename from a3p-integration/scripts/generate-a3p-submissions.sh rename to a3p-integration/scripts/build-all-submissions.sh index a8d179f89efd..18315d86fb5b 100755 --- a/a3p-integration/scripts/generate-a3p-submissions.sh +++ b/a3p-integration/scripts/build-all-submissions.sh @@ -10,7 +10,7 @@ for proposal in ./proposals/?:*; do cd $proposal while read -r line; do IFS=' ' parts=($line) - $SCRIPT_DIR/generate-a3p-submission.sh $proposal ${parts[@]} + $SCRIPT_DIR/build-submission.sh $proposal ${parts[@]} done < <(jq -r '.agoricProposal["sdk-generate"][]' < package.json) cd - done diff --git a/a3p-integration/scripts/generate-a3p-submission.sh b/a3p-integration/scripts/build-submission.sh similarity index 100% rename from a3p-integration/scripts/generate-a3p-submission.sh rename to a3p-integration/scripts/build-submission.sh From b80bcf87d42f8c81ae3fe55d197c770863bde1e4 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 8 May 2024 10:19:40 -0700 Subject: [PATCH 03/57] fix: skip building submissions without sdk-generate --- a3p-integration/scripts/build-all-submissions.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/a3p-integration/scripts/build-all-submissions.sh b/a3p-integration/scripts/build-all-submissions.sh index 18315d86fb5b..ad97a44d388a 100755 --- a/a3p-integration/scripts/build-all-submissions.sh +++ b/a3p-integration/scripts/build-all-submissions.sh @@ -8,9 +8,10 @@ IFS=$'\n' for proposal in ./proposals/?:*; do cd $proposal + # build submission if proposal specifies an sdk-generate while read -r line; do IFS=' ' parts=($line) $SCRIPT_DIR/build-submission.sh $proposal ${parts[@]} - done < <(jq -r '.agoricProposal["sdk-generate"][]' < package.json) + done < <(jq -r '.agoricProposal["sdk-generate"][]?' < package.json) cd - done From cc25dadbff4fb09e68185f17ea6bf0f9cb64499e Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 8 May 2024 09:22:43 -0700 Subject: [PATCH 04/57] chore(deps): bump synthetic-chain to 0.1.0 --- a3p-integration/package.json | 2 +- a3p-integration/proposals/a:upgrade-next/package.json | 2 +- a3p-integration/proposals/a:upgrade-next/yarn.lock | 10 +++++----- a3p-integration/proposals/b:localchain/package.json | 2 +- a3p-integration/proposals/b:localchain/yarn.lock | 10 +++++----- a3p-integration/proposals/c:stake-bld/package.json | 2 +- a3p-integration/proposals/c:stake-bld/yarn.lock | 10 +++++----- a3p-integration/proposals/z:acceptance/package.json | 2 +- a3p-integration/proposals/z:acceptance/yarn.lock | 10 +++++----- a3p-integration/yarn.lock | 10 +++++----- 10 files changed, 30 insertions(+), 30 deletions(-) diff --git a/a3p-integration/package.json b/a3p-integration/package.json index b367d82189cf..ea69904c0f2f 100644 --- a/a3p-integration/package.json +++ b/a3p-integration/package.json @@ -12,7 +12,7 @@ "doctor": "yarn synthetic-chain doctor" }, "dependencies": { - "@agoric/synthetic-chain": "^0.0.10", + "@agoric/synthetic-chain": "^0.1.0", "@types/better-sqlite3": "^7.6.9" }, "packageManager": "yarn@4.1.1", diff --git a/a3p-integration/proposals/a:upgrade-next/package.json b/a3p-integration/proposals/a:upgrade-next/package.json index ba29668f9bc6..8f70d58186ed 100644 --- a/a3p-integration/proposals/a:upgrade-next/package.json +++ b/a3p-integration/proposals/a:upgrade-next/package.json @@ -14,7 +14,7 @@ "type": "module", "license": "Apache-2.0", "dependencies": { - "@agoric/synthetic-chain": "^0.0.10", + "@agoric/synthetic-chain": "^0.1.0", "ava": "^5.3.1" }, "ava": { diff --git a/a3p-integration/proposals/a:upgrade-next/yarn.lock b/a3p-integration/proposals/a:upgrade-next/yarn.lock index f99f929ef775..71cdf48439b7 100644 --- a/a3p-integration/proposals/a:upgrade-next/yarn.lock +++ b/a3p-integration/proposals/a:upgrade-next/yarn.lock @@ -5,9 +5,9 @@ __metadata: version: 8 cacheKey: 10c0 -"@agoric/synthetic-chain@npm:^0.0.10": - version: 0.0.10 - resolution: "@agoric/synthetic-chain@npm:0.0.10" +"@agoric/synthetic-chain@npm:^0.1.0": + version: 0.1.0 + resolution: "@agoric/synthetic-chain@npm:0.1.0" dependencies: "@endo/zip": "npm:^1.0.1" better-sqlite3: "npm:^9.4.0" @@ -15,7 +15,7 @@ __metadata: execa: "npm:^8.0.1" bin: synthetic-chain: dist/cli/cli.js - checksum: 10c0/c75308830cbe879ba865e285a20529ac82da1434c778046b27c790e426a8139369c3ef904939905ad73109202a336925733448109a85bc19aa2d350ebdb2a520 + checksum: 10c0/8305293d085cde9cbf94670134216e06337c5624c45faf5dfebb86762042abe7b4340cf3205e671dfce54e888bd4e9b3428400756833fa06f2bbb21b44668c44 languageName: node linkType: hard @@ -1820,7 +1820,7 @@ __metadata: version: 0.0.0-use.local resolution: "root-workspace-0b6124@workspace:." dependencies: - "@agoric/synthetic-chain": "npm:^0.0.10" + "@agoric/synthetic-chain": "npm:^0.1.0" ava: "npm:^5.3.1" languageName: unknown linkType: soft diff --git a/a3p-integration/proposals/b:localchain/package.json b/a3p-integration/proposals/b:localchain/package.json index 562e03412bad..5c2d63e2b2a2 100644 --- a/a3p-integration/proposals/b:localchain/package.json +++ b/a3p-integration/proposals/b:localchain/package.json @@ -9,7 +9,7 @@ "type": "module", "license": "Apache-2.0", "dependencies": { - "@agoric/synthetic-chain": "^0.0.10", + "@agoric/synthetic-chain": "^0.1.0", "ava": "^5.3.1" }, "ava": { diff --git a/a3p-integration/proposals/b:localchain/yarn.lock b/a3p-integration/proposals/b:localchain/yarn.lock index 2bcc71547238..858e7ddfc755 100644 --- a/a3p-integration/proposals/b:localchain/yarn.lock +++ b/a3p-integration/proposals/b:localchain/yarn.lock @@ -5,9 +5,9 @@ __metadata: version: 8 cacheKey: 10c0 -"@agoric/synthetic-chain@npm:^0.0.10": - version: 0.0.10 - resolution: "@agoric/synthetic-chain@npm:0.0.10" +"@agoric/synthetic-chain@npm:^0.1.0": + version: 0.1.0 + resolution: "@agoric/synthetic-chain@npm:0.1.0" dependencies: "@endo/zip": "npm:^1.0.1" better-sqlite3: "npm:^9.4.0" @@ -15,7 +15,7 @@ __metadata: execa: "npm:^8.0.1" bin: synthetic-chain: dist/cli/cli.js - checksum: 10c0/c75308830cbe879ba865e285a20529ac82da1434c778046b27c790e426a8139369c3ef904939905ad73109202a336925733448109a85bc19aa2d350ebdb2a520 + checksum: 10c0/8305293d085cde9cbf94670134216e06337c5624c45faf5dfebb86762042abe7b4340cf3205e671dfce54e888bd4e9b3428400756833fa06f2bbb21b44668c44 languageName: node linkType: hard @@ -1820,7 +1820,7 @@ __metadata: version: 0.0.0-use.local resolution: "root-workspace-0b6124@workspace:." dependencies: - "@agoric/synthetic-chain": "npm:^0.0.10" + "@agoric/synthetic-chain": "npm:^0.1.0" ava: "npm:^5.3.1" languageName: unknown linkType: soft diff --git a/a3p-integration/proposals/c:stake-bld/package.json b/a3p-integration/proposals/c:stake-bld/package.json index f39ade82c280..55a180788a86 100644 --- a/a3p-integration/proposals/c:stake-bld/package.json +++ b/a3p-integration/proposals/c:stake-bld/package.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@agoric/internal": "0.3.3-dev-5676146.0", - "@agoric/synthetic-chain": "^0.0.10", + "@agoric/synthetic-chain": "^0.1.0", "@cosmjs/stargate": "^0.32.3", "@cosmjs/tendermint-rpc": "^0.32.3", "@endo/errors": "^1.1.0", diff --git a/a3p-integration/proposals/c:stake-bld/yarn.lock b/a3p-integration/proposals/c:stake-bld/yarn.lock index 88543c08fbac..f5b921255904 100644 --- a/a3p-integration/proposals/c:stake-bld/yarn.lock +++ b/a3p-integration/proposals/c:stake-bld/yarn.lock @@ -365,9 +365,9 @@ __metadata: languageName: node linkType: hard -"@agoric/synthetic-chain@npm:^0.0.10": - version: 0.0.10 - resolution: "@agoric/synthetic-chain@npm:0.0.10" +"@agoric/synthetic-chain@npm:^0.1.0": + version: 0.1.0 + resolution: "@agoric/synthetic-chain@npm:0.1.0" dependencies: "@endo/zip": "npm:^1.0.1" better-sqlite3: "npm:^9.4.0" @@ -375,7 +375,7 @@ __metadata: execa: "npm:^8.0.1" bin: synthetic-chain: dist/cli/cli.js - checksum: 10c0/c75308830cbe879ba865e285a20529ac82da1434c778046b27c790e426a8139369c3ef904939905ad73109202a336925733448109a85bc19aa2d350ebdb2a520 + checksum: 10c0/8305293d085cde9cbf94670134216e06337c5624c45faf5dfebb86762042abe7b4340cf3205e671dfce54e888bd4e9b3428400756833fa06f2bbb21b44668c44 languageName: node linkType: hard @@ -4567,7 +4567,7 @@ __metadata: resolution: "root-workspace-0b6124@workspace:." dependencies: "@agoric/internal": "npm:0.3.3-dev-5676146.0" - "@agoric/synthetic-chain": "npm:^0.0.10" + "@agoric/synthetic-chain": "npm:^0.1.0" "@cosmjs/stargate": "npm:^0.32.3" "@cosmjs/tendermint-rpc": "npm:^0.32.3" "@endo/errors": "npm:^1.1.0" diff --git a/a3p-integration/proposals/z:acceptance/package.json b/a3p-integration/proposals/z:acceptance/package.json index f2f8101209c3..b5ad308a5f5a 100644 --- a/a3p-integration/proposals/z:acceptance/package.json +++ b/a3p-integration/proposals/z:acceptance/package.json @@ -5,7 +5,7 @@ "type": "module", "license": "Apache-2.0", "dependencies": { - "@agoric/synthetic-chain": "^0.0.10", + "@agoric/synthetic-chain": "^0.1.0", "ava": "^6.1.2" }, "ava": { diff --git a/a3p-integration/proposals/z:acceptance/yarn.lock b/a3p-integration/proposals/z:acceptance/yarn.lock index 007b7cbc0345..708f6030037a 100644 --- a/a3p-integration/proposals/z:acceptance/yarn.lock +++ b/a3p-integration/proposals/z:acceptance/yarn.lock @@ -5,9 +5,9 @@ __metadata: version: 8 cacheKey: 10c0 -"@agoric/synthetic-chain@npm:^0.0.10": - version: 0.0.10 - resolution: "@agoric/synthetic-chain@npm:0.0.10" +"@agoric/synthetic-chain@npm:^0.1.0": + version: 0.1.0 + resolution: "@agoric/synthetic-chain@npm:0.1.0" dependencies: "@endo/zip": "npm:^1.0.1" better-sqlite3: "npm:^9.4.0" @@ -15,7 +15,7 @@ __metadata: execa: "npm:^8.0.1" bin: synthetic-chain: dist/cli/cli.js - checksum: 10c0/c75308830cbe879ba865e285a20529ac82da1434c778046b27c790e426a8139369c3ef904939905ad73109202a336925733448109a85bc19aa2d350ebdb2a520 + checksum: 10c0/8305293d085cde9cbf94670134216e06337c5624c45faf5dfebb86762042abe7b4340cf3205e671dfce54e888bd4e9b3428400756833fa06f2bbb21b44668c44 languageName: node linkType: hard @@ -1961,7 +1961,7 @@ __metadata: version: 0.0.0-use.local resolution: "root-workspace-0b6124@workspace:." dependencies: - "@agoric/synthetic-chain": "npm:^0.0.10" + "@agoric/synthetic-chain": "npm:^0.1.0" ava: "npm:^6.1.2" languageName: unknown linkType: soft diff --git a/a3p-integration/yarn.lock b/a3p-integration/yarn.lock index 43335d20a3ff..ea0f0da04072 100644 --- a/a3p-integration/yarn.lock +++ b/a3p-integration/yarn.lock @@ -5,9 +5,9 @@ __metadata: version: 8 cacheKey: 10c0 -"@agoric/synthetic-chain@npm:^0.0.10": - version: 0.0.10 - resolution: "@agoric/synthetic-chain@npm:0.0.10" +"@agoric/synthetic-chain@npm:^0.1.0": + version: 0.1.0 + resolution: "@agoric/synthetic-chain@npm:0.1.0" dependencies: "@endo/zip": "npm:^1.0.1" better-sqlite3: "npm:^9.4.0" @@ -15,7 +15,7 @@ __metadata: execa: "npm:^8.0.1" bin: synthetic-chain: dist/cli/cli.js - checksum: 10c0/c75308830cbe879ba865e285a20529ac82da1434c778046b27c790e426a8139369c3ef904939905ad73109202a336925733448109a85bc19aa2d350ebdb2a520 + checksum: 10c0/8305293d085cde9cbf94670134216e06337c5624c45faf5dfebb86762042abe7b4340cf3205e671dfce54e888bd4e9b3428400756833fa06f2bbb21b44668c44 languageName: node linkType: hard @@ -990,7 +990,7 @@ __metadata: version: 0.0.0-use.local resolution: "root-workspace-0b6124@workspace:." dependencies: - "@agoric/synthetic-chain": "npm:^0.0.10" + "@agoric/synthetic-chain": "npm:^0.1.0" "@types/better-sqlite3": "npm:^7.6.9" languageName: unknown linkType: soft From e0f0b9104af2aa86b34bc96c3c383b930a980682 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 8 May 2024 09:28:28 -0700 Subject: [PATCH 05/57] build: print sizes of submission files --- a3p-integration/scripts/build-submission.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/a3p-integration/scripts/build-submission.sh b/a3p-integration/scripts/build-submission.sh index 81510193c0d0..2c90949ef42e 100755 --- a/a3p-integration/scripts/build-submission.sh +++ b/a3p-integration/scripts/build-submission.sh @@ -18,4 +18,5 @@ for plan in $plans; do base=${plan%-plan.json} cp $(grep -oh '/.*b1-.*.json' "$base"-plan.json) "$submissionDir" mv "$base"* "$submissionDir" + ls -oS "$submissionDir" done From be0d987652872f7f0309cbe5890191e708496e8b Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 2 May 2024 16:12:52 -0700 Subject: [PATCH 06/57] chore: update type-coverage --- packages/ERTP/package.json | 2 +- packages/SwingSet/package.json | 2 +- packages/base-zone/package.json | 2 +- packages/boot/package.json | 2 +- packages/cosmic-swingset/package.json | 2 +- packages/deploy-script-support/package.json | 2 +- packages/inter-protocol/package.json | 2 +- packages/internal/package.json | 2 +- packages/network/package.json | 2 +- packages/orchestration/package.json | 2 +- packages/pegasus/package.json | 2 +- packages/smart-wallet/package.json | 2 +- packages/store/package.json | 2 +- packages/swingset-liveslots/package.json | 2 +- packages/vats/package.json | 2 +- packages/zoe/package.json | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/ERTP/package.json b/packages/ERTP/package.json index f29190a597f8..0daece068db9 100644 --- a/packages/ERTP/package.json +++ b/packages/ERTP/package.json @@ -86,6 +86,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 90.62 + "atLeast": 90.61 } } diff --git a/packages/SwingSet/package.json b/packages/SwingSet/package.json index 53a803a78ff9..69dbaf6965fa 100644 --- a/packages/SwingSet/package.json +++ b/packages/SwingSet/package.json @@ -100,6 +100,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 75.02 + "atLeast": 75.01 } } diff --git a/packages/base-zone/package.json b/packages/base-zone/package.json index 2dbfe9531037..33953f2a93be 100644 --- a/packages/base-zone/package.json +++ b/packages/base-zone/package.json @@ -56,6 +56,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 88.55 + "atLeast": 89.75 } } diff --git a/packages/boot/package.json b/packages/boot/package.json index 578123de1187..ba7a03b8bbd1 100644 --- a/packages/boot/package.json +++ b/packages/boot/package.json @@ -91,6 +91,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 85.88 + "atLeast": 86.46 } } diff --git a/packages/cosmic-swingset/package.json b/packages/cosmic-swingset/package.json index 0cf750b91bb4..bfc78de8b068 100644 --- a/packages/cosmic-swingset/package.json +++ b/packages/cosmic-swingset/package.json @@ -68,6 +68,6 @@ "timeout": "20m" }, "typeCoverage": { - "atLeast": 80.49 + "atLeast": 80.48 } } diff --git a/packages/deploy-script-support/package.json b/packages/deploy-script-support/package.json index 323234c9559e..58562381c959 100644 --- a/packages/deploy-script-support/package.json +++ b/packages/deploy-script-support/package.json @@ -73,6 +73,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 81.47 + "atLeast": 81.51 } } diff --git a/packages/inter-protocol/package.json b/packages/inter-protocol/package.json index ed07d754e132..5fb811042a34 100644 --- a/packages/inter-protocol/package.json +++ b/packages/inter-protocol/package.json @@ -83,6 +83,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 95.89 + "atLeast": 95.85 } } diff --git a/packages/internal/package.json b/packages/internal/package.json index b07150362f0e..92e6a4c83855 100755 --- a/packages/internal/package.json +++ b/packages/internal/package.json @@ -53,6 +53,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 93.01 + "atLeast": 93.73 } } diff --git a/packages/network/package.json b/packages/network/package.json index bf603734c2a8..1d12835f659d 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -68,6 +68,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 89.73 + "atLeast": 89.47 } } diff --git a/packages/orchestration/package.json b/packages/orchestration/package.json index f37d3b47b17c..1f0534a09e15 100644 --- a/packages/orchestration/package.json +++ b/packages/orchestration/package.json @@ -81,6 +81,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 96.39 + "atLeast": 95.96 } } diff --git a/packages/pegasus/package.json b/packages/pegasus/package.json index 24f5125cc154..8cb21c326d68 100644 --- a/packages/pegasus/package.json +++ b/packages/pegasus/package.json @@ -71,6 +71,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 91.45 + "atLeast": 90.68 } } diff --git a/packages/smart-wallet/package.json b/packages/smart-wallet/package.json index 4548fbcdb9bc..239dfff3f21f 100644 --- a/packages/smart-wallet/package.json +++ b/packages/smart-wallet/package.json @@ -68,6 +68,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 93.99 + "atLeast": 94.01 } } diff --git a/packages/store/package.json b/packages/store/package.json index 56f10b4e2ddf..2af60428d5fe 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -58,6 +58,6 @@ "timeout": "2m" }, "typeCoverage": { - "atLeast": 86.34 + "atLeast": 86.12 } } diff --git a/packages/swingset-liveslots/package.json b/packages/swingset-liveslots/package.json index 655192ee75e5..b0cf2368d835 100644 --- a/packages/swingset-liveslots/package.json +++ b/packages/swingset-liveslots/package.json @@ -67,6 +67,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 75.29 + "atLeast": 75.31 } } diff --git a/packages/vats/package.json b/packages/vats/package.json index e89b230cd771..9535fbbd2d02 100644 --- a/packages/vats/package.json +++ b/packages/vats/package.json @@ -78,6 +78,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 91.5 + "atLeast": 91.26 } } diff --git a/packages/zoe/package.json b/packages/zoe/package.json index e5f3699fce06..16cab1139ba6 100644 --- a/packages/zoe/package.json +++ b/packages/zoe/package.json @@ -139,6 +139,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 84.9 + "atLeast": 84.88 } } From 1346f0857beeccc785d74fb7a84ce71c80e1f0b6 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 24 Apr 2024 12:06:09 -0700 Subject: [PATCH 07/57] chore(deps): drop obsolete Endo patch --- patches/@endo+exo+1.4.0.patch | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 patches/@endo+exo+1.4.0.patch diff --git a/patches/@endo+exo+1.4.0.patch b/patches/@endo+exo+1.4.0.patch deleted file mode 100644 index aad2781fa3b3..000000000000 --- a/patches/@endo+exo+1.4.0.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/node_modules/@endo/exo/index.d.ts b/node_modules/@endo/exo/index.d.ts -index 3bc696d..55df34e 100644 ---- a/node_modules/@endo/exo/index.d.ts -+++ b/node_modules/@endo/exo/index.d.ts -@@ -1,3 +1,4 @@ - export * from "./src/exo-makers.js"; - export { GET_INTERFACE_GUARD } from "./src/get-interface.js"; -+export * from "./src/types.js"; - //# sourceMappingURL=index.d.ts.map -\ No newline at end of file From 96a622da9ec1e7fd81d890c4362fd8a27dfb85c4 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 2 May 2024 15:54:33 -0700 Subject: [PATCH 08/57] build: use npm to avoid Yarn version dependency --- scripts/replace-packages.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/replace-packages.sh b/scripts/replace-packages.sh index dc934a93cec5..38309183155b 100755 --- a/scripts/replace-packages.sh +++ b/scripts/replace-packages.sh @@ -13,7 +13,7 @@ DSTDIR=${2-$PWD/node_modules} # Install and build the source directory. pushd "$SRCDIR" yarn install -yarn build +npm run build npm query .workspace | jq -r '.[].location' | while read -r dir; do # Skip private packages. test "$(jq .private < "$dir/package.json")" != true || continue @@ -23,7 +23,7 @@ npm query .workspace | jq -r '.[].location' | while read -r dir; do name=$(jq -r .name < package.json) stem=$(echo "$name" | sed -e 's!^@!!; s!/!-!g;') rm -f "${stem}"-*.tgz - yarn pack + npm pack tar -xvf "${stem}"-*.tgz # Replace the destination package. From e541823efa5795789274965b4901473effa7d107 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 2 May 2024 16:05:32 -0700 Subject: [PATCH 09/57] build: run 'build-types' when available --- scripts/replace-packages.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/replace-packages.sh b/scripts/replace-packages.sh index 38309183155b..7d6817a649f6 100755 --- a/scripts/replace-packages.sh +++ b/scripts/replace-packages.sh @@ -14,6 +14,8 @@ DSTDIR=${2-$PWD/node_modules} pushd "$SRCDIR" yarn install npm run build +# Endo requires this +npx lerna run build:types || true npm query .workspace | jq -r '.[].location' | while read -r dir; do # Skip private packages. test "$(jq .private < "$dir/package.json")" != true || continue From e9d06daef69a6226eaf36fc9ed359a43b604f03f Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 16 Jan 2024 10:17:34 -0800 Subject: [PATCH 10/57] test: await promises From 3919360778ced10b4fcff523ebf35f7af609567b Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 16 Jan 2024 10:04:52 -0800 Subject: [PATCH 11/57] chore(types): accommodate tighter Passable --- packages/ERTP/src/types.js | 5 ++++- packages/store/src/types.js | 4 ++-- packages/swingset-liveslots/src/vatDataTypes.d.ts | 5 +++-- packages/time/src/types.d.ts | 10 +++++++--- packages/zoe/tools/manualTimer.js | 10 ++++++---- packages/zoe/tools/types.js | 2 +- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/packages/ERTP/src/types.js b/packages/ERTP/src/types.js index 91a97b288b1f..c3828ea4e72e 100644 --- a/packages/ERTP/src/types.js +++ b/packages/ERTP/src/types.js @@ -366,4 +366,7 @@ export {}; /** @typedef {bigint} NatValue */ -/** @typedef {Key[]} SetValue */ +/** + * @template {Key} [K=Key] + * @typedef {K[]} SetValue + */ diff --git a/packages/store/src/types.js b/packages/store/src/types.js index f55b6f40047c..71148db109b7 100644 --- a/packages/store/src/types.js +++ b/packages/store/src/types.js @@ -50,7 +50,7 @@ export {}; */ /** - * @template {Key & object} [K=Key] + * @template {Key} [K=Key] * @typedef {object} WeakSetStore * @property {(key: K) => boolean} has Check if a key exists. The key can be any * JavaScript value, though the answer will always be false for keys that @@ -83,7 +83,7 @@ export {}; */ /** - * @template {Key & object} [K=Key] + * @template {Key} [K=Key] * @template {Passable} [V=Passable] * @typedef {object} WeakMapStore * @property {(key: K) => boolean} has Check if a key exists. The key can be any diff --git a/packages/swingset-liveslots/src/vatDataTypes.d.ts b/packages/swingset-liveslots/src/vatDataTypes.d.ts index 39c3ff7a32d7..b1af421557d5 100644 --- a/packages/swingset-liveslots/src/vatDataTypes.d.ts +++ b/packages/swingset-liveslots/src/vatDataTypes.d.ts @@ -5,7 +5,6 @@ * Behavior is a description when defining a kind of what facets it will have. * For the non-multi defineKind, there is just one facet so it doesn't have a key. */ -import type { InterfaceGuard, Pattern } from '@endo/patterns'; import type { MapStore, SetStore, @@ -14,6 +13,8 @@ import type { WeakSetStore, } from '@agoric/store'; import type { StateShape } from '@endo/exo'; +import type { RemotableObject } from '@endo/pass-style'; +import type { InterfaceGuard, Pattern } from '@endo/patterns'; import type { makeWatchedPromiseManager } from './watchedPromises.js'; // TODO should be moved into @endo/patterns and eventually imported here @@ -37,7 +38,7 @@ type OmitFirstArg = F extends (x: any, ...args: infer P) => infer R ? (...args: P) => R : never; -export type KindFacet = { +export type KindFacet = RemotableObject & { [K in keyof O]: OmitFirstArg; // omit the 'context' parameter }; diff --git a/packages/time/src/types.d.ts b/packages/time/src/types.d.ts index f2efe31c124f..f1d7d800e1d6 100644 --- a/packages/time/src/types.d.ts +++ b/packages/time/src/types.d.ts @@ -1,6 +1,6 @@ -import type { ERef } from '@endo/eventual-send'; +import type { ERef, RemotableBrand } from '@endo/eventual-send'; -import type { RankComparison } from '@endo/marshal'; +import type { RankComparison, RemotableObject } from '@endo/marshal'; /// @@ -107,7 +107,7 @@ export type CancelToken = object; * schedule a single wake() call, create a repeater that will allow scheduling * of events at regular intervals, or remove scheduled calls. */ -export interface TimerService { +export interface TimerServiceI { /** * Retrieve the latest timestamp */ @@ -181,6 +181,10 @@ export interface TimerService { */ getTimerBrand: () => TimerBrand; } +// XXX copied from Remotable helper return type +export type TimerService = TimerServiceI & + RemotableObject<'TimerService'> & + RemotableBrand<{}, TimerServiceI>; /** * Read-only access to a TimeService's current time. This allows reading the diff --git a/packages/zoe/tools/manualTimer.js b/packages/zoe/tools/manualTimer.js index 44c9f3a639b2..8573bfe74427 100644 --- a/packages/zoe/tools/manualTimer.js +++ b/packages/zoe/tools/manualTimer.js @@ -3,7 +3,11 @@ import { bindAllMethods } from '@agoric/internal'; import { buildManualTimer as build } from '@agoric/swingset-vat/tools/manual-timer.js'; import { TimeMath } from '@agoric/time'; -/** @import {TimerService} from '@agoric/time' */ +/** + * @import {TimerServiceI} from '@agoric/time'; + * @import {RemotableObject} from '@endo/pass-style'; + * @import {RemotableBrand} from '@endo/eventual-send'; + */ const { Fail } = assert; @@ -28,9 +32,7 @@ const nolog = (..._args) => {}; * @property {(nTimes: number, msg?: string) => Promise} tickN */ -/** - * @typedef {TimerService & ManualTimerAdmin} ManualTimer - */ +/** @typedef {TimerServiceI & RemotableObject<'TimerService'> & RemotableBrand & ManualTimerAdmin} ManualTimer */ /** * A fake TimerService, for unit tests that do not use a real diff --git a/packages/zoe/tools/types.js b/packages/zoe/tools/types.js index 13ee37f5de5f..ce842f1cb928 100644 --- a/packages/zoe/tools/types.js +++ b/packages/zoe/tools/types.js @@ -22,7 +22,7 @@ export {}; * The amount supplied to a trade * @property {Amount<'nat'>} amountOut * The quoted result of trading `amountIn` - * @property {import('@agoric/time').TimerService} timer + * @property {import('@endo/patterns').RemotableObject & import('@agoric/time').TimerService} timer * The service that gave the `timestamp` * @property {import('@agoric/time').TimestampRecord} timestamp * A timestamp according to `timer` for the quote From 0f6d7e5f8f5d84c70417642ae252d4b0a6b87a81 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 18 Jan 2024 11:29:02 -0800 Subject: [PATCH 12/57] chore(types): Amount member --- packages/ERTP/src/amountMath.js | 5 ++-- packages/ERTP/src/types.js | 33 ++++++++++++------------ packages/zoe/tools/fakePriceAuthority.js | 19 ++++++++------ packages/zoe/tools/types.js | 2 +- 4 files changed, 32 insertions(+), 27 deletions(-) diff --git a/packages/ERTP/src/amountMath.js b/packages/ERTP/src/amountMath.js index 314a5644a781..aec39d80744e 100644 --- a/packages/ERTP/src/amountMath.js +++ b/packages/ERTP/src/amountMath.js @@ -202,9 +202,10 @@ const AmountMath = { * Make an amount from a value by adding the brand. * * @template {AssetKind} K + * @template {Key} [M=any] member kind * @param {Brand} brand - * @param {AssetValueForKind} allegedValue - * @returns {Amount} + * @param {AssetValueForKind} allegedValue + * @returns {Amount} */ // allegedValue has a conditional expression for type widening, to prevent V being bound to a a literal like 1n make: (brand, allegedValue) => { diff --git a/packages/ERTP/src/types.js b/packages/ERTP/src/types.js index c3828ea4e72e..75958afd4459 100644 --- a/packages/ERTP/src/types.js +++ b/packages/ERTP/src/types.js @@ -5,13 +5,13 @@ export {}; /// /** - * @import {ERef} from '@endo/far'); - * @import {CopySet, Key} from '@endo/patterns'); + * @import {CopyBag, CopySet, Key} from '@endo/patterns') * @import {LatestTopic, NotifierRecord} from '@agoric/notifier'); */ /** * @template {AssetKind} [K=AssetKind] + * @template {Key} [M=Key] member kind, for Amounts that have member values * @typedef {object} Amount Amounts are descriptions of digital assets, * answering the questions "how much" and "of what kind". Amounts are values * labeled with a brand. AmountMath executes the logic of how amounts are @@ -21,7 +21,7 @@ export {}; * bucks. AmountMath relies heavily on polymorphic MathHelpers, which * manipulate the unbranded portion. * @property {Brand} brand - * @property {AssetValueForKind} value + * @property {AssetValueForKind} value */ /** @@ -54,14 +54,15 @@ export {}; /** * @template {AssetKind} K + * @template {Key} [M=Key] member kind, for Amounts that have member values * @typedef {K extends 'nat' * ? NatValue * : K extends 'set' - * ? SetValue + * ? SetValue * : K extends 'copySet' - * ? CopySet + * ? CopySet * : K extends 'copyBag' - * ? import('@endo/patterns').CopyBag + * ? CopyBag * : never} AssetValueForKind */ @@ -96,10 +97,10 @@ export {}; /** * @template {AssetKind} [K=AssetKind] - * @typedef {object} Brand The brand identifies the kind of issuer, and has a - * function to get the alleged name for the kind of asset described. The - * alleged name (such as 'BTC' or 'moola') is provided by the maker of the - * issuer and should not be trusted as accurate. + * @typedef {import('@endo/marshal').RemotableObject} Brand The brand identifies + * the kind of issuer, and has a function to get the alleged name for the kind + * of asset described. The alleged name (such as 'BTC' or 'moola') is provided + * by the maker of the issuer and should not be trusted as accurate. * * Every amount created by a particular AmountMath will share the same brand, * but recipients cannot rely on the brand to verify that a purported amount @@ -314,12 +315,12 @@ export {}; /** * @template {AssetKind} [K=AssetKind] - * @typedef {object} Payment Payments hold amount of digital assets of the same - * brand in transit. Payments can be deposited in purses, split into multiple - * payments, combined, and claimed (getting an exclusive payment). Payments - * are linear, meaning that either a payment has the same amount of digital - * assets it started with, or it is used up entirely. It is impossible to - * partially use a payment. + * @typedef {import('@endo/marshal').RemotableObject} Payment Payments hold + * amount of digital assets of the same brand in transit. Payments can be + * deposited in purses, split into multiple payments, combined, and claimed + * (getting an exclusive payment). Payments are linear, meaning that either a + * payment has the same amount of digital assets it started with, or it is + * used up entirely. It is impossible to partially use a payment. * * Payments are often received from other actors and therefore should not be * trusted themselves. To get the amount of digital assets in a payment, use diff --git a/packages/zoe/tools/fakePriceAuthority.js b/packages/zoe/tools/fakePriceAuthority.js index 7c93d869ce8a..4ce2224d810c 100644 --- a/packages/zoe/tools/fakePriceAuthority.js +++ b/packages/zoe/tools/fakePriceAuthority.js @@ -117,16 +117,19 @@ export async function makeFakePriceAuthority(options) { natSafeMath.multiply(amountIn.value, tradeValueOut), tradeValueIn, ); + /** @type {Amount<'set', PriceDescription>} */ const quoteAmount = AmountMath.make( quoteBrand, - harden([ - { - amountIn, - amountOut: AmountMath.make(actualBrandOut, valueOut), - timer, - timestamp: quoteTime, - }, - ]), + /** @type {[PriceDescription]} */ ( + harden([ + { + amountIn, + amountOut: AmountMath.make(actualBrandOut, valueOut), + timer, + timestamp: quoteTime, + }, + ]) + ), ); const quote = harden({ quotePayment: E(quoteMint).mintPayment(quoteAmount), diff --git a/packages/zoe/tools/types.js b/packages/zoe/tools/types.js index ce842f1cb928..6fc8a2f7732b 100644 --- a/packages/zoe/tools/types.js +++ b/packages/zoe/tools/types.js @@ -3,7 +3,7 @@ export {}; /** * @typedef {object} PriceQuote - * @property {Amount<'set'>} quoteAmount + * @property {Amount<'set', PriceDescription>} quoteAmount * Amount whose value is a PriceQuoteValue * @property {ERef>} quotePayment * The `quoteAmount` wrapped as a payment From cdf1b7a6ee28293ba5d606705e24a9fee175effe Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 24 Apr 2024 16:35:35 -0700 Subject: [PATCH 13/57] feat(types): InvitationAmount --- packages/agoric-cli/src/lib/wallet.js | 2 +- packages/deploy-script-support/src/offer.js | 2 +- packages/governance/src/types.js | 2 +- .../test/smartWallet/test-psm-integration.js | 2 +- packages/smart-wallet/src/smartWallet.js | 2 +- packages/smart-wallet/test/test-invitation1.js | 2 +- packages/zoe/src/contractFacet/types-ambient.d.ts | 7 ++++++- packages/zoe/src/zoeService/makeInvitation.js | 3 +++ packages/zoe/src/zoeService/zoeStorageManager.js | 1 + 9 files changed, 16 insertions(+), 7 deletions(-) diff --git a/packages/agoric-cli/src/lib/wallet.js b/packages/agoric-cli/src/lib/wallet.js index 2aa1e1fe4547..610135d29105 100644 --- a/packages/agoric-cli/src/lib/wallet.js +++ b/packages/agoric-cli/src/lib/wallet.js @@ -187,7 +187,7 @@ export const sendAction = async (bridgeAction, opts) => { */ export const findContinuingIds = (current, agoricNames) => { // XXX should runtime type-check - /** @type {{ offerToUsedInvitation: [string, Amount<'set'>][]}} */ + /** @type {{ offerToUsedInvitation: [string, InvitationAmount][]}} */ const { offerToUsedInvitation: entries } = /** @type {any} */ (current); Array.isArray(entries) || Fail`entries must be an array: ${entries}`; diff --git a/packages/deploy-script-support/src/offer.js b/packages/deploy-script-support/src/offer.js index da300ddf9e52..5f71a05bd2a9 100644 --- a/packages/deploy-script-support/src/offer.js +++ b/packages/deploy-script-support/src/offer.js @@ -28,7 +28,7 @@ export const makeOfferAndFindInvitationAmount = ( ) => { /** * @param {Record} invitationDetailsCriteria - * @returns {Promise>} invitationAmount + * @returns {Promise} invitationAmount */ const findInvitationAmount = async invitationDetailsCriteria => { const invitationAmount = await E(zoeInvitationPurse).getCurrentAmount(); diff --git a/packages/governance/src/types.js b/packages/governance/src/types.js index 23c8e3ddec7c..5d2671d87a1f 100644 --- a/packages/governance/src/types.js +++ b/packages/governance/src/types.js @@ -430,7 +430,7 @@ export {}; * @property {(name: string) => Brand} getBrand * @property {(name: string) => Instance} getInstance * @property {(name: string) => Installation} getInstallation - * @property {(name: string) => Amount<'set'>} getInvitationAmount + * @property {(name: string) => InvitationAmount} getInvitationAmount * @property {(name: string) => bigint} getNat * @property {(name: string) => Ratio} getRatio * @property {(name: string) => string} getString diff --git a/packages/inter-protocol/test/smartWallet/test-psm-integration.js b/packages/inter-protocol/test/smartWallet/test-psm-integration.js index 8aa62f3ae104..65450049c10e 100644 --- a/packages/inter-protocol/test/smartWallet/test-psm-integration.js +++ b/packages/inter-protocol/test/smartWallet/test-psm-integration.js @@ -245,7 +245,7 @@ test('govern offerFilter', async t => { invitationBrand, 'invitation brand from context matches zoe', ); - /** @type {Amount<'set'>} */ + /** @type {InvitationAmount} */ const invitationsAmount = NonNullish(balances.get(brand)); t.is(invitationsAmount?.value.length, len, 'invitation count'); return invitationsAmount.value.filter(i => i.description === desc); diff --git a/packages/smart-wallet/src/smartWallet.js b/packages/smart-wallet/src/smartWallet.js index 9ef0da191350..2926fb06da05 100644 --- a/packages/smart-wallet/src/smartWallet.js +++ b/packages/smart-wallet/src/smartWallet.js @@ -150,7 +150,7 @@ const trace = makeTracer('SmrtWlt'); * address: string, * bank: ERef, * currentStorageNode: StorageNode, - * invitationPurse: Purse<'set'>, + * invitationPurse: Purse<'set', InvitationDetails>, * walletStorageNode: StorageNode, * }} UniqueParams * diff --git a/packages/smart-wallet/test/test-invitation1.js b/packages/smart-wallet/test/test-invitation1.js index 93808a1154a5..ad5697b13ff2 100644 --- a/packages/smart-wallet/test/test-invitation1.js +++ b/packages/smart-wallet/test/test-invitation1.js @@ -150,7 +150,7 @@ test.before(async t => (t.context = await makeTestContext(t))); test.serial('handle failure to create invitation', async t => { const { powers, makeSmartWallet, spendable, shared } = t.context; const { chainStorage, board } = powers.consume; - /** @type {Issuer<'set'>} */ + /** @type {Issuer<'set', InvitationDetails>} */ // @ts-expect-error cast const invitationIssuer = powers.issuer.consume.Invitation; const address = 'agoric1234'; diff --git a/packages/zoe/src/contractFacet/types-ambient.d.ts b/packages/zoe/src/contractFacet/types-ambient.d.ts index 858a1c89f3d7..4382c0432842 100644 --- a/packages/zoe/src/contractFacet/types-ambient.d.ts +++ b/packages/zoe/src/contractFacet/types-ambient.d.ts @@ -6,6 +6,8 @@ type IssuerOptionsRecord = import('@agoric/ertp').IssuerOptionsRecord; type Completion = any; type ZCFMakeEmptySeatKit = (exit?: ExitRule | undefined) => ZcfSeatKit; +type InvitationAmount = Amount<'set', InvitationDetails>; + /** * Zoe Contract Facet * @@ -243,7 +245,10 @@ type AdminFacet = import('../zoeService/utils').AdminFacet; declare const OfferReturn: unique symbol; declare const OfferArgs: unique symbol; -type Invitation = Payment<'set'> & { +type Invitation = Payment< + 'set', + InvitationDetails +> & { // because TS is structural, without this the generic is ignored [OfferReturn]?: R; [OfferArgs]?: A; diff --git a/packages/zoe/src/zoeService/makeInvitation.js b/packages/zoe/src/zoeService/makeInvitation.js index 320de457143e..5a755ed0d7a4 100644 --- a/packages/zoe/src/zoeService/makeInvitation.js +++ b/packages/zoe/src/zoeService/makeInvitation.js @@ -28,6 +28,9 @@ export const prepareInvitationKit = (baggage, shutdownZoeVat = undefined) => { // Upgrade this legacy state by simply deleting it. invitationKitBaggage.delete(ZOE_INVITATION_KIT); } + + /** @type {IssuerKit<'set', InvitationDetails>} */ + // @ts-expect-error cast const invitationKit = prepareIssuerKit( invitationKitBaggage, 'Zoe Invitation', diff --git a/packages/zoe/src/zoeService/zoeStorageManager.js b/packages/zoe/src/zoeService/zoeStorageManager.js index e1f49abcea4f..bfd23e38adb2 100644 --- a/packages/zoe/src/zoeService/zoeStorageManager.js +++ b/packages/zoe/src/zoeService/zoeStorageManager.js @@ -401,6 +401,7 @@ export const makeZoeStorageManager = ( contractBundleCap, contractLabel, ); + // @ts-expect-error checked cast return makeInstanceStorageManager(instanceRecord, adminNode, root) .instanceStorageManager; }; From 17938edf0b7a16ce6fc92149dea6ae4f19cf469f Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 18 Jan 2024 11:29:12 -0800 Subject: [PATCH 14/57] chore(types): indicate remotable --- packages/time/src/types.d.ts | 2 +- packages/zoe/tools/fakePriceAuthority.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/time/src/types.d.ts b/packages/time/src/types.d.ts index f1d7d800e1d6..d305ae4744e4 100644 --- a/packages/time/src/types.d.ts +++ b/packages/time/src/types.d.ts @@ -28,7 +28,7 @@ import type { RankComparison, RemotableObject } from '@endo/marshal'; * See https://github.com/Agoric/agoric-sdk/issues/5798 * and https://github.com/Agoric/agoric-sdk/pull/5821 */ -export type TimerBrand = { +export type TimerBrand = RemotableObject & { isMyTimerService: (timer: TimerService) => ERef; isMyClock: (clock: Clock) => ERef; }; diff --git a/packages/zoe/tools/fakePriceAuthority.js b/packages/zoe/tools/fakePriceAuthority.js index 4ce2224d810c..3abdbca3ccb3 100644 --- a/packages/zoe/tools/fakePriceAuthority.js +++ b/packages/zoe/tools/fakePriceAuthority.js @@ -28,7 +28,7 @@ const timestampLTE = (a, b) => TimeMath.compareAbs(a, b) <= 0; * @property {Brand<'nat'>} actualBrandOut * @property {Array} [priceList] * @property {Array<[number, number]>} [tradeList] - * @property {ERef} timer + * @property {import('@agoric/time').TimerService} timer * @property {import('@agoric/time').RelativeTime} [quoteInterval] * @property {ERef>} [quoteMint] * @property {Amount<'nat'>} [unitAmountIn] From 2facd008919ec67e758d665c44aa748172a1de5c Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 18 Jan 2024 12:48:02 -0800 Subject: [PATCH 15/57] chore(types): constrain parameter --- packages/base-zone/src/types.js | 6 +++--- packages/store/src/stores/scalarSetStore.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/base-zone/src/types.js b/packages/base-zone/src/types.js index 8fb335a14caa..c7eaf060e159 100644 --- a/packages/base-zone/src/types.js +++ b/packages/base-zone/src/types.js @@ -28,9 +28,9 @@ export {}; * @typedef {object} Stores * @property {() => Stores} detached obtain store providers which are detached (the stores are anonymous rather than bound to `label` in the zone) * @property {(specimen: unknown) => boolean} isStorable return true if the specimen can be stored in the zone, whether as exo-object state or in a store - * @property {(label: string, options?: StoreOptions) => MapStore} mapStore provide a Map-like store named `label` in the zone - * @property {(label: string, options?: StoreOptions) => SetStore} setStore provide a Set-like store named `label` in the zone - * @property {( + * @property {(label: string, options?: StoreOptions) => MapStore} mapStore provide a Map-like store named `label` in the zone + * @property {(label: string, options?: StoreOptions) => SetStore} setStore provide a Set-like store named `label` in the zone + * @property {( * label: string, options?: StoreOptions) => WeakMapStore * } weakMapStore provide a WeakMap-like store named `label` in the zone * @property {( diff --git a/packages/store/src/stores/scalarSetStore.js b/packages/store/src/stores/scalarSetStore.js index e7698954cd9a..5d4eecec0d0d 100644 --- a/packages/store/src/stores/scalarSetStore.js +++ b/packages/store/src/stores/scalarSetStore.js @@ -18,7 +18,7 @@ import { makeCurrentKeysKit } from './store-utils.js'; const { quote: q } = assert; /** - * @template K + * @template {Key} K * @param {Set} jsset * @param {(k: K) => void} assertKeyOkToAdd * @param {(k: K) => void} [assertKeyOkToDelete] From 498fbcb82679a2017549af8896f057f4f26073e7 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 18 Jan 2024 16:10:46 -0800 Subject: [PATCH 16/57] chore(types): member types for container amounts --- packages/ERTP/src/amountMath.js | 121 ++++++++------ packages/ERTP/src/issuerKit.js | 2 +- packages/ERTP/src/paymentLedger.js | 8 +- packages/ERTP/src/types.js | 156 +++++++++++------- .../basicFunctionality/bootstrap.js | 3 +- packages/ERTP/test/types.test-d.ts | 8 +- .../test/unitTests/mathHelpers/mockBrand.js | 45 ++++- .../mathHelpers/test-copyBagMathHelpers.js | 2 +- .../mathHelpers/test-copySetMathHelpers.js | 4 +- .../mathHelpers/test-natMathHelpers.js | 2 +- .../mathHelpers/test-setMathHelpers.js | 2 +- .../mathHelpers/test-strSetMathHelpers.js | 2 +- .../test/unitTests/test-amountProperties.js | 2 +- .../test/unitTests/test-inputValidation.js | 2 +- .../unitTests/test-legacy-payment-helpers.js | 2 + packages/ERTP/test/unitTests/test-recovery.js | 2 + .../inter-protocol/src/contractSupport.js | 10 +- .../inter-protocol/src/vaultFactory/vault.js | 14 +- packages/zoe/src/cleanProposal.js | 7 + .../zoe/src/contractFacet/types-ambient.d.ts | 6 +- packages/zoe/src/contractFacet/zcfSeat.js | 2 +- .../priceAuthorityTransform.js | 6 +- packages/zoe/src/contractSupport/ratio.js | 31 ++-- packages/zoe/src/contracts/autoswap.js | 6 +- .../contracts/callSpread/pricedCallSpread.js | 1 + packages/zoe/src/contracts/loan/borrow.js | 4 +- packages/zoe/src/contracts/priceAggregator.js | 7 +- packages/zoe/src/internal-types.js | 4 +- packages/zoe/src/types-ambient.js | 3 +- packages/zoe/src/zoeService/escrowStorage.js | 2 +- packages/zoe/src/zoeService/types-ambient.js | 2 +- .../contracts/test-priceAggregator.js | 36 ++-- .../unitTests/contracts/test-sellTickets.js | 3 +- .../zoe/test/unitTests/setupBasicMints.js | 2 +- packages/zoe/tools/types.js | 6 +- 35 files changed, 321 insertions(+), 194 deletions(-) diff --git a/packages/ERTP/src/amountMath.js b/packages/ERTP/src/amountMath.js index aec39d80744e..1e8ffc190a5e 100644 --- a/packages/ERTP/src/amountMath.js +++ b/packages/ERTP/src/amountMath.js @@ -6,7 +6,10 @@ import { setMathHelpers } from './mathHelpers/setMathHelpers.js'; import { copySetMathHelpers } from './mathHelpers/copySetMathHelpers.js'; import { copyBagMathHelpers } from './mathHelpers/copyBagMathHelpers.js'; -/** @import {Amount, AssetKind, AmountValue, AssetKindForValue, AssetValueForKind, Brand, MathHelpers} from './types.js' */ +/** + * @import {CopyBag, CopySet} from '@endo/patterns'; + * @import {Amount, AssetKind, AmountValue, AssetKindForValue, AssetValueForKind, Brand, CopyBagAmount, CopySetAmount, MathHelpers, NatAmount, NatValue, SetAmount, SetValue} from './types.js'; + */ const { quote: q, Fail } = assert; @@ -76,26 +79,19 @@ const helpers = { copyBag: copyBagMathHelpers, }; -/** - * @template {AmountValue} V - * @type {(value: V) => AssetKindForValue} - */ +/** @type {(value: unknown) => 'nat' | 'set' | 'copySet' | 'copyBag'} } */ const assertValueGetAssetKind = value => { const passStyle = passStyleOf(value); if (passStyle === 'bigint') { - // @ts-expect-error cast return 'nat'; } if (passStyle === 'copyArray') { - // @ts-expect-error cast return 'set'; } if (matches(value, M.set())) { - // @ts-expect-error cast return 'copySet'; } if (matches(value, M.bag())) { - // @ts-expect-error cast return 'copyBag'; } // TODO This isn't quite the right error message, in case valuePassStyle @@ -113,7 +109,7 @@ const assertValueGetAssetKind = value => { * * Made available only for testing, but it is harmless for other uses. * - * @template {AmountValue} V + * @template V * @param {V} value * @returns {MathHelpers} */ @@ -201,27 +197,39 @@ const AmountMath = { /** * Make an amount from a value by adding the brand. * - * @template {AssetKind} K - * @template {Key} [M=any] member kind - * @param {Brand} brand - * @param {AssetValueForKind} allegedValue - * @returns {Amount} + * Does not verify that the Brand's AssetKind matches the value's. + * + * @template {Brand} B + * @template {NatValue | CopySet | CopyBag | SetValue} V + * @param {B} brand + * @param {V} allegedValue + * @returns {B extends Brand<'nat'> + * ? NatAmount + * : V extends NatValue + * ? NatAmount + * : V extends CopySet + * ? CopySetAmount + * : V extends CopyBag + * ? CopyBagAmount + * : V extends SetValue + * ? SetAmount + * : never} */ - // allegedValue has a conditional expression for type widening, to prevent V being bound to a a literal like 1n make: (brand, allegedValue) => { assertRemotable(brand, 'brand'); const h = assertValueGetHelpers(allegedValue); const value = h.doCoerce(allegedValue); + // @ts-expect-error cast return harden({ brand, value }); }, /** * Make sure this amount is valid enough, and return a corresponding valid * amount if so. * - * @template {AssetKind} K - * @param {Brand} brand - * @param {Amount} allegedAmount - * @returns {Amount} + * @template {Amount} A + * @param {Brand} brand + * @param {A} allegedAmount + * @returns {A} */ coerce: (brand, allegedAmount) => { assertRemotable(brand, 'brand'); @@ -230,15 +238,16 @@ const AmountMath = { brand === allegedBrand || Fail`The brand in the allegedAmount ${allegedAmount} in 'coerce' didn't match the specified brand ${brand}.`; // Will throw on inappropriate value + // @ts-expect-error cast return AmountMath.make(brand, allegedValue); }, /** * Extract and return the value. * - * @template {AssetKind} K - * @param {Brand} brand - * @param {Amount} amount - * @returns {AssetValueForKind} + * @template {Amount} A + * @param {Brand} brand + * @param {A} amount + * @returns {A['value']} */ getValue: (brand, amount) => AmountMath.coerce(brand, amount).value, /** @@ -247,29 +256,29 @@ const AmountMath = { * * @type {{ * (brand: Brand): Amount<'nat'>; - * (brand: Brand, assetKind: K): Amount; + * (brand: Brand, assetKind: K): Amount; * }} */ makeEmpty: (brand, assetKind = /** @type {const} */ ('nat')) => { assertRemotable(brand, 'brand'); assertAssetKind(assetKind); const value = helpers[assetKind].doMakeEmpty(); + // @ts-expect-error XXX narrowing from function overload return harden({ brand, value }); }, /** * Return the amount representing an empty amount, using another amount as the * template for the brand and assetKind. * - * @template {AssetKind} K - * @param {Amount} amount - * @returns {Amount} + * @template {Amount} A + * @param {A} amount + * @returns {A} */ makeEmptyFromAmount: amount => { assertRecord(amount, 'amount'); const { brand, value } = amount; - // @ts-expect-error cast const assetKind = assertValueGetAssetKind(value); - // @ts-expect-error cast (ignore b/c erroring in CI but not my IDE) + // @ts-expect-error different subtype return AmountMath.makeEmpty(brand, assetKind); }, /** @@ -292,10 +301,10 @@ const AmountMath = { * Returns true if the leftAmount equals the rightAmount. We assume that if * isGTE is true in both directions, isEqual is also true * - * @template {AssetKind} K - * @param {Amount} leftAmount - * @param {Amount} rightAmount - * @param {Brand} [brand] + * @template {Amount} A + * @param {A} leftAmount + * @param {A} rightAmount + * @param {Brand} [brand] * @returns {boolean} */ isEqual: (leftAmount, rightAmount, brand = undefined) => { @@ -309,15 +318,16 @@ const AmountMath = { * amount, it usually means including all of the elements from both left and * right. * - * @template {AssetKind} K - * @param {Amount} leftAmount - * @param {Amount} rightAmount - * @param {Brand} [brand] - * @returns {Amount} + * @template {Amount} A + * @param {A} leftAmount + * @param {A} rightAmount + * @param {Brand} [brand] + * @returns {A} */ add: (leftAmount, rightAmount, brand = undefined) => { const h = checkLRAndGetHelpers(leftAmount, rightAmount, brand); const value = h.doAdd(...coerceLR(h, leftAmount, rightAmount)); + // @ts-expect-error different subtype return harden({ brand: leftAmount.brand, value }); }, /** @@ -327,25 +337,27 @@ const AmountMath = { * error. Because the left amount must include the right amount, this is NOT * equivalent to set subtraction. * - * @template {AssetKind} K - * @param {Amount} leftAmount - * @param {Amount} rightAmount - * @param {Brand} [brand] - * @returns {Amount} + * @template {Amount} L + * @template {Amount} R + * @param {L} leftAmount + * @param {R} rightAmount + * @param {Brand} [brand] + * @returns {L extends R ? L : never} */ subtract: (leftAmount, rightAmount, brand = undefined) => { const h = checkLRAndGetHelpers(leftAmount, rightAmount, brand); const value = h.doSubtract(...coerceLR(h, leftAmount, rightAmount)); + // @ts-expect-error different subtype return harden({ brand: leftAmount.brand, value }); }, /** * Returns the min value between x and y using isGTE * - * @template {AssetKind} K - * @param {Amount} x - * @param {Amount} y - * @param {Brand} [brand] - * @returns {Amount} + * @template {Amount} A + * @param {A} x + * @param {A} y + * @param {Brand} [brand] + * @returns {A} */ min: (x, y, brand = undefined) => // eslint-disable-next-line no-nested-ternary @@ -357,11 +369,11 @@ const AmountMath = { /** * Returns the max value between x and y using isGTE * - * @template {AssetKind} K - * @param {Amount} x - * @param {Amount} y - * @param {Brand} [brand] - * @returns {Amount} + * @template {Amount} A + * @param {A} x + * @param {A} y + * @param {Brand} [brand] + * @returns {A} */ max: (x, y, brand = undefined) => // eslint-disable-next-line no-nested-ternary @@ -377,7 +389,6 @@ harden(AmountMath); const getAssetKind = amount => { assertRecord(amount, 'amount'); const { value } = amount; - // @ts-expect-error cast (ignore b/c erroring in CI but not my IDE) return assertValueGetAssetKind(value); }; harden(getAssetKind); diff --git a/packages/ERTP/src/issuerKit.js b/packages/ERTP/src/issuerKit.js index 107e245f8426..0a4ee145b7a9 100644 --- a/packages/ERTP/src/issuerKit.js +++ b/packages/ERTP/src/issuerKit.js @@ -325,7 +325,7 @@ harden(prepareIssuerKit); * anything else is corrupted by that corrupted state. See * https://github.com/Agoric/agoric-sdk/issues/3434 * @param {IssuerOptionsRecord} [options] - * @returns {IssuerKit} + * @returns {IssuerKit} */ export const makeIssuerKit = ( name, diff --git a/packages/ERTP/src/paymentLedger.js b/packages/ERTP/src/paymentLedger.js index 5b9645f7e06d..02c3c6e851c1 100644 --- a/packages/ERTP/src/paymentLedger.js +++ b/packages/ERTP/src/paymentLedger.js @@ -96,7 +96,6 @@ export const preparePaymentLedger = ( // Should be // at-ts-expect-error XXX callWhen // but ran into the usual disagreement between local lint and CI - // @ts-expect-error const brand = issuerZone.exo(`${name} brand`, BrandI, { isMyIssuer(allegedIssuer) { @@ -299,7 +298,6 @@ export const preparePaymentLedger = ( }; /** @type {() => Purse} */ - // @ts-expect-error type parameter confusion const makeEmptyPurse = preparePurseKind( issuerZone, name, @@ -315,11 +313,7 @@ export const preparePaymentLedger = ( ); /** @type {Issuer} */ - // Should be - // at-ts-expect-error cast due to callWhen discrepancy - // but ran into the usual disagreement between local lint and CI - - // @ts-expect-error + // @ts-expect-error XXX callWhen const issuer = issuerZone.exo(`${name} issuer`, IssuerI, { getBrand() { return brand; diff --git a/packages/ERTP/src/types.js b/packages/ERTP/src/types.js index 75958afd4459..7a16f43c8c7c 100644 --- a/packages/ERTP/src/types.js +++ b/packages/ERTP/src/types.js @@ -5,23 +5,45 @@ export {}; /// /** + * @import {Passable, RemotableObject} from '@endo/pass-style') * @import {CopyBag, CopySet, Key} from '@endo/patterns') * @import {LatestTopic, NotifierRecord} from '@agoric/notifier'); */ +/** @typedef {{ brand: Brand<'nat'>; value: bigint }} NatAmount */ +/** + * @template {Key} K + * @typedef {{ brand: Brand<'set'>; value: K[] }} SetAmount + */ +/** + * @template {Key} K + * @typedef {{ brand: Brand<'copySet'>; value: CopySet }} CopySetAmount + */ +/** + * @template {Key} K + * @typedef {{ brand: Brand<'copyBag'>; value: CopyBag }} CopyBagAmount + */ +/** @typedef {{ brand: Brand; value: any }} AnyAmount */ + /** * @template {AssetKind} [K=AssetKind] - * @template {Key} [M=Key] member kind, for Amounts that have member values - * @typedef {object} Amount Amounts are descriptions of digital assets, - * answering the questions "how much" and "of what kind". Amounts are values - * labeled with a brand. AmountMath executes the logic of how amounts are - * changed when digital assets are merged, separated, or otherwise - * manipulated. For example, a deposit of 2 bucks into a purse that already - * has 3 bucks gives a new purse balance of 5 bucks. An empty purse has 0 - * bucks. AmountMath relies heavily on polymorphic MathHelpers, which - * manipulate the unbranded portion. - * @property {Brand} brand - * @property {AssetValueForKind} value + * @template {Key} [M=Key] + * @typedef {K extends 'nat' + * ? NatAmount + * : K extends 'set' + * ? SetAmount + * : K extends 'copySet' + * ? CopySetAmount + * : K extends 'copyBag' + * ? CopyBagAmount + * : AnyAmount} Amount + * Amounts are descriptions of digital assets, answering the questions "how + * much" and "of what kind". Amounts are values labeled with a brand. + * AmountMath executes the logic of how amounts are changed when digital + * assets are merged, separated, or otherwise manipulated. For example, a + * deposit of 2 bucks into a purse that already has 3 bucks gives a new purse + * balance of 5 bucks. An empty purse has 0 bucks. AmountMath relies heavily + * on polymorphic MathHelpers, which manipulate the unbranded portion. */ /** @@ -95,17 +117,10 @@ export {}; * or AssetKind.SET or AssetKind.COPY_SET (non-fungible) */ +// XXX hack around JSDoc union handling /** * @template {AssetKind} [K=AssetKind] - * @typedef {import('@endo/marshal').RemotableObject} Brand The brand identifies - * the kind of issuer, and has a function to get the alleged name for the kind - * of asset described. The alleged name (such as 'BTC' or 'moola') is provided - * by the maker of the issuer and should not be trusted as accurate. - * - * Every amount created by a particular AmountMath will share the same brand, - * but recipients cannot rely on the brand to verify that a purported amount - * represents the issuer they intended, since the same brand can be reused by - * a misbehaving issuer. + * @typedef {object} BrandMethods * @property {(allegedIssuer: ERef) => Promise} isMyIssuer * Should be used with `issuer.getBrand` to ensure an issuer and brand match. * @property {() => string} getAllegedName @@ -114,6 +129,19 @@ export {}; * @property {() => Pattern} getAmountShape */ +/** + * @template {AssetKind} [K=AssetKind] + * @typedef {RemotableObject & BrandMethods} Brand The brand identifies the + * kind of issuer, and has a function to get the alleged name for the kind of + * asset described. The alleged name (such as 'BTC' or 'moola') is provided by + * the maker of the issuer and should not be trusted as accurate. + * + * Every amount created by a particular AmountMath will share the same brand, + * but recipients cannot rely on the brand to verify that a purported amount + * represents the issuer they intended, since the same brand can be reused by + * a misbehaving issuer. + */ + // /////////////////////////// Issuer ////////////////////////////////////////// /** @@ -125,13 +153,14 @@ export {}; */ /** * @template {AssetKind} K + * @template {Key} [M=Key] member kind, for Amounts that have member values * @callback IssuerGetAmountOf Get the amount of digital assets in the payment. * Because the payment is not trusted, we cannot call a method on it directly, * and must use the issuer instead. * * If the payment is a promise, the operation will proceed upon fulfillment. - * @param {ERef} payment - * @returns {Promise>} + * @param {ERef>} payment + * @returns {Promise>} */ /** @@ -155,6 +184,7 @@ export {}; /** * @template {AssetKind} [K=AssetKind] + * @template {Key} [M=Key] member kind, for Amounts that have member values * @typedef {object} Issuer The issuer cannot mint a new amount, but it can * create empty purses and payments. The issuer can also transform payments * (splitting payments, combining payments, burning payments, and claiming @@ -174,7 +204,7 @@ export {}; * to display amounts for this issuer. * @property {() => Purse} makeEmptyPurse Make an empty purse of this brand. * @property {IssuerIsLive} isLive - * @property {IssuerGetAmountOf} getAmountOf + * @property {IssuerGetAmountOf} getAmountOf * @property {IssuerBurn} burn */ @@ -191,12 +221,13 @@ export {}; /** * @template {AssetKind} [K=AssetKind] + * @template {Key} [M=Key] member kind, for Amounts that have member values * @typedef {object} IssuerKit - * @property {Mint} mint - * @property {Purse} mintRecoveryPurse Externally useful only if this issuer - * uses recovery sets. Can be used to get the recovery set associated with - * minted payments that are still live. - * @property {Issuer} issuer + * @property {Mint} mint + * @property {Purse} mintRecoveryPurse Externally useful only if this + * issuer uses recovery sets. Can be used to get the recovery set associated + * with minted payments that are still live. + * @property {Issuer} issuer * @property {Brand} brand * @property {DisplayInfo} displayInfo */ @@ -217,10 +248,11 @@ export {}; /** * @template {AssetKind} [K=AssetKind] + * @template {Key} [M=Key] member kind, for Amounts that have member values * @typedef {object} Mint Holding a Mint carries the right to issue new digital * assets. These assets all have the same kind, which is called a Brand. - * @property {() => Issuer} getIssuer Gets the Issuer for this mint. - * @property {(newAmount: Amount) => Payment} mintPayment Creates a new + * @property {() => Issuer} getIssuer Gets the Issuer for this mint. + * @property {(newAmount: Amount) => Payment} mintPayment Creates a new * Payment containing newly minted amount. */ @@ -271,21 +303,27 @@ export {}; /** * @template {AssetKind} [K=AssetKind] - * @typedef {object} Purse Purses hold amount of digital assets of the same - * brand, but unlike Payments, they are not meant to be sent to others. To - * transfer digital assets, a Payment should be withdrawn from a Purse. The - * amount of digital assets in a purse can change through the action of - * deposit() and withdraw(). - * - * The primary use for Purses and Payments is for currency-like and goods-like - * digital assets, but they can also be used to represent other kinds of - * rights, such as the right to participate in a particular contract. + * @template {Key} [M=Key] member kind, for Amounts that have member values + * @typedef {RemotableObject & PurseMethods} Purse Purses hold amount of digital + * assets of the same brand, but unlike Payments, they are not meant to be + * sent to others. To transfer digital assets, a Payment should be withdrawn + * from a Purse. The amount of digital assets in a purse can change through + * the action of deposit() and withdraw(). + */ + +/** + * @template {AssetKind} [K=AssetKind] + * @template {Key} [M=Key] member kind, for Amounts that have member values + * @typedef {object} PurseMethods The primary use for Purses and Payments is for + * currency-like and goods-like digital assets, but they can also be used to + * represent other kinds of rights, such as the right to participate in a + * particular contract. * @property {() => Brand} getAllegedBrand Get the alleged Brand for this * Purse - * @property {() => Amount} getCurrentAmount Get the amount contained in this - * purse. - * @property {() => LatestTopic>} getCurrentAmountNotifier Get a lossy - * notifier for changes to this purse's balance. + * @property {() => Amount} getCurrentAmount Get the amount contained in + * this purse. + * @property {() => LatestTopic>} getCurrentAmountNotifier Get a + * lossy notifier for changes to this purse's balance. * @property {PurseDeposit} deposit Deposit all the contents of payment into * this purse, returning the amount. If the optional argument `optAmount` does * not equal the amount of digital assets in the payment, throw an error. @@ -293,9 +331,9 @@ export {}; * If payment is a promise, throw an error. * @property {() => DepositFacet} getDepositFacet Return an object whose * `receive` method deposits to the current Purse. - * @property {(amount: Amount) => Payment} withdraw Withdraw amount from - * this purse into a new Payment. - * @property {() => CopySet>} getRecoverySet The set of payments + * @property {(amount: Amount) => Payment} withdraw Withdraw amount + * from this purse into a new Payment. + * @property {() => CopySet>} getRecoverySet The set of payments * withdrawn from this purse that are still live. These are the payments that * can still be recovered in emergencies by, for example, depositing into this * purse. Such a deposit action is like canceling an outstanding check because @@ -305,22 +343,23 @@ export {}; * fails. * * Returns an empty set if this issuer does not support recovery sets. - * @property {() => Amount} recoverAll For use in emergencies, such as coming - * back from a traumatic crash and upgrade. This deposits all the payments in - * this purse's recovery set into the purse itself, returning the total amount - * of assets recovered. + * @property {() => Amount} recoverAll For use in emergencies, such as + * coming back from a traumatic crash and upgrade. This deposits all the + * payments in this purse's recovery set into the purse itself, returning the + * total amount of assets recovered. * * Returns an empty amount if this issuer does not support recovery sets. */ /** * @template {AssetKind} [K=AssetKind] - * @typedef {import('@endo/marshal').RemotableObject} Payment Payments hold - * amount of digital assets of the same brand in transit. Payments can be - * deposited in purses, split into multiple payments, combined, and claimed - * (getting an exclusive payment). Payments are linear, meaning that either a - * payment has the same amount of digital assets it started with, or it is - * used up entirely. It is impossible to partially use a payment. + * @template {Key} [M=Key] member kind, for Amounts that have member values + * @typedef {RemotableObject & PaymentMethods} Payment Payments hold amount + * of digital assets of the same brand in transit. Payments can be deposited + * in purses, split into multiple payments, combined, and claimed (getting an + * exclusive payment). Payments are linear, meaning that either a payment has + * the same amount of digital assets it started with, or it is used up + * entirely. It is impossible to partially use a payment. * * Payments are often received from other actors and therefore should not be * trusted themselves. To get the amount of digital assets in a payment, use @@ -329,6 +368,11 @@ export {}; * Payments can be converted to Purses by getting a trusted issuer and calling * `issuer.makeEmptyPurse()` to create a purse, then * `purse.deposit(payment)`. + */ + +/** + * @template {AssetKind} [K=AssetKind] + * @typedef {object} PaymentMethods * @property {() => Brand} getAllegedBrand Get the allegedBrand, indicating * the type of digital asset this payment purports to be, and which issuer to * use. Because payments are not trusted, any method calls on payments should diff --git a/packages/ERTP/test/swingsetTests/basicFunctionality/bootstrap.js b/packages/ERTP/test/swingsetTests/basicFunctionality/bootstrap.js index 1e70311929dc..7fc825aff33a 100644 --- a/packages/ERTP/test/swingsetTests/basicFunctionality/bootstrap.js +++ b/packages/ERTP/test/swingsetTests/basicFunctionality/bootstrap.js @@ -9,7 +9,8 @@ export function buildRootObject(vatPowers, vatParameters) { function testBasicFunctionality(aliceMaker) { vatPowers.testLog('start test basic functionality'); const { mint: moolaMint, issuer, brand } = makeIssuerKit('moola'); - const moolaPayment = moolaMint.mintPayment(AmountMath.make(brand, 1000n)); + const amt = AmountMath.make(brand, 1000n); + const moolaPayment = moolaMint.mintPayment(amt); const aliceP = E(aliceMaker).make(issuer, brand, moolaPayment); return E(aliceP).testBasicFunctionality(); diff --git a/packages/ERTP/test/types.test-d.ts b/packages/ERTP/test/types.test-d.ts index 35d024da98e6..cac360611e6e 100644 --- a/packages/ERTP/test/types.test-d.ts +++ b/packages/ERTP/test/types.test-d.ts @@ -18,7 +18,7 @@ import type { expectType(AmountMath.makeEmpty(brand, AssetKind.SET)); expectType>(AmountMath.make(brand, 1n)); - // @ts-expect-error invalid value for brand + // @ts-expect-error invalid value for amount AmountMath.make(brand, {}); } @@ -26,10 +26,10 @@ import type { const brand: Brand<'set'> = Far('setbrand'); expectType>(AmountMath.makeEmpty(brand, 'set')); expectType>(AmountMath.make(brand, [])); - // @ts-expect-error TODO - expectType(AmountMath.make(brand, AssetKind.NAT)); - // @ts-expect-error invalid value for brand + // @ts-expect-error invalid value for amount + AmountMath.make(brand, AssetKind.NAT); + // @ts-expect-error invalid value for amount AmountMath.make(brand, {}); } diff --git a/packages/ERTP/test/unitTests/mathHelpers/mockBrand.js b/packages/ERTP/test/unitTests/mathHelpers/mockBrand.js index 14f21b5c7ed3..a4ad9feeeebd 100644 --- a/packages/ERTP/test/unitTests/mathHelpers/mockBrand.js +++ b/packages/ERTP/test/unitTests/mathHelpers/mockBrand.js @@ -1,15 +1,52 @@ import { Far } from '@endo/marshal'; import { AssetKind } from '../../../src/index.js'; -/** @import {Brand} from '../../../src/types.js'; */ +/** @import {Brand} from '@agoric/ertp/src/types.js'; */ -/** @type {Brand} */ -export const mockBrand = Far('brand', { +/** @type {Brand<'nat'>} */ +// @ts-expect-error FIXME losing PASS_STYLE +export const mockNatBrand = Far('brand', { // eslint-disable-next-line no-unused-vars isMyIssuer: async allegedIssuer => false, getAllegedName: () => 'mock', - getAmountShape: () => {}, + getAmountShape: () => ({}), getDisplayInfo: () => ({ assetKind: AssetKind.NAT, }), }); + +/** @type {Brand<'set'>} */ +// @ts-expect-error FIXME losing PASS_STYLE +export const mockSetBrand = Far('brand', { + // eslint-disable-next-line no-unused-vars + isMyIssuer: async allegedIssuer => false, + getAllegedName: () => 'mock', + getAmountShape: () => ({}), + getDisplayInfo: () => ({ + assetKind: AssetKind.SET, + }), +}); + +/** @type {Brand<'copySet'>} */ +// @ts-expect-error FIXME losing PASS_STYLE +export const mockCopySetBrand = Far('brand', { + // eslint-disable-next-line no-unused-vars + isMyIssuer: async allegedIssuer => false, + getAllegedName: () => 'mock', + getAmountShape: () => ({}), + getDisplayInfo: () => ({ + assetKind: AssetKind.COPY_SET, + }), +}); + +/** @type {Brand<'copyBag'>} */ +// @ts-expect-error FIXME losing PASS_STYLE +export const mockCopyBagBrand = Far('brand', { + // eslint-disable-next-line no-unused-vars + isMyIssuer: async allegedIssuer => false, + getAllegedName: () => 'mock', + getAmountShape: () => ({}), + getDisplayInfo: () => ({ + assetKind: AssetKind.COPY_BAG, + }), +}); diff --git a/packages/ERTP/test/unitTests/mathHelpers/test-copyBagMathHelpers.js b/packages/ERTP/test/unitTests/mathHelpers/test-copyBagMathHelpers.js index b3e7e6df9cfe..1f71539d790e 100644 --- a/packages/ERTP/test/unitTests/mathHelpers/test-copyBagMathHelpers.js +++ b/packages/ERTP/test/unitTests/mathHelpers/test-copyBagMathHelpers.js @@ -6,7 +6,7 @@ import { } from '@agoric/store'; import { AmountMath as m, AssetKind } from '../../../src/index.js'; -import { mockBrand } from './mockBrand.js'; +import { mockCopyBagBrand as mockBrand } from './mockBrand.js'; // The "unit tests" for MathHelpers actually make the calls through // AmountMath so that we can test that any duplication is handled diff --git a/packages/ERTP/test/unitTests/mathHelpers/test-copySetMathHelpers.js b/packages/ERTP/test/unitTests/mathHelpers/test-copySetMathHelpers.js index d100c50938b4..a0171c5fa385 100644 --- a/packages/ERTP/test/unitTests/mathHelpers/test-copySetMathHelpers.js +++ b/packages/ERTP/test/unitTests/mathHelpers/test-copySetMathHelpers.js @@ -2,7 +2,7 @@ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js'; import { getCopySetKeys, makeCopySet } from '@agoric/store'; import { AmountMath as m, AssetKind } from '../../../src/index.js'; -import { mockBrand } from './mockBrand.js'; +import { mockCopySetBrand as mockBrand } from './mockBrand.js'; /** @import {CopySet} from '@endo/patterns' */ @@ -209,6 +209,7 @@ test('copySet with strings add', t => { () => m.add( harden({ brand: mockBrand, value: makeCopySet(['a', 'a']) }), + // @ts-expect-error deliberate invalid arguments for testing harden({ brand: mockBrand, value: makeCopySet(['b']) }), ), { message: /value has duplicate(| key)s: "a"/ }, @@ -218,6 +219,7 @@ test('copySet with strings add', t => { () => m.add( harden({ brand: mockBrand, value: makeCopySet(['a']) }), + // @ts-expect-error deliberate invalid arguments for testing harden({ brand: mockBrand, value: makeCopySet(['b', 'b']) }), ), { message: /value has duplicate(| key)s: "b"/ }, diff --git a/packages/ERTP/test/unitTests/mathHelpers/test-natMathHelpers.js b/packages/ERTP/test/unitTests/mathHelpers/test-natMathHelpers.js index d43164ce4746..9e19389a8b4e 100644 --- a/packages/ERTP/test/unitTests/mathHelpers/test-natMathHelpers.js +++ b/packages/ERTP/test/unitTests/mathHelpers/test-natMathHelpers.js @@ -3,7 +3,7 @@ import { M } from '@agoric/store'; import { Far } from '@endo/marshal'; import { AmountMath as m, AssetKind } from '../../../src/index.js'; -import { mockBrand } from './mockBrand.js'; +import { mockNatBrand as mockBrand } from './mockBrand.js'; // The "unit tests" for MathHelpers actually make the calls through // AmountMath so that we can test that any duplication is handled diff --git a/packages/ERTP/test/unitTests/mathHelpers/test-setMathHelpers.js b/packages/ERTP/test/unitTests/mathHelpers/test-setMathHelpers.js index 716df4ea092f..35c588781502 100644 --- a/packages/ERTP/test/unitTests/mathHelpers/test-setMathHelpers.js +++ b/packages/ERTP/test/unitTests/mathHelpers/test-setMathHelpers.js @@ -3,7 +3,7 @@ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js'; import { Far } from '@endo/marshal'; import { AmountMath as m, AssetKind } from '../../../src/index.js'; -import { mockBrand } from './mockBrand.js'; +import { mockSetBrand as mockBrand } from './mockBrand.js'; // The "unit tests" for MathHelpers actually make the calls through // AmountMath so that we can test that any duplication is handled diff --git a/packages/ERTP/test/unitTests/mathHelpers/test-strSetMathHelpers.js b/packages/ERTP/test/unitTests/mathHelpers/test-strSetMathHelpers.js index 8dd4e886e9a6..0677b9b81bfd 100644 --- a/packages/ERTP/test/unitTests/mathHelpers/test-strSetMathHelpers.js +++ b/packages/ERTP/test/unitTests/mathHelpers/test-strSetMathHelpers.js @@ -1,7 +1,7 @@ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js'; import { AmountMath as m, AssetKind } from '../../../src/index.js'; -import { mockBrand } from './mockBrand.js'; +import { mockSetBrand as mockBrand } from './mockBrand.js'; // The "unit tests" for MathHelpers actually make the calls through // AmountMath so that we can test that any duplication is handled diff --git a/packages/ERTP/test/unitTests/test-amountProperties.js b/packages/ERTP/test/unitTests/test-amountProperties.js index 6bfa2d718785..fabe0ebb3f32 100644 --- a/packages/ERTP/test/unitTests/test-amountProperties.js +++ b/packages/ERTP/test/unitTests/test-amountProperties.js @@ -3,7 +3,7 @@ import { makeCopyBag } from '@agoric/store'; import { fc } from '@fast-check/ava'; import { AmountMath as m, AssetKind } from '../../src/index.js'; -import { mockBrand } from './mathHelpers/mockBrand.js'; +import { mockCopyBagBrand as mockBrand } from './mathHelpers/mockBrand.js'; // Perhaps makeCopyBag should coalesce duplicate labels, but for now, it does // not. diff --git a/packages/ERTP/test/unitTests/test-inputValidation.js b/packages/ERTP/test/unitTests/test-inputValidation.js index a1c14adcd501..1f87699fc6d0 100644 --- a/packages/ERTP/test/unitTests/test-inputValidation.js +++ b/packages/ERTP/test/unitTests/test-inputValidation.js @@ -144,7 +144,7 @@ test('brand.isMyIssuer bad issuer', async t => { message: /In "isMyIssuer" method of \(myTokens brand\): arg 0: .*"not an issuer" - Must be a remotable/, }); - const fakeIssuer = /** @type {Issuer} */ ( + const fakeIssuer = /** @type {Issuer<'nat'>} */ ( /** @type {unknown} */ (Far('myTokens issuer', {})) ); const result = await brand.isMyIssuer(fakeIssuer); diff --git a/packages/ERTP/test/unitTests/test-legacy-payment-helpers.js b/packages/ERTP/test/unitTests/test-legacy-payment-helpers.js index 2776d06f2dd8..43eee8e7e6d3 100644 --- a/packages/ERTP/test/unitTests/test-legacy-payment-helpers.js +++ b/packages/ERTP/test/unitTests/test-legacy-payment-helpers.js @@ -9,6 +9,7 @@ const { isEqual } = AmountMath; test('no lost assets on non-atomic combine failure', async t => { const { issuer, mint, brand } = makeIssuerKit('precious'); const recoveryPurse = issuer.makeEmptyPurse(); + /** @param {bigint} num */ const precious = num => AmountMath.make(brand, num); const payment1 = mint.mintPayment(precious(39n)); const payment2 = payment1; // "accidental" aliasing @@ -26,6 +27,7 @@ test('no lost assets on non-atomic combine failure', async t => { test('no lost assets on non-atomic split failure', async t => { const { issuer, mint, brand } = makeIssuerKit('precious'); const recoveryPurse = issuer.makeEmptyPurse(); + /** @param {bigint} num */ const precious = num => AmountMath.make(brand, num); const srcPayment = mint.mintPayment(precious(78n)); await t.throwsAsync(() => split(recoveryPurse, srcPayment, precious(100n)), { diff --git a/packages/ERTP/test/unitTests/test-recovery.js b/packages/ERTP/test/unitTests/test-recovery.js index 3ed6ef326a76..92713b8ef83d 100644 --- a/packages/ERTP/test/unitTests/test-recovery.js +++ b/packages/ERTP/test/unitTests/test-recovery.js @@ -8,6 +8,7 @@ const emptySet = makeCopySet([]); test('payment recovery from purse recovery set', async t => { const { issuer, mint, brand } = makeIssuerKit('precious'); + /** @param {bigint} num */ const precious = num => AmountMath.make(brand, num); const payment1 = mint.mintPayment(precious(37n)); const payment2 = mint.mintPayment(precious(41n)); @@ -42,6 +43,7 @@ test('payment recovery from purse recovery set', async t => { test('payment recovery from mint recovery set', async t => { const { issuer, mint, mintRecoveryPurse, brand } = makeIssuerKit('precious'); + /** @param {bigint} num */ const precious = num => AmountMath.make(brand, num); const mindyPurse = issuer.makeEmptyPurse(); const bobPurse = issuer.makeEmptyPurse(); diff --git a/packages/inter-protocol/src/contractSupport.js b/packages/inter-protocol/src/contractSupport.js index 1aec13135a99..e007d1d47e20 100644 --- a/packages/inter-protocol/src/contractSupport.js +++ b/packages/inter-protocol/src/contractSupport.js @@ -21,11 +21,11 @@ export const ratioPattern = harden({ * proposal. We use two Amounts because an Amount cannot represent a negative * number (so we use a "loss" that will be subtracted). * - * @template {AssetKind} K - * @param {Amount} base - * @param {Amount} gain - * @param {Amount} loss - * @returns {Amount} + * @template {Amount} A + * @param {A} base + * @param {A} gain + * @param {A} loss + * @returns {A} */ export const addSubtract = (base, gain, loss) => AmountMath.subtract(AmountMath.add(base, gain), loss); diff --git a/packages/inter-protocol/src/vaultFactory/vault.js b/packages/inter-protocol/src/vaultFactory/vault.js index 17ee452ccc70..4a36efccfc3d 100644 --- a/packages/inter-protocol/src/vaultFactory/vault.js +++ b/packages/inter-protocol/src/vaultFactory/vault.js @@ -20,7 +20,10 @@ const { quote: q, Fail } = assert; const trace = makeTracer('Vault', true); -/** @import {NormalizedDebt} from './storeUtils.js' */ +/** + * @import {Brand} from '@agoric/ertp/src/types.js'; + * @import {NormalizedDebt} from './storeUtils.js'; + */ /** * @file This has most of the logic for a Vault, to borrow Minted against @@ -301,13 +304,20 @@ export const prepareVault = (baggage, makeRecorderKit, zcf) => { ); }, - /** @param {ZCFSeat} seat */ + /** + * @param {ZCFSeat} seat + * @returns {Amount<'nat'>} + */ getCollateralAllocated(seat) { return seat.getAmountAllocated( 'Collateral', this.facets.helper.collateralBrand(), ); }, + /** + * @param {ZCFSeat} seat + * @returns {Amount<'nat'>} + */ getMintedAllocated(seat) { return seat.getAmountAllocated( 'Minted', diff --git a/packages/zoe/src/cleanProposal.js b/packages/zoe/src/cleanProposal.js index 94b5ffc4052b..8481d9a8af62 100644 --- a/packages/zoe/src/cleanProposal.js +++ b/packages/zoe/src/cleanProposal.js @@ -75,6 +75,12 @@ export const coerceAmountPatternKeywordRecord = ( }); }; +/** + * + * @param {unknown} allegedAmountKeywordRecord + * @param {*} getAssetKindByBrand + * @returns {AmountKeywordRecord} + */ export const coerceAmountKeywordRecord = ( allegedAmountKeywordRecord, getAssetKindByBrand, @@ -84,6 +90,7 @@ export const coerceAmountKeywordRecord = ( getAssetKindByBrand, ); assertKey(result); + // @ts-expect-error checked cast return result; }; diff --git a/packages/zoe/src/contractFacet/types-ambient.d.ts b/packages/zoe/src/contractFacet/types-ambient.d.ts index 4382c0432842..e1a64e0b4a01 100644 --- a/packages/zoe/src/contractFacet/types-ambient.d.ts +++ b/packages/zoe/src/contractFacet/types-ambient.d.ts @@ -40,10 +40,10 @@ type ZCF> = { * @returns the AmountMath and brand synchronously accessible after * saving */ - saveIssuer: ( - issuerP: ERef, + saveIssuer: ( + issuerP: ERef, keyword: Keyword, - ) => Promise>; + ) => Promise ? IssuerRecord : never>; /** * Make a credible Zoe invitation for a particular smart contract diff --git a/packages/zoe/src/contractFacet/zcfSeat.js b/packages/zoe/src/contractFacet/zcfSeat.js index 9658f66512f5..452477c943d7 100644 --- a/packages/zoe/src/contractFacet/zcfSeat.js +++ b/packages/zoe/src/contractFacet/zcfSeat.js @@ -206,7 +206,7 @@ export const createSeatManager = ( assertActive(self); const currentAllocation = getCurrentAllocation(self); if (currentAllocation[keyword] !== undefined) { - // @ts-expect-error cast + // @ts-expect-error never checks brand return currentAllocation[keyword]; } if (!brand) { diff --git a/packages/zoe/src/contractSupport/priceAuthorityTransform.js b/packages/zoe/src/contractSupport/priceAuthorityTransform.js index 2744c5998763..69fe75368a8d 100644 --- a/packages/zoe/src/contractSupport/priceAuthorityTransform.js +++ b/packages/zoe/src/contractSupport/priceAuthorityTransform.js @@ -13,9 +13,9 @@ import { makeNotifier } from '@agoric/notifier'; * @param {Brand<'set'>} quoteBrand * @param {Amount<'nat'>} amountIn * @param {Amount<'nat'>} amountOut - * @param {ERef} timer + * @param {import('@agoric/time').TimerService} timer * @param {import('@agoric/time').Timestamp} timestamp - * @param {ERef>} quoteMint + * @param {ERef>} quoteMint * @returns {Promise} */ export const mintQuote = async ( @@ -39,7 +39,7 @@ export const mintQuote = async ( /** * @param {object} opts - * @param {ERef>} opts.quoteMint + * @param {ERef>} opts.quoteMint * @param {ERef} opts.sourcePriceAuthority * @param {Brand<'nat'>} opts.sourceBrandIn * @param {Brand<'nat'>} opts.sourceBrandOut diff --git a/packages/zoe/src/contractSupport/ratio.js b/packages/zoe/src/contractSupport/ratio.js index c4659aa968b2..7635ce7d7b8b 100644 --- a/packages/zoe/src/contractSupport/ratio.js +++ b/packages/zoe/src/contractSupport/ratio.js @@ -70,7 +70,6 @@ export const makeRatio = ( denominator > 0n || Fail`No infinite ratios! Denominator was 0 ${q(denominatorBrand)}`; - // @ts-expect-error cast to return type because make() ensures return harden({ numerator: AmountMath.make(numeratorBrand, numerator), denominator: AmountMath.make(denominatorBrand, denominator), @@ -98,6 +97,7 @@ export const makeRatioFromAmounts = (numeratorAmount, denominatorAmount) => { * @param {Amount<'nat'>} amount * @param {Ratio} ratio * @param {*} divideOp + * @returns {Amount<'nat'>} */ const multiplyHelper = (amount, ratio, divideOp) => { AmountMath.coerce(amount.brand, amount); @@ -107,12 +107,14 @@ const multiplyHelper = (amount, ratio, divideOp) => { ratio.denominator.brand, )}`; - return AmountMath.make( - ratio.numerator.brand, - divideOp( - multiply(amount.value, ratio.numerator.value), - ratio.denominator.value, - ), + return /** @type {Amount<'nat'>} */ ( + AmountMath.make( + ratio.numerator.brand, + divideOp( + multiply(amount.value, ratio.numerator.value), + ratio.denominator.value, + ), + ) ); }; @@ -135,6 +137,7 @@ export const multiplyBy = (amount, ratio) => { * @param {Amount<'nat'>} amount * @param {Ratio} ratio * @param {*} divideOp + * @returns {Amount<'nat'>} */ const divideHelper = (amount, ratio, divideOp) => { AmountMath.coerce(amount.brand, amount); @@ -144,12 +147,14 @@ const divideHelper = (amount, ratio, divideOp) => { ratio.numerator.brand, )}`; - return AmountMath.make( - ratio.denominator.brand, - divideOp( - multiply(amount.value, ratio.denominator.value), - ratio.numerator.value, - ), + return /** @type {Amount<'nat'>} */ ( + AmountMath.make( + ratio.denominator.brand, + divideOp( + multiply(amount.value, ratio.denominator.value), + ratio.numerator.value, + ), + ) ); }; diff --git a/packages/zoe/src/contracts/autoswap.js b/packages/zoe/src/contracts/autoswap.js index 1b9f58f40a34..40939bbf65d3 100644 --- a/packages/zoe/src/contracts/autoswap.js +++ b/packages/zoe/src/contracts/autoswap.js @@ -274,8 +274,10 @@ const start = async zcf => { }); // TODO (hibbert) should we burn tokens? - const userAllocation = removeLiqSeat.getCurrentAllocation(); - /** @type {Amount<'nat'>} */ + + const userAllocation = /** @type {{Liquidity: Amount<'nat'>}} */ ( + removeLiqSeat.getCurrentAllocation() + ); const liquidityIn = userAllocation.Liquidity; assert(!AmountMath.isEmpty(liquidityIn), 'Pool is empty'); const liquidityValueIn = liquidityIn.value; diff --git a/packages/zoe/src/contracts/callSpread/pricedCallSpread.js b/packages/zoe/src/contracts/callSpread/pricedCallSpread.js index 67cc94c23a64..451170bb31de 100644 --- a/packages/zoe/src/contracts/callSpread/pricedCallSpread.js +++ b/packages/zoe/src/contracts/callSpread/pricedCallSpread.js @@ -104,6 +104,7 @@ const start = zcf => { const invitationIssuer = zcf.getInvitationIssuer(); const payment = harden({ Option: option }); const Option = await E(invitationIssuer).getAmountOf(option); + /** @type {any} */ const spreadAmount = harden({ Option, }); diff --git a/packages/zoe/src/contracts/loan/borrow.js b/packages/zoe/src/contracts/loan/borrow.js index 5a07165fd013..af720c00e9de 100644 --- a/packages/zoe/src/contracts/loan/borrow.js +++ b/packages/zoe/src/contracts/loan/borrow.js @@ -39,7 +39,9 @@ export const makeBorrowInvitation = (zcf, config) => { const collateralGiven = borrowerSeat.getAmountAllocated( 'Collateral', - borrowerSeat.getProposal().give.Collateral.brand, + /** @type {Brand<'nat'>} */ ( + borrowerSeat.getProposal().give.Collateral.brand + ), ); const loanWanted = borrowerSeat.getProposal().want.Loan; const loanBrand = zcf.getTerms().brands.Loan; diff --git a/packages/zoe/src/contracts/priceAggregator.js b/packages/zoe/src/contracts/priceAggregator.js index 97bcff66f04f..a1be89dc22c1 100644 --- a/packages/zoe/src/contracts/priceAggregator.js +++ b/packages/zoe/src/contracts/priceAggregator.js @@ -60,7 +60,7 @@ const priceDescriptionFromQuote = quote => quote.quoteAmount.value[0]; * }>} zcf * @param {{ * marshaller: Marshaller, - * quoteMint?: ERef>, + * quoteMint?: ERef>, * storageNode: ERef, * }} privateArgs */ @@ -78,12 +78,11 @@ const start = async (zcf, privateArgs) => { const { marshaller, storageNode } = privateArgs; assertAllDefined({ marshaller, storageNode }); + /** @type {ERef>} */ const quoteMint = privateArgs.quoteMint || // makeIssuerKit fails upgrade, this contract is for demo only makeIssuerKit('quote', AssetKind.SET).mint; - /** @type {IssuerRecord<'set'>} */ - // xxx saveIssuer not generic const quoteIssuerRecord = await zcf.saveIssuer( E(quoteMint).getIssuer(), 'Quote', @@ -101,8 +100,6 @@ const start = async (zcf, privateArgs) => { * @param {PriceQuoteValue} quote */ const authenticateQuote = async quote => { - /** @type {Amount<'set'>} */ - // xxx type should be inferred from brand and value const quoteAmount = AmountMath.make(quoteKit.brand, harden(quote)); const quotePayment = await E(quoteKit.mint).mintPayment(quoteAmount); return harden({ quoteAmount, quotePayment }); diff --git a/packages/zoe/src/internal-types.js b/packages/zoe/src/internal-types.js index 7de031ab8082..8487a07b34da 100644 --- a/packages/zoe/src/internal-types.js +++ b/packages/zoe/src/internal-types.js @@ -122,9 +122,9 @@ /** * @typedef {object} ZoeInstanceAdmin * @property {ZoeInstanceAdminMakeInvitation} makeInvitation - * @property {(issuerP: ERef, + * @property {(issuerP: ERef, * keyword: Keyword - * ) => Promise} saveIssuer + * ) => Promise ? IssuerRecord : never>} saveIssuer * @property {MakeZoeMint} makeZoeMint * @property {RegisterFeeMint} registerFeeMint * @property {MakeNoEscrowSeat} makeNoEscrowSeat diff --git a/packages/zoe/src/types-ambient.js b/packages/zoe/src/types-ambient.js index 0e4b4207ad4e..653de401743d 100644 --- a/packages/zoe/src/types-ambient.js +++ b/packages/zoe/src/types-ambient.js @@ -35,9 +35,10 @@ /** * @template {AssetKind} [K=AssetKind] + * @template {import("@endo/patterns").Key} [M=import("@endo/patterns").Key] member kind, for Amounts that have member values * @typedef {object} IssuerRecord * @property {Brand} brand - * @property {Issuer} issuer + * @property {Issuer} issuer * @property {K} assetKind * @property {DisplayInfo} [displayInfo] * diff --git a/packages/zoe/src/zoeService/escrowStorage.js b/packages/zoe/src/zoeService/escrowStorage.js index 357ca9b880f6..6c20944d02b7 100644 --- a/packages/zoe/src/zoeService/escrowStorage.js +++ b/packages/zoe/src/zoeService/escrowStorage.js @@ -16,7 +16,7 @@ import { cleanKeywords } from '../cleanProposal.js'; * @param {import('@agoric/vat-data').Baggage} baggage */ export const provideEscrowStorage = baggage => { - /** @type {WeakMapStore>} */ + /** @type {WeakMapStore} */ const brandToPurse = provideDurableWeakMapStore(baggage, 'brandToPurse'); /** @type {CreatePurse} */ diff --git a/packages/zoe/src/zoeService/types-ambient.js b/packages/zoe/src/zoeService/types-ambient.js index 17d9f7a31e17..190d3f98cc1a 100644 --- a/packages/zoe/src/zoeService/types-ambient.js +++ b/packages/zoe/src/zoeService/types-ambient.js @@ -49,7 +49,7 @@ /** * @callback GetInvitationIssuer - * @returns {Promise>} + * @returns {Promise>} */ /** diff --git a/packages/zoe/test/unitTests/contracts/test-priceAggregator.js b/packages/zoe/test/unitTests/contracts/test-priceAggregator.js index d1ddc92455b7..1dd656d82308 100644 --- a/packages/zoe/test/unitTests/contracts/test-priceAggregator.js +++ b/packages/zoe/test/unitTests/contracts/test-priceAggregator.js @@ -53,7 +53,7 @@ import { * }>} zcf * @param {{ * marshaller: Marshaller, - * quoteMint?: ERef>, + * quoteMint?: ERef>, * storageNode: StorageNode, * }} privateArgs */ @@ -81,7 +81,7 @@ const makePublicationChecker = async (t, aggregatorPublicFacet, timerBrand) => { )[Symbol.asyncIterator](); return { - /** @param {{timestamp: bigint, amountOut: any}} spec */ + /** @param {{timestamp: import('@agoric/time').Timestamp, amountOut: any}} spec */ async nextMatches({ timestamp, amountOut }) { const expectedTimestamp = TimeMath.coerceTimestampRecord( timestamp, @@ -202,8 +202,10 @@ test('median aggregator', async t => { } = await E(zoe).getTerms(aggregator.instance); const timerBrand = oracleTimer.getTimerBrand(); const toTS = ts => TimeMath.coerceTimestampRecord(ts, timerBrand); - /** @type {Issuer<'set'>} */ - const quoteIssuer = rawQuoteIssuer; + + const quoteIssuer = /** @type {Issuer<'set', PriceDescription>} */ ( + rawQuoteIssuer + ); const price1000 = await makeFakePriceOracle(1000n); const price1300 = await makeFakePriceOracle(1300n); @@ -363,8 +365,10 @@ test('median aggregator - push only', async t => { } = await E(zoe).getTerms(aggregator.instance); const toTS = ts => TimeMath.coerceTimestampRecord(ts, oracleTimer.getTimerBrand()); - /** @type {Issuer<'set'>} */ - const quoteIssuer = rawQuoteIssuer; + + const quoteIssuer = /** @type {Issuer<'set', PriceDescription>} */ ( + rawQuoteIssuer + ); const pricePush = await makeFakePriceOracle(); const pa = E(aggregator.publicFacet).getPriceAuthority(); @@ -599,8 +603,9 @@ test('quoteAtTime', async t => { } = await E(zoe).getTerms(aggregator.instance); const toTS = ts => TimeMath.coerceTimestampRecord(ts, oracleTimer.getTimerBrand()); - /** @type {Issuer<'set'>} */ - const quoteIssuer = rawQuoteIssuer; + const quoteIssuer = /** @type {Issuer<'set', PriceDescription>} */ ( + rawQuoteIssuer + ); const price1000 = await makeFakePriceOracle(1000n); const price1300 = await makeFakePriceOracle(1300n); @@ -713,8 +718,9 @@ test('quoteWhen', async t => { } = await E(zoe).getTerms(aggregator.instance); const toTS = ts => TimeMath.coerceTimestampRecord(ts, oracleTimer.getTimerBrand()); - /** @type {Issuer<'set'>} */ - const quoteIssuer = rawQuoteIssuer; + const quoteIssuer = /** @type {Issuer<'set', PriceDescription>} */ ( + rawQuoteIssuer + ); const price1000 = await makeFakePriceOracle(1000n); const price1300 = await makeFakePriceOracle(1300n); @@ -823,8 +829,9 @@ test('mutableQuoteWhen no replacement', async t => { brandOut, } = await E(zoe).getTerms(aggregator.instance); const timerBrand = await E(oracleTimer).getTimerBrand(); - /** @type {Issuer<'set'>} */ - const quoteIssuer = rawQuoteIssuer; + const quoteIssuer = /** @type {Issuer<'set', PriceDescription>} */ ( + rawQuoteIssuer + ); const price1000 = await makeFakePriceOracle(1000n); const price1300 = await makeFakePriceOracle(1300n); @@ -941,8 +948,9 @@ test('mutableQuoteWhen with update', async t => { } = await E(zoe).getTerms(aggregator.instance); const toTS = ts => TimeMath.coerceTimestampRecord(ts, oracleTimer.getTimerBrand()); - /** @type {Issuer<'set'>} */ - const quoteIssuer = rawQuoteIssuer; + const quoteIssuer = /** @type {Issuer<'set', PriceDescription>} */ ( + rawQuoteIssuer + ); const price1200 = await makeFakePriceOracle(1200n); const pa = E(aggregator.publicFacet).getPriceAuthority(); diff --git a/packages/zoe/test/unitTests/contracts/test-sellTickets.js b/packages/zoe/test/unitTests/contracts/test-sellTickets.js index 32fe86deb9b5..8ddb9d84894a 100644 --- a/packages/zoe/test/unitTests/contracts/test-sellTickets.js +++ b/packages/zoe/test/unitTests/contracts/test-sellTickets.js @@ -146,6 +146,7 @@ test(`mint and sell opera tickets`, async t => { brand: moolaBrand, } = makeIssuerKit('moola'); + /** @param {bigint} value */ const moola = value => AmountMath.make(moolaBrand, value); const { admin: fakeVatAdmin, vatAdminState } = makeFakeVatAdmin(); @@ -442,7 +443,7 @@ test(`mint and sell opera tickets`, async t => { const bobPurse = await E(moolaIssuer).makeEmptyPurse(); await E(bobPurse).deposit(moola100Payment); - /** @type {Amount} */ + /** @type {Amount<'set', {number: number}>} */ const availableTickets = await E( ticketSalesPublicFacet, ).getAvailableItems(); diff --git a/packages/zoe/test/unitTests/setupBasicMints.js b/packages/zoe/test/unitTests/setupBasicMints.js index d00d3fe42e78..0ca43e22b0ea 100644 --- a/packages/zoe/test/unitTests/setupBasicMints.js +++ b/packages/zoe/test/unitTests/setupBasicMints.js @@ -22,7 +22,7 @@ export const setup = () => { const { admin: fakeVatAdmin, vatAdminState } = makeFakeVatAdmin(); const zoe = makeZoeForTest(fakeVatAdmin); - /** @type {(brand: Brand) => (value: any) => Amount} */ + /** @type {(brand: Brand<'nat'>) => (value: bigint) => Amount<'nat'>} */ const makeSimpleMake = brand => value => AmountMath.make(brand, value); const result = { diff --git a/packages/zoe/tools/types.js b/packages/zoe/tools/types.js index 6fc8a2f7732b..d4a5b4b822fc 100644 --- a/packages/zoe/tools/types.js +++ b/packages/zoe/tools/types.js @@ -5,7 +5,7 @@ export {}; * @typedef {object} PriceQuote * @property {Amount<'set', PriceDescription>} quoteAmount * Amount whose value is a PriceQuoteValue - * @property {ERef>} quotePayment + * @property {ERef>} quotePayment * The `quoteAmount` wrapped as a payment */ @@ -22,9 +22,9 @@ export {}; * The amount supplied to a trade * @property {Amount<'nat'>} amountOut * The quoted result of trading `amountIn` - * @property {import('@endo/patterns').RemotableObject & import('@agoric/time').TimerService} timer + * @property {import('@endo/pass-style').RemotableObject & import('@agoric/time').TimerService} timer * The service that gave the `timestamp` - * @property {import('@agoric/time').TimestampRecord} timestamp + * @property {import('@agoric/time').Timestamp} timestamp * A timestamp according to `timer` for the quote * @property {any} [conditions] * Additional conditions for the quote From 9d200e7a0b80d7ccd5a191f2b6cb8b15fe27c4b1 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 24 Apr 2024 13:28:06 -0700 Subject: [PATCH 17/57] chore(types): Issuer remotable --- packages/ERTP/src/paymentLedger.js | 6 +-- packages/ERTP/src/types.js | 43 ++++++++++++--------- packages/ERTP/test/types.test-d.ts | 8 +++- packages/deploy-script-support/src/offer.js | 2 +- packages/smart-wallet/src/invitations.js | 3 +- packages/store/src/stores/scalarMapStore.js | 2 +- packages/wallet/api/src/internal-types.js | 7 +++- packages/zoe/src/cleanProposal.js | 1 + packages/zoe/src/zoeService/utils.d.ts | 6 +-- 9 files changed, 46 insertions(+), 32 deletions(-) diff --git a/packages/ERTP/src/paymentLedger.js b/packages/ERTP/src/paymentLedger.js index 02c3c6e851c1..525ad38ab9e2 100644 --- a/packages/ERTP/src/paymentLedger.js +++ b/packages/ERTP/src/paymentLedger.js @@ -93,10 +93,7 @@ export const preparePaymentLedger = ( optShutdownWithFailure = undefined, ) => { /** @type {Brand} */ - // Should be - // at-ts-expect-error XXX callWhen - // but ran into the usual disagreement between local lint and CI - // @ts-expect-error + // @ts-expect-error XXX callWhen const brand = issuerZone.exo(`${name} brand`, BrandI, { isMyIssuer(allegedIssuer) { // BrandI delays calling this method until `allegedIssuer` is a Remotable @@ -298,6 +295,7 @@ export const preparePaymentLedger = ( }; /** @type {() => Purse} */ + // @ts-expect-error XXX amount kinds const makeEmptyPurse = preparePurseKind( issuerZone, name, diff --git a/packages/ERTP/src/types.js b/packages/ERTP/src/types.js index 7a16f43c8c7c..ac6dd883c641 100644 --- a/packages/ERTP/src/types.js +++ b/packages/ERTP/src/types.js @@ -119,9 +119,9 @@ export {}; // XXX hack around JSDoc union handling /** - * @template {AssetKind} [K=AssetKind] + * @template {AssetKind} K * @typedef {object} BrandMethods - * @property {(allegedIssuer: ERef) => Promise} isMyIssuer + * @property {(allegedIssuer: ERef>) => Promise} isMyIssuer * Should be used with `issuer.getBrand` to ensure an issuer and brand match. * @property {() => string} getAllegedName * @property {() => DisplayInfo} getDisplayInfo Give information to UI on how @@ -183,14 +183,9 @@ export {}; */ /** - * @template {AssetKind} [K=AssetKind] - * @template {Key} [M=Key] member kind, for Amounts that have member values - * @typedef {object} Issuer The issuer cannot mint a new amount, but it can - * create empty purses and payments. The issuer can also transform payments - * (splitting payments, combining payments, burning payments, and claiming - * payments exclusively). The issuer should be gotten from a trusted source - * and then relied upon as the decider of whether an untrusted payment is - * valid. + * @template {AssetKind} K + * @template {Key} M + * @typedef {object} IssuerMethods Work around JSDoc union handling * @property {() => Brand} getBrand Get the Brand for this Issuer. The Brand * indicates the type of digital asset and is shared by the mint, the issuer, * and any purses and payments of this particular kind. The brand is not @@ -198,16 +193,28 @@ export {}; * alone. Fake digital assets and amount can use another issuer's brand. * @property {() => string} getAllegedName Get the allegedName for this * mint/issuer - * @property {() => AssetKind} getAssetKind Get the kind of MathHelpers used by - * this Issuer. + * @property {() => K} getAssetKind Get the kind of MathHelpers used by this + * Issuer. * @property {() => DisplayInfo} getDisplayInfo Give information to UI on how * to display amounts for this issuer. - * @property {() => Purse} makeEmptyPurse Make an empty purse of this brand. + * @property {() => Purse} makeEmptyPurse Make an empty purse of this + * brand. * @property {IssuerIsLive} isLive * @property {IssuerGetAmountOf} getAmountOf * @property {IssuerBurn} burn */ +/** + * @template {AssetKind} [K=AssetKind] + * @template {Key} [M=Key] member kind, for Amounts that have member values + * @typedef {RemotableObject & IssuerMethods} Issuer The issuer cannot + * mint a new amount, but it can create empty purses and payments. The issuer + * can also transform payments (splitting payments, combining payments, + * burning payments, and claiming payments exclusively). The issuer should be + * gotten from a trusted source and then relied upon as the decider of whether + * an untrusted payment is valid. + */ + /** * @template {AssetKind} [K=AssetKind] * @typedef {object} PaymentLedger @@ -304,11 +311,11 @@ export {}; /** * @template {AssetKind} [K=AssetKind] * @template {Key} [M=Key] member kind, for Amounts that have member values - * @typedef {RemotableObject & PurseMethods} Purse Purses hold amount of digital - * assets of the same brand, but unlike Payments, they are not meant to be - * sent to others. To transfer digital assets, a Payment should be withdrawn - * from a Purse. The amount of digital assets in a purse can change through - * the action of deposit() and withdraw(). + * @typedef {RemotableObject & PurseMethods} Purse Purses hold amount of + * digital assets of the same brand, but unlike Payments, they are not meant + * to be sent to others. To transfer digital assets, a Payment should be + * withdrawn from a Purse. The amount of digital assets in a purse can change + * through the action of deposit() and withdraw(). */ /** diff --git a/packages/ERTP/test/types.test-d.ts b/packages/ERTP/test/types.test-d.ts index cac360611e6e..41102e8629ed 100644 --- a/packages/ERTP/test/types.test-d.ts +++ b/packages/ERTP/test/types.test-d.ts @@ -1,11 +1,12 @@ import { Far } from '@endo/marshal'; +import type { Key } from '@endo/patterns'; import { expectType } from 'tsd'; - import { AmountMath, AssetKind } from '../src/index.js'; import type { Amount, AssetValueForKind, Brand, + Issuer, SetValue, } from '../src/types.js'; @@ -43,3 +44,8 @@ import type { // @ts-expect-error 'n' doesn't satisfy AssetKind const n: AssetValueForKind<'n'> = null; } + +{ + const issuer: Issuer = null as any; + expectType(issuer); +} diff --git a/packages/deploy-script-support/src/offer.js b/packages/deploy-script-support/src/offer.js index 5f71a05bd2a9..3c03908c865c 100644 --- a/packages/deploy-script-support/src/offer.js +++ b/packages/deploy-script-support/src/offer.js @@ -19,7 +19,7 @@ import { AmountMath } from '@agoric/ertp/src/amountMath.js'; * @param {ERef} walletAdmin - an internal type of the * wallet, not defined here * @param {ERef} zoe - * @param {ERef>} zoeInvitationPurse + * @param {ERef>} zoeInvitationPurse */ export const makeOfferAndFindInvitationAmount = ( walletAdmin, diff --git a/packages/smart-wallet/src/invitations.js b/packages/smart-wallet/src/invitations.js index 34d34a6d872a..6920b7a3e5c8 100644 --- a/packages/smart-wallet/src/invitations.js +++ b/packages/smart-wallet/src/invitations.js @@ -61,7 +61,7 @@ const MAX_PIPE_LENGTH = 2; * @param {ERef} zoe * @param {ERef} agoricNames * @param {Brand<'set'>} invitationBrand - * @param {Purse<'set'>} invitationsPurse + * @param {Purse<'set', InvitationDetails>} invitationsPurse * @param {(fromOfferId: string) => import('./types.js').InvitationMakers} getInvitationContinuation */ export const makeInvitationsHelper = ( @@ -105,7 +105,6 @@ export const makeInvitationsHelper = ( const { instance, description } = spec; // @ts-expect-error TS thinks it's always true. I'm doubtful. (instance && description) || Fail`missing instance or description`; - /** @type {Amount<'set'>} */ const purseAmount = await E(invitationsPurse).getCurrentAmount(); const invitations = AmountMath.getValue(invitationBrand, purseAmount); diff --git a/packages/store/src/stores/scalarMapStore.js b/packages/store/src/stores/scalarMapStore.js index 63ee03544858..cbc708c6909a 100644 --- a/packages/store/src/stores/scalarMapStore.js +++ b/packages/store/src/stores/scalarMapStore.js @@ -134,7 +134,7 @@ export const makeMapStoreMethods = ( * copyRecords, as keys and look them up based on equality of their contents. * * @template {Key} K - * @template {Passable} V + * @template {Passable} [V=any] * @param {string} [tag] - the column name for the key * @param {StoreOptions} [options] * @returns {MapStore} diff --git a/packages/wallet/api/src/internal-types.js b/packages/wallet/api/src/internal-types.js index c08258b56424..12c34f821905 100644 --- a/packages/wallet/api/src/internal-types.js +++ b/packages/wallet/api/src/internal-types.js @@ -7,7 +7,10 @@ * @property {PurseActions} actions */ -/** @import {Petname} from '@agoric/deploy-script-support/src/externalTypes.js' */ +/** + * @import {Petname} from '@agoric/deploy-script-support/src/externalTypes.js'; + * @import {Key} from '@endo/patterns'; + */ /** * @typedef {PursesJSONState & PursesAddedState} PursesFullState @@ -51,7 +54,7 @@ */ /** - * @template T + * @template {Key} T * @typedef {object} Mapping * @property {(petname: Petname) => string} implode * @property {(str: string) => Petname} explode diff --git a/packages/zoe/src/cleanProposal.js b/packages/zoe/src/cleanProposal.js index 8481d9a8af62..37fd8bef2bde 100644 --- a/packages/zoe/src/cleanProposal.js +++ b/packages/zoe/src/cleanProposal.js @@ -57,6 +57,7 @@ export const coerceAmountPatternKeywordRecord = ( getAssetKindByBrand, ) => { cleanKeywords(allegedAmountKeywordRecord); + // FIXME objectMap should constrain the mapping function by the record's type return objectMap(allegedAmountKeywordRecord, amount => { // Check that each value can be coerced using the AmountMath // indicated by brand. `AmountMath.coerce` throws if coercion fails. diff --git a/packages/zoe/src/zoeService/utils.d.ts b/packages/zoe/src/zoeService/utils.d.ts index 6a31f5973a07..3e3c2d9833c5 100644 --- a/packages/zoe/src/zoeService/utils.d.ts +++ b/packages/zoe/src/zoeService/utils.d.ts @@ -1,8 +1,8 @@ -import type { Callable } from '@agoric/internal/src/utils.js'; +import type { Issuer } from '@agoric/ertp/exported.js'; import type { Tagged } from '@agoric/internal/src/tagged.js'; -import type { VatUpgradeResults } from '@agoric/swingset-vat'; +import type { Callable } from '@agoric/internal/src/utils.js'; import type { Baggage } from '@agoric/swingset-liveslots'; -import type { Issuer } from '@agoric/ertp/exported.js'; +import type { VatUpgradeResults } from '@agoric/swingset-vat'; // XXX https://github.com/Agoric/agoric-sdk/issues/4565 type SourceBundle = Record; From 742414004ceca4cab0fb991b24960bcc2df4298d Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 24 Apr 2024 13:32:26 -0700 Subject: [PATCH 18/57] chore(types): Zoe accomodations --- .../src/contractFacet/offerHandlerStorage.js | 9 ++++-- .../zoe/src/contractFacet/types-ambient.d.ts | 2 +- packages/zoe/src/contractFacet/zcfMint.js | 5 ++-- packages/zoe/src/internal-types.js | 2 +- packages/zoe/src/zoeService/types-ambient.js | 2 +- packages/zoe/test/types.test-d.ts | 8 ++++- .../test/unitTests/contracts/test-oracle.js | 29 ++++++------------- 7 files changed, 27 insertions(+), 30 deletions(-) diff --git a/packages/zoe/src/contractFacet/offerHandlerStorage.js b/packages/zoe/src/contractFacet/offerHandlerStorage.js index 09e2d30bd75f..f874a56cba0d 100644 --- a/packages/zoe/src/contractFacet/offerHandlerStorage.js +++ b/packages/zoe/src/contractFacet/offerHandlerStorage.js @@ -6,9 +6,13 @@ import { canBeDurable, provideDurableWeakMapStore } from '@agoric/vat-data'; import { defineDurableHandle } from '../makeHandle.js'; +/** + * @typedef {RemotableBrand & RemotableObject & OfferHandler} PassableOfferHandler + */ + export const makeOfferHandlerStorage = zcfBaggage => { const makeInvitationHandle = defineDurableHandle(zcfBaggage, 'Invitation'); - /** @type {WeakMapStore} */ + /** @type {WeakMapStore} */ // ZCF needs to ephemerally hold on to ephemeral handlers, and durably hold // onto handlers that are intended to be durable. We keep two stores and store @@ -18,13 +22,12 @@ export const makeOfferHandlerStorage = zcfBaggage => { const invitationHandleToEphemeralHandler = makeScalarWeakMapStore( 'invitationHandleToEphemeralHandler', ); - /** @type {WeakMapStore} */ + /** @type {WeakMapStore} */ const invitationHandleToDurableHandler = provideDurableWeakMapStore( zcfBaggage, 'invitationHandleToDurableHandler', ); - /** @type {(offerHandler: OfferHandler) => InvitationHandle} */ const storeOfferHandler = offerHandler => { if (typeof offerHandler === 'function') { offerHandler = ToFarFunction('offerHandler', offerHandler); diff --git a/packages/zoe/src/contractFacet/types-ambient.d.ts b/packages/zoe/src/contractFacet/types-ambient.d.ts index e1a64e0b4a01..2dfadbe3be38 100644 --- a/packages/zoe/src/contractFacet/types-ambient.d.ts +++ b/packages/zoe/src/contractFacet/types-ambient.d.ts @@ -164,7 +164,7 @@ type ZCFMint = { * normally an instanceof Error. */ type ZCFSeatFail = (reason: unknown) => Error; -type ZCFSeat = { +type ZCFSeat = import('@endo/pass-style').RemotableObject & { exit: (completion?: Completion) => void; fail: ZCFSeatFail; getSubscriber: () => Promise>; diff --git a/packages/zoe/src/contractFacet/zcfMint.js b/packages/zoe/src/contractFacet/zcfMint.js index 4522559be235..7fbd2772b729 100644 --- a/packages/zoe/src/contractFacet/zcfMint.js +++ b/packages/zoe/src/contractFacet/zcfMint.js @@ -15,10 +15,9 @@ import './types-ambient.js'; const { Fail } = assert; /** - * @template {AssetKind} K * @param {AmountKeywordRecord} amr - * @param {IssuerRecord} issuerRecord - * @returns {Amount} + * @param {IssuerRecord} issuerRecord + * @returns {Amount} */ export const sumAmountKeywordRecord = (amr, issuerRecord) => { const empty = AmountMath.makeEmpty( diff --git a/packages/zoe/src/internal-types.js b/packages/zoe/src/internal-types.js index 8487a07b34da..3704df833183 100644 --- a/packages/zoe/src/internal-types.js +++ b/packages/zoe/src/internal-types.js @@ -53,7 +53,7 @@ */ /** - * @typedef {object} ZoeSeatAdmin + * @typedef {RemotableObject} ZoeSeatAdmin * @property {(allocation: Allocation) => void} replaceAllocation * @property {ZoeSeatAdminExit} exit * @property {import('@agoric/swingset-vat').ShutdownWithFailure} fail called with the reason diff --git a/packages/zoe/src/zoeService/types-ambient.js b/packages/zoe/src/zoeService/types-ambient.js index 190d3f98cc1a..24322cf70994 100644 --- a/packages/zoe/src/zoeService/types-ambient.js +++ b/packages/zoe/src/zoeService/types-ambient.js @@ -232,7 +232,7 @@ */ /** - * @typedef {Record>} AmountKeywordRecord + * @typedef {Record} AmountKeywordRecord * * The keys are keywords, and the values are amounts. For example: * { Asset: AmountMath.make(assetBrand, 5n), Price: diff --git a/packages/zoe/test/types.test-d.ts b/packages/zoe/test/types.test-d.ts index e747384b9d83..f6f46eee091c 100644 --- a/packages/zoe/test/types.test-d.ts +++ b/packages/zoe/test/types.test-d.ts @@ -5,8 +5,9 @@ * https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html */ import { E } from '@endo/eventual-send'; -import { expectNotType, expectType } from 'tsd'; +import { expectType } from 'tsd'; +import type { Key } from '@endo/patterns'; // 'prepare' is deprecated but still supported import type { prepare as scaledPriceAuthorityStart } from '../src/contracts/scaledPriceAuthority.js'; @@ -79,3 +80,8 @@ import type { prepare as scaledPriceAuthorityStart } from '../src/contracts/scal result.notInResult; expectType(result); } + +{ + const zcfSeat: ZCFSeat = null as any; + expectType(zcfSeat); +} diff --git a/packages/zoe/test/unitTests/contracts/test-oracle.js b/packages/zoe/test/unitTests/contracts/test-oracle.js index 10e02e4fd3bb..d235b15166d9 100644 --- a/packages/zoe/test/unitTests/contracts/test-oracle.js +++ b/packages/zoe/test/unitTests/contracts/test-oracle.js @@ -124,26 +124,15 @@ test('single oracle', /** @param {ExecutionContext} t */ async t => { t.truthy(await E(invitationIssuer).isLive(invitation3)); t.truthy(await E(invitationIssuer).isLive(invitation4)); - t.deepEqual( - (await E(invitationIssuer).getAmountOf(invitation1)).value[0].customDetails - .query, - query1, - ); - t.deepEqual( - (await E(invitationIssuer).getAmountOf(invitation2)).value[0].customDetails - .query, - query2, - ); - t.deepEqual( - (await E(invitationIssuer).getAmountOf(invitation3)).value[0].customDetails - .query, - query3, - ); - t.deepEqual( - (await E(invitationIssuer).getAmountOf(invitation4)).value[0].customDetails - .query, - query4, - ); + const getCustomDetailsQuery = async inv => { + const amt = await E(invitationIssuer).getAmountOf(inv); + return amt.value[0].customDetails?.query; + }; + + t.deepEqual(await getCustomDetailsQuery(invitation1), query1); + t.deepEqual(await getCustomDetailsQuery(invitation2), query2); + t.deepEqual(await getCustomDetailsQuery(invitation3), query3); + t.deepEqual(await getCustomDetailsQuery(invitation4), query4); const offer = E(zoe).offer(invitation1); From d1b431cd1fb259a4263e222125b0f659d77aba70 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 18 Jan 2024 16:12:50 -0800 Subject: [PATCH 19/57] chore(types): Passable type accomodations --- packages/ERTP/src/legacy-payment-helpers.js | 9 ++-- packages/ERTP/src/paymentLedger.js | 10 +--- packages/ERTP/src/types.js | 18 +++---- packages/base-zone/src/types.js | 5 ++ .../internal/test/test-storage-test-utils.js | 2 +- packages/notifier/src/types.js | 6 +-- .../store/src/stores/scalarWeakMapStore.js | 9 +++- .../store/src/stores/scalarWeakSetStore.js | 7 ++- packages/store/src/stores/store-utils.js | 47 +++++++++++++++---- packages/store/src/types.js | 6 ++- packages/vat-data/src/exo-utils.js | 7 +-- .../zoe/src/zoeService/zoeStorageManager.js | 3 +- packages/zoe/tools/types.js | 2 +- packages/zone/src/durable.js | 1 + 14 files changed, 86 insertions(+), 46 deletions(-) diff --git a/packages/ERTP/src/legacy-payment-helpers.js b/packages/ERTP/src/legacy-payment-helpers.js index af53e22a628a..55ca90f1c440 100644 --- a/packages/ERTP/src/legacy-payment-helpers.js +++ b/packages/ERTP/src/legacy-payment-helpers.js @@ -26,11 +26,11 @@ const { Fail } = assert; */ /** - * @template {AssetKind} K - * @param {ERef>} recoveryPurse - * @param {ERef>} srcPaymentP + * @template {Payment} P + * @param {ERef} recoveryPurse + * @param {ERef

} srcPaymentP * @param {Pattern} [optAmountShape] - * @returns {Promise>} + * @returns {Promise

} */ export const claim = async ( recoveryPurse, @@ -38,6 +38,7 @@ export const claim = async ( optAmountShape = undefined, ) => { const srcPayment = await srcPaymentP; + // @ts-expect-error XXX could be instantiated with a different subtype return E.when(E(recoveryPurse).deposit(srcPayment, optAmountShape), amount => E(recoveryPurse).withdraw(amount), ); diff --git a/packages/ERTP/src/paymentLedger.js b/packages/ERTP/src/paymentLedger.js index 525ad38ab9e2..33ae4c658f08 100644 --- a/packages/ERTP/src/paymentLedger.js +++ b/packages/ERTP/src/paymentLedger.js @@ -15,6 +15,7 @@ import { BrandI, makeIssuerInterfaces } from './typeGuards.js'; /** * @import {Amount, AssetKind, DisplayInfo, PaymentLedger, Payment, Brand, RecoverySetsOption, Purse, Issuer, Mint} from './types.js' * @import {ShutdownWithFailure} from '@agoric/swingset-vat' + * @import {Key} from '@endo/patterns'; */ const { details: X, quote: q, Fail } = assert; @@ -366,11 +367,6 @@ export const preparePaymentLedger = ( * `makeIssuerKit` drops it on the floor, it can still be recovered in an * emergency upgrade. */ - // Should be - // at-ts-expect-error checked cast - // but ran into the usual disagreement between local lint and IDE lint. - // Don't know yet about lint under CI. - const mintRecoveryPurse = /** @type {Purse} */ ( issuerZone.makeOnce('mintRecoveryPurse', () => makeEmptyPurse()) ); @@ -381,10 +377,6 @@ export const preparePaymentLedger = ( return issuer; }, mintPayment(newAmount) { - // Should be - // at-ts-expect-error checked cast - // but ran into the usual disagreement between local lint and CI - newAmount = coerce(newAmount); mustMatch(newAmount, amountShape, 'minted amount'); // `rawPayment` is not associated with any recovery set, and diff --git a/packages/ERTP/src/types.js b/packages/ERTP/src/types.js index ac6dd883c641..90607ccef177 100644 --- a/packages/ERTP/src/types.js +++ b/packages/ERTP/src/types.js @@ -300,14 +300,6 @@ export {}; * If payment is a promise, throw an error. */ -/** - * @template {AssetKind} K - * @callback PurseDeposit - * @param {Payment} payment - * @param {Pattern} [optAmountShape] - * @returns {Amount} - */ - /** * @template {AssetKind} [K=AssetKind] * @template {Key} [M=Key] member kind, for Amounts that have member values @@ -331,9 +323,13 @@ export {}; * this purse. * @property {() => LatestTopic>} getCurrentAmountNotifier Get a * lossy notifier for changes to this purse's balance. - * @property {PurseDeposit} deposit Deposit all the contents of payment into - * this purse, returning the amount. If the optional argument `optAmount` does - * not equal the amount of digital assets in the payment, throw an error. + * @property {

>( + * payment: P, + * optAmountShape?: Pattern, + * ) => P extends Payment ? Amount : never} deposit + * Deposit all the contents of payment into this purse, returning the amount. If + * the optional argument `optAmount` does not equal the amount of digital + * assets in the payment, throw an error. * * If payment is a promise, throw an error. * @property {() => DepositFacet} getDepositFacet Return an object whose diff --git a/packages/base-zone/src/types.js b/packages/base-zone/src/types.js index c7eaf060e159..d4eafcdbeeff 100644 --- a/packages/base-zone/src/types.js +++ b/packages/base-zone/src/types.js @@ -6,6 +6,11 @@ import { watchPromise } from './watch-promise.js'; // Ensure this is a module. export {}; +/** + * @import {Key} from '@endo/patterns'; + * @import {Passable} from '@endo/pass-style'; + */ + /** @typedef {'exoClass' | 'exoClassKit' | 'exo' | 'store' | 'zone'} KeyCategories */ /** @typedef {Record string[]>} KeyMakers */ diff --git a/packages/internal/test/test-storage-test-utils.js b/packages/internal/test/test-storage-test-utils.js index 5eab748c657b..b4d6a76d19b3 100644 --- a/packages/internal/test/test-storage-test-utils.js +++ b/packages/internal/test/test-storage-test-utils.js @@ -264,7 +264,7 @@ test('makeFakeStorageKit sequence data', async t => { }); const testUnmarshaller = test.macro((t, format) => { - /** @type {(val: SlottedRemotable) => string} */ + /** @type {(val: import('@endo/marshal').RemotableObject & SlottedRemotable) => string} */ const convertValToSlot = val => val.getBoardId(); const serializeBodyFormat = /** @type {any} */ (format); const m = makeMarshal(convertValToSlot, undefined, { serializeBodyFormat }); diff --git a/packages/notifier/src/types.js b/packages/notifier/src/types.js index d8594fb07ee7..37c7c0e02bb1 100644 --- a/packages/notifier/src/types.js +++ b/packages/notifier/src/types.js @@ -226,7 +226,7 @@ export {}; /** * @template T - * @typedef {NotifierInternals & + * @typedef {import('@endo/marshal').RemotableObject & NotifierInternals & * ForkableAsyncIterable & * SharableNotifier * } Notifier an object that can be used to get the current state or updates @@ -248,8 +248,8 @@ export {}; /** * @template T - * @typedef {object} NotifierRecord the produced notifier/updater pair - * @property {IterationObserver} updater the (closely-held) notifier producer + * @typedef {object} NotifierRecord the produced notifier/updater pair + * @property {import('@endo/marshal').RemotableObject & IterationObserver} updater the (closely-held) notifier producer * @property {Notifier} notifier the (widely-held) notifier consumer */ diff --git a/packages/store/src/stores/scalarWeakMapStore.js b/packages/store/src/stores/scalarWeakMapStore.js index ebfee6b9aa60..9d3e672627d0 100644 --- a/packages/store/src/stores/scalarWeakMapStore.js +++ b/packages/store/src/stores/scalarWeakMapStore.js @@ -6,12 +6,17 @@ import { isCopyMap, } from '@endo/patterns'; -/** @import {WeakMapStore, StoreOptions} from '../types.js'; */ +/** + * @import {Key} from '@endo/patterns'; + * @import {Passable} from '@endo/pass-style'; + * @import {WeakMapStore, StoreOptions} from '../types.js'; + */ const { quote: q, Fail } = assert; /** - * @template K,V + * @template {Key} K + * @template {Passable} V * @param {WeakMap} jsmap * @param {(k: K, v: V) => void} assertKVOkToAdd * @param {(k: K, v: V) => void} assertKVOkToSet diff --git a/packages/store/src/stores/scalarWeakSetStore.js b/packages/store/src/stores/scalarWeakSetStore.js index 8bc8cab8a9c0..57ec6f5c87fb 100644 --- a/packages/store/src/stores/scalarWeakSetStore.js +++ b/packages/store/src/stores/scalarWeakSetStore.js @@ -8,10 +8,13 @@ import { const { quote: q, Fail } = assert; -/** @import {StoreOptions, WeakSetStore} from '@agoric/store'; */ +/** + * @import {Key} from '@endo/patterns'; + * @import {StoreOptions, WeakSetStore} from '@agoric/store'; + */ /** - * @template K + * @template {Key} K * @param {WeakSet} jsset * @param {(k: K) => void} assertKeyOkToAdd * @param {(k: K) => void} [assertKeyOkToDelete] diff --git a/packages/store/src/stores/store-utils.js b/packages/store/src/stores/store-utils.js index 953386589fd8..77ca084ee42a 100644 --- a/packages/store/src/stores/store-utils.js +++ b/packages/store/src/stores/store-utils.js @@ -1,14 +1,42 @@ import { Far } from '@endo/marshal'; +import { M, matches } from '@endo/patterns'; /** * @import {RankCompare} from '@endo/marshal'; * @import {MapStore, WeakMapStore} from '../types.js'; + * @import {Passable} from '@endo/pass-style'; + * @import {Key} from '@endo/patterns'; */ const { Fail, quote: q } = assert; +// TODO: Undate `@endo/patterns` to export the original, and delete the +// reimplementation here. /** - * @template K,V + * Should behave identically to the one in `@endo/patterns`, but reimplemented + * for now because `@endo/patterns` forgot to export this one. This one is + * simple enough that I prefer a reimplementation to a deep import. + * + * @param {unknown} s + * @returns {s is CopySet} + */ +export const isCopySet = s => matches(s, M.set()); + +// TODO: Undate `@endo/patterns` to export the original, and delete the +// reimplementation here. +/** + * Should behave identically to the one in `@endo/patterns`, but reimplemented + * for now because `@endo/patterns` forgot to export this one. This one is + * simple enough that I prefer a reimplementation to a deep import. + * + * @param {unknown} m + * @returns {m is CopyMap} + */ +export const isCopyMap = m => matches(m, M.map()); + +/** + * @template {Key} K + * @template {Passable} V * @typedef {object} CurrentKeysKit * @property {(k: K, v?: V) => void} assertUpdateOnAdd * @property {(k: K) => void} assertUpdateOnDelete @@ -16,7 +44,8 @@ const { Fail, quote: q } = assert; */ /** - * @template K,V + * @template {Key} K + * @template {Passable} V * @param {() => Iterable} getRawKeys * @param {(k: K) => boolean} checkHas * @param {RankCompare} compare @@ -91,7 +120,8 @@ harden(makeCurrentKeysKit); * already is one, return that. Otherwise, call `makeValue(key)`, remember it as * the value for that key, and return it. * - * @template K,V + * @template {Key} K + * @template {Passable} V * @param {WeakMapStore} mapStore * @param {K} key * @param {(key: K) => V} makeValue @@ -116,8 +146,8 @@ harden(provideLazy); * termination to happen after the make completes and before it reaches durable * storage. * - * @template K - * @template V + * @template {Key} K + * @template {Passable} V * @param {WeakMapStore} store */ export const makeAtomicProvider = store => { @@ -167,13 +197,14 @@ export const makeAtomicProvider = store => { }; harden(makeAtomicProvider); /** - * @template K - * @template V + * @template {Key} K + * @template {Passable} V * @typedef {ReturnType>} AtomicProvider */ /** - * @template K, V + * @template {Key} K + * @template {Passable} V * @param {MapStore} mapStore * @param {K} key * @param {V} item diff --git a/packages/store/src/types.js b/packages/store/src/types.js index 71148db109b7..ca89af897538 100644 --- a/packages/store/src/types.js +++ b/packages/store/src/types.js @@ -65,7 +65,11 @@ export {}; /** * @template {Key} [K=Key] - * @typedef {object} SetStore + * @typedef {import('@endo/pass-style').RemotableObject & SetStoreMethods} SetStore + */ +/** + * @template {Key} [K=Key] + * @typedef {object} SetStoreMethods * @property {(key: K) => boolean} has Check if a key exists. The key can be any * JavaScript value, though the answer will always be false for keys that * cannot be found in this store. diff --git a/packages/vat-data/src/exo-utils.js b/packages/vat-data/src/exo-utils.js index a718afa35cc6..4c52bf180a76 100644 --- a/packages/vat-data/src/exo-utils.js +++ b/packages/vat-data/src/exo-utils.js @@ -5,8 +5,9 @@ import { initEmpty } from '@agoric/store'; import { provide, VatData as globalVatData } from './vat-data-bindings.js'; /** - * @import {InterfaceGuard} from '@endo/patterns' - * @import {Baggage, DefineKindOptions, DurableKindHandle, InterfaceGuardKit} from '@agoric/swingset-liveslots' + * @import {InterfaceGuard} from '@endo/patterns'; + * @import {RemotableObject} from '@endo/pass-style'; + * @import {Baggage, DefineKindOptions, DurableKindHandle, InterfaceGuardKit} from '@agoric/swingset-liveslots'; */ /** @@ -206,7 +207,7 @@ export const makeExoUtils = VatData => { * @param {InterfaceGuard | undefined} interfaceGuard * @param {I} init * @param {T & ThisType<{ - * self: T, + * self: RemotableObject & T, * state: ReturnType * }>} methods * @param {DefineKindOptions<{ diff --git a/packages/zoe/src/zoeService/zoeStorageManager.js b/packages/zoe/src/zoeService/zoeStorageManager.js index bfd23e38adb2..ae763e42adce 100644 --- a/packages/zoe/src/zoeService/zoeStorageManager.js +++ b/packages/zoe/src/zoeService/zoeStorageManager.js @@ -275,8 +275,9 @@ export const makeZoeStorageManager = ( ownKeys(customDetails).length >= 1 ? harden({ customDetails }) : harden({}); + /** @type {InvitationAmount} */ const invitationAmount = AmountMath.make( - invitationKit.brand, + /** @type {Brand<'set'>} */ (invitationKit.brand), harden([ { ...extraProperties, diff --git a/packages/zoe/tools/types.js b/packages/zoe/tools/types.js index d4a5b4b822fc..94c2d1d60df5 100644 --- a/packages/zoe/tools/types.js +++ b/packages/zoe/tools/types.js @@ -64,7 +64,7 @@ export {}; * An object that mints PriceQuotes and handles * triggers and notifiers for changes in the price * - * @property {(brandIn: Brand, brandOut: Brand) => ERef>} getQuoteIssuer + * @property {(brandIn: Brand, brandOut: Brand) => ERef>} getQuoteIssuer * Get the ERTP issuer of PriceQuotes for a given brandIn/brandOut pair * * @property {(brandIn: Brand, diff --git a/packages/zone/src/durable.js b/packages/zone/src/durable.js index fc88f3ef0e47..34bcb69cd515 100644 --- a/packages/zone/src/durable.js +++ b/packages/zone/src/durable.js @@ -96,6 +96,7 @@ export const makeDurableZone = (baggage, baseLabel = 'durableZone') => { /** @type {import('.').Zone['subZone']} */ const subZone = (label, options = {}) => { + /** @type {import('@agoric/swingset-liveslots').Baggage} */ const subBaggage = subZoneStore(label, options); return makeDurableZone(subBaggage, `${baseLabel}.${label}`); }; From 5aa92bf02e432c5b249ff84730c9fa2bf080c3ea Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 24 Apr 2024 16:19:32 -0700 Subject: [PATCH 20/57] chore(types): Zoe accomodations --- packages/zoe/src/internal-types.js | 7 +++++-- packages/zoe/src/zoeService/startInstance.js | 9 +++++++++ packages/zoe/src/zoeService/zoeSeat.js | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/zoe/src/internal-types.js b/packages/zoe/src/internal-types.js index 3704df833183..b84970e0ffb8 100644 --- a/packages/zoe/src/internal-types.js +++ b/packages/zoe/src/internal-types.js @@ -53,13 +53,16 @@ */ /** - * @typedef {RemotableObject} ZoeSeatAdmin + * @typedef ZoeSeatAdminMethods * @property {(allocation: Allocation) => void} replaceAllocation * @property {ZoeSeatAdminExit} exit * @property {import('@agoric/swingset-vat').ShutdownWithFailure} fail called with the reason * for calling fail on this seat, where reason is normally an instanceof Error. * @property {() => Subscriber} getExitSubscriber */ +/** + * @typedef {import('@endo/marshal').RemotableObject & ZoeSeatAdminMethods} ZoeSeatAdmin + */ /** * @callback {(brand: Brand) => AssetKind} GetAssetKind @@ -67,7 +70,7 @@ /** * @typedef {object} HandleOfferResult - * @property {Promise} offerResultPromise + * @property {Promise} offerResultPromise * @property {ExitObj} exitObj */ diff --git a/packages/zoe/src/zoeService/startInstance.js b/packages/zoe/src/zoeService/startInstance.js index ea70986549d1..cd88e6801e60 100644 --- a/packages/zoe/src/zoeService/startInstance.js +++ b/packages/zoe/src/zoeService/startInstance.js @@ -274,6 +274,14 @@ export const makeStartInstance = ( }, ); + /** + * + * @param {Promise} installationP + * @param {IssuerKeywordRecord} uncleanIssuerKeywordRecord + * @param {unknown} customTerms + * @param {unknown} privateArgs + * @param {string} instanceLabel + */ const startInstance = async ( installationP, uncleanIssuerKeywordRecord = harden({}), @@ -330,6 +338,7 @@ export const makeStartInstance = ( void watchForAdminNodeDone(adminNode, instanceAdmin); /** @type {ZoeInstanceAdmin} */ + // @ts-expect-error XXX saveIssuer const zoeInstanceAdminForZcf = makeZoeInstanceAdmin( zoeInstanceStorageManager, instanceAdmin, diff --git a/packages/zoe/src/zoeService/zoeSeat.js b/packages/zoe/src/zoeService/zoeSeat.js index 688dcbb6a52d..0c7b0b846ab8 100644 --- a/packages/zoe/src/zoeService/zoeSeat.js +++ b/packages/zoe/src/zoeService/zoeSeat.js @@ -109,7 +109,7 @@ export const makeZoeSeatAdminFactory = baggage => { return { currentAllocation: initialAllocation, proposal, - offerResult: undefined, + offerResult: /** @type {any} */ (undefined), offerResultStored: offerResultIsUndefined, instanceAdminHelper, withdrawFacet, From ea879f478310606801d4cdc986fea56044c528b6 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 24 Apr 2024 16:22:48 -0700 Subject: [PATCH 21/57] chore: explicit unhandled promises --- packages/zoe/src/zoeService/originalZoeSeat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zoe/src/zoeService/originalZoeSeat.js b/packages/zoe/src/zoeService/originalZoeSeat.js index 97e4660851d7..f1cb189c7e9f 100644 --- a/packages/zoe/src/zoeService/originalZoeSeat.js +++ b/packages/zoe/src/zoeService/originalZoeSeat.js @@ -217,7 +217,7 @@ export const declareOldZoeSeatAdminKind = (baggage, makeDurablePublishKit) => { } const pKit = ephemeralOfferResultStore.get(facets.userSeat); - E.when( + void E.when( offerResultPromise, offerResult => { // Resolve the ephemeral promise for offerResult From 71db40c8bd168af2269d0343525b24de5bd97bd0 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 24 Apr 2024 16:32:21 -0700 Subject: [PATCH 22/57] chore(types): Price quotes --- packages/zoe/src/contractSupport/priceAuthority.js | 2 +- packages/zoe/src/contractSupport/priceAuthorityInitial.js | 2 +- packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/zoe/src/contractSupport/priceAuthority.js b/packages/zoe/src/contractSupport/priceAuthority.js index a3510f7eb23d..ba779438a940 100644 --- a/packages/zoe/src/contractSupport/priceAuthority.js +++ b/packages/zoe/src/contractSupport/priceAuthority.js @@ -65,7 +65,7 @@ export const PriceAuthorityI = M.interface('PriceAuthority', { /** * @param {object} opts - * @param {Issuer<'set'>} opts.quoteIssuer + * @param {Issuer<'set', PriceDescription>} opts.quoteIssuer * @param {ERef>} opts.notifier * @param {ERef} opts.timer * @param {PriceQuoteCreate} opts.createQuote diff --git a/packages/zoe/src/contractSupport/priceAuthorityInitial.js b/packages/zoe/src/contractSupport/priceAuthorityInitial.js index 273d375729d4..30bf50381582 100644 --- a/packages/zoe/src/contractSupport/priceAuthorityInitial.js +++ b/packages/zoe/src/contractSupport/priceAuthorityInitial.js @@ -23,7 +23,7 @@ import { mintQuote } from './priceAuthorityTransform.js'; * * @param {Ratio} priceOutPerIn * @param {PriceAuthority} priceAuthority - * @param {ERef>} quoteMint + * @param {ERef>} quoteMint * @param {Brand<'nat'>} brandIn * @param {Brand<'nat'>} brandOut * @returns {PriceAuthority} diff --git a/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js b/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js index 46531ffc125c..e31feb903472 100644 --- a/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js +++ b/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js @@ -4,7 +4,7 @@ import { provideDurableMapStore } from '@agoric/vat-data'; /** * * @param {import('@agoric/vat-data').Baggage} baggage - * @returns {ERef>} + * @returns {ERef>} */ export const provideQuoteMint = baggage => { const issuerBaggage = provideDurableMapStore( @@ -19,5 +19,6 @@ export const provideQuoteMint = baggage => { undefined, { recoverySetsOption: 'noRecoverySets' }, ); + // @ts-expect-error checked cast return issuerKit.mint; }; From 9b6461be2e23d5ae9912d3bee63279b914205ca5 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 24 Apr 2024 16:32:51 -0700 Subject: [PATCH 23/57] fix: OfferResult can be a symbol --- packages/zoe/src/zoeService/originalZoeSeat.js | 5 +++-- packages/zoe/src/zoeService/zoeSeat.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/zoe/src/zoeService/originalZoeSeat.js b/packages/zoe/src/zoeService/originalZoeSeat.js index f1cb189c7e9f..68a2ed2d92fa 100644 --- a/packages/zoe/src/zoeService/originalZoeSeat.js +++ b/packages/zoe/src/zoeService/originalZoeSeat.js @@ -135,7 +135,7 @@ export const declareOldZoeSeatAdminKind = (baggage, makeDurablePublishKit) => { currentAllocation: initialAllocation, proposal, exitObj, - offerResult: undefined, + offerResult: /** @type {any} */ (undefined), offerResultStored: offerResultIsUndefined, instanceAdminHelper, withdrawFacet, @@ -240,7 +240,8 @@ export const declareOldZoeSeatAdminKind = (baggage, makeDurablePublishKit) => { ephemeralOfferResultStore.delete(facets.userSeat); } catch (err) { console.warn( - `non-durable offer result will be lost upon zoe vat termination: ${offerResult}`, + 'non-durable offer result will be lost upon zoe vat termination:', + offerResult, ); } }, diff --git a/packages/zoe/src/zoeService/zoeSeat.js b/packages/zoe/src/zoeService/zoeSeat.js index 0c7b0b846ab8..31abb4aa8c84 100644 --- a/packages/zoe/src/zoeService/zoeSeat.js +++ b/packages/zoe/src/zoeService/zoeSeat.js @@ -312,7 +312,8 @@ export const makeZoeSeatAdminFactory = baggage => { ephemeralOfferResultStore.delete(facets.zoeSeatAdmin); } catch (err) { console.warn( - `non-durable offer result will be lost upon zoe vat termination: ${offerResult}`, + 'non-durable offer result will be lost upon zoe vat termination:', + offerResult, ); } }, From 29d126402678f1f6c1075f36fa578633b4b778d2 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 24 Apr 2024 16:41:28 -0700 Subject: [PATCH 24/57] fix(types): TypedMatcher --- packages/zoe/src/contractSupport/recorder.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/zoe/src/contractSupport/recorder.js b/packages/zoe/src/contractSupport/recorder.js index 6e81830902b2..7c9e63f7536f 100644 --- a/packages/zoe/src/contractSupport/recorder.js +++ b/packages/zoe/src/contractSupport/recorder.js @@ -94,7 +94,7 @@ export const prepareRecorder = (baggage, marshaller) => { /** * Marshalls before writing to storage or publisher to help ensure the two streams match. * - * @param {unknown} value + * @param {any} value * @returns {Promise} */ async write(value) { @@ -111,7 +111,7 @@ export const prepareRecorder = (baggage, marshaller) => { /** * Like `write` but prevents future writes and terminates the publisher. * - * @param {unknown} value + * @param {any} value * @returns {Promise} */ async writeFinal(value) { @@ -267,7 +267,7 @@ export const prepareMockRecorderKitMakers = () => { * whole thing to `any`. * * @template T - * @typedef {{ validatedType?: T }} TypedMatcher + * @typedef {import('@endo/patterns').Matcher & { validatedType?: T }} TypedMatcher */ /** From 7a9982bf8572f43ce8670ed6e73ee4c8fad858b5 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 25 Apr 2024 13:02:01 -0700 Subject: [PATCH 25/57] feat(types): readLatest returns any --- packages/boot/tools/supports.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/boot/tools/supports.ts b/packages/boot/tools/supports.ts index 45ca480db633..3f4d20153489 100644 --- a/packages/boot/tools/supports.ts +++ b/packages/boot/tools/supports.ts @@ -283,7 +283,7 @@ export const makeSwingsetTestKit = async ( const { kernelStorage, hostStorage } = swingStore; const { fromCapData } = boardSlottingMarshaller(slotToBoardRemote); - const readLatest = path => { + const readLatest = (path: string): any => { const data = unmarshalFromVstorage(storage.data, path, fromCapData, -1); trace('readLatest', path, 'returning', inspect(data, false, 20, true)); return data; From 84c1821f12f5e6103c84ce3c5133aba4aa5772e5 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 24 Apr 2024 17:48:04 -0700 Subject: [PATCH 26/57] chore(types): defer collection strictness --- packages/store/src/stores/scalarMapStore.js | 8 ++- packages/store/src/stores/scalarSetStore.js | 4 +- .../store/src/stores/scalarWeakMapStore.js | 1 + .../store/src/stores/scalarWeakSetStore.js | 5 +- packages/store/src/types.js | 54 ++++++++++++------- packages/wallet/api/src/lib-dehydrate.js | 13 +++-- 6 files changed, 51 insertions(+), 34 deletions(-) diff --git a/packages/store/src/stores/scalarMapStore.js b/packages/store/src/stores/scalarMapStore.js index cbc708c6909a..2c88f652af10 100644 --- a/packages/store/src/stores/scalarMapStore.js +++ b/packages/store/src/stores/scalarMapStore.js @@ -18,7 +18,7 @@ import { makeCurrentKeysKit } from './store-utils.js'; /** * @import {Passable} from '@endo/pass-style'); * @import {Key, Pattern} from '@endo/patterns'); - * @import {MapStore, StoreOptions} from '../types.js'; + * @import {MapStore, MapStoreMethods, StoreOptions} from '../types.js'; */ const { quote: q } = assert; @@ -31,7 +31,7 @@ const { quote: q } = assert; * @param {(k: K, v: V) => void} assertKVOkToSet * @param {(k: K) => void} [assertKeyOkToDelete] * @param {string} [tag] - * @returns {MapStore} + * @returns {MapStoreMethods} */ export const makeMapStoreMethods = ( jsmap, @@ -133,11 +133,9 @@ export const makeMapStoreMethods = ( * or remotables. Other storeMaps will accept, for example, copyArrays and * copyRecords, as keys and look them up based on equality of their contents. * - * @template {Key} K - * @template {Passable} [V=any] * @param {string} [tag] - the column name for the key * @param {StoreOptions} [options] - * @returns {MapStore} + * @returns {RemotableObject & MapStore} */ export const makeScalarMapStore = ( tag = 'key', diff --git a/packages/store/src/stores/scalarSetStore.js b/packages/store/src/stores/scalarSetStore.js index 5d4eecec0d0d..5f4756fc628f 100644 --- a/packages/store/src/stores/scalarSetStore.js +++ b/packages/store/src/stores/scalarSetStore.js @@ -12,7 +12,7 @@ import { makeCurrentKeysKit } from './store-utils.js'; /** * @import {Key, Pattern} from '@endo/patterns'); - * @import {SetStore, StoreOptions} from '../types.js'; + * @import {SetStore, SetStoreMethods, StoreOptions} from '../types.js'; */ const { quote: q } = assert; @@ -23,7 +23,7 @@ const { quote: q } = assert; * @param {(k: K) => void} assertKeyOkToAdd * @param {(k: K) => void} [assertKeyOkToDelete] * @param {string} [keyName] - * @returns {SetStore} + * @returns {SetStoreMethods} */ export const makeSetStoreMethods = ( jsset, diff --git a/packages/store/src/stores/scalarWeakMapStore.js b/packages/store/src/stores/scalarWeakMapStore.js index 9d3e672627d0..640abffa04f5 100644 --- a/packages/store/src/stores/scalarWeakMapStore.js +++ b/packages/store/src/stores/scalarWeakMapStore.js @@ -71,6 +71,7 @@ export const makeWeakMapStoreMethods = ( addAll: entries => { if (typeof entries[Symbol.iterator] !== 'function') { if (Object.isFrozen(entries) && isCopyMap(entries)) { + // @ts-expect-error XXX entries = getCopyMapEntries(entries); } else { Fail`provided data source is not iterable: ${entries}`; diff --git a/packages/store/src/stores/scalarWeakSetStore.js b/packages/store/src/stores/scalarWeakSetStore.js index 57ec6f5c87fb..cc5762b47855 100644 --- a/packages/store/src/stores/scalarWeakSetStore.js +++ b/packages/store/src/stores/scalarWeakSetStore.js @@ -10,7 +10,7 @@ const { quote: q, Fail } = assert; /** * @import {Key} from '@endo/patterns'; - * @import {StoreOptions, WeakSetStore} from '@agoric/store'; + * @import {StoreOptions, WeakSetStore, WeakSetStoreMethods} from '@agoric/store'; */ /** @@ -19,7 +19,7 @@ const { quote: q, Fail } = assert; * @param {(k: K) => void} assertKeyOkToAdd * @param {(k: K) => void} [assertKeyOkToDelete] * @param {string} [keyName] - * @returns {WeakSetStore} + * @returns {WeakSetStoreMethods} */ export const makeWeakSetStoreMethods = ( jsset, @@ -53,6 +53,7 @@ export const makeWeakSetStoreMethods = ( addAll: keys => { if (typeof keys[Symbol.iterator] !== 'function') { if (Object.isFrozen(keys) && isCopySet(keys)) { + // @ts-expect-error XXX keys = getCopySetKeys(keys); } else { Fail`provided data source is not iterable: ${keys}`; diff --git a/packages/store/src/types.js b/packages/store/src/types.js index ca89af897538..45978b51cf45 100644 --- a/packages/store/src/types.js +++ b/packages/store/src/types.js @@ -6,7 +6,7 @@ export {}; /** * Note TODO https://github.com/endojs/endo/issues/1488 * - * @import {Passable} from '@endo/pass-style' + * @import {Passable, RemotableObject} from '@endo/pass-style' * @import {CopySet, CopyMap, Pattern} from '@endo/patterns' * @import {Key} from '@endo/patterns' */ @@ -49,9 +49,10 @@ export {}; * WeakStores, but with the additional query and query-update methods. */ +// TODO use Key for K /** - * @template {Key} [K=Key] - * @typedef {object} WeakSetStore + * @template K + * @typedef {object} WeakSetStoreMethods * @property {(key: K) => boolean} has Check if a key exists. The key can be any * JavaScript value, though the answer will always be false for keys that * cannot be found in this store. @@ -60,15 +61,16 @@ export {}; * this store. For example a scalar store only allows primitives and * remotables. * @property {(key: K) => void} delete Remove the key. Throws if not found. - * @property {(keys: CopySet | Iterable) => void} addAll + * @property {(keys: CopySet | Iterable) => void} addAll */ - /** - * @template {Key} [K=Key] - * @typedef {import('@endo/pass-style').RemotableObject & SetStoreMethods} SetStore + * @template K + * @typedef {RemotableObject & WeakSetStoreMethods} WeakSetStore */ + +// TODO use Key for K /** - * @template {Key} [K=Key] + * @template K * @typedef {object} SetStoreMethods * @property {(key: K) => boolean} has Check if a key exists. The key can be any * JavaScript value, though the answer will always be false for keys that @@ -78,17 +80,23 @@ export {}; * this store. For example a scalar store only allows primitives and * remotables. * @property {(key: K) => void} delete Remove the key. Throws if not found. - * @property {(keys: CopySet | Iterable) => void} addAll + * @property {(keys: CopySet | Iterable) => void} addAll * @property {(keyPatt?: Pattern) => Iterable} keys * @property {(keyPatt?: Pattern) => Iterable} values - * @property {(keyPatt?: Pattern) => CopySet} snapshot + * @property {(keyPatt?: Pattern) => CopySet} snapshot * @property {(keyPatt?: Pattern) => number} getSize * @property {(keyPatt?: Pattern) => void} clear */ +/** + * @template K + * @typedef {RemotableObject & SetStoreMethods} SetStore + */ +// TODO use Key for K +// TODO use Passable for V /** - * @template {Key} [K=Key] - * @template {Passable} [V=Passable] + * @template K + * @template V * @typedef {object} WeakMapStore * @property {(key: K) => boolean} has Check if a key exists. The key can be any * JavaScript value, though the answer will always be false for keys that @@ -100,13 +108,15 @@ export {}; * example a scalar store only allows primitives and remotables. * @property {(key: K, value: V) => void} set Set the key. Throws if not found. * @property {(key: K) => void} delete Remove the key. Throws if not found. - * @property {(entries: CopyMap | Iterable<[K, V]>) => void} addAll + * @property {(entries: CopyMap | Iterable<[K, V]>) => void} addAll */ +// TODO use Key for K +// TODO use Passable for V /** - * @template {Key} [K=Key] - * @template {Passable} [V=Passable] - * @typedef {object} MapStore + * @template K + * @template V + * @typedef {object} MapStoreMethods * @property {(key: K) => boolean} has Check if a key exists. The key can be any * JavaScript value, though the answer will always be false for keys that * cannot be found in this map @@ -117,14 +127,22 @@ export {}; * example a scalar store only allows primitives and remotables. * @property {(key: K, value: V) => void} set Set the key. Throws if not found. * @property {(key: K) => void} delete Remove the key. Throws if not found. - * @property {(entries: CopyMap | Iterable<[K, V]>) => void} addAll + * @property {(entries: CopyMap | Iterable<[K, V]>) => void} addAll * @property {(keyPatt?: Pattern, valuePatt?: Pattern) => Iterable} keys * @property {(keyPatt?: Pattern, valuePatt?: Pattern) => Iterable} values * @property {(keyPatt?: Pattern, valuePatt?: Pattern) => Iterable<[K, V]>} entries - * @property {(keyPatt?: Pattern, valuePatt?: Pattern) => CopyMap} snapshot + * @property {( + * keyPatt?: Pattern, + * valuePatt?: Pattern, + * ) => CopyMap} snapshot * @property {(keyPatt?: Pattern, valuePatt?: Pattern) => number} getSize * @property {(keyPatt?: Pattern, valuePatt?: Pattern) => void} clear */ +/** + * @template [K=any] + * @template [V=any] + * @typedef {RemotableObject & MapStoreMethods} MapStore + */ // ///////////////////////// Deprecated Legacy ///////////////////////////////// diff --git a/packages/wallet/api/src/lib-dehydrate.js b/packages/wallet/api/src/lib-dehydrate.js index 55d0209fe6b9..b4f7defb55e0 100644 --- a/packages/wallet/api/src/lib-dehydrate.js +++ b/packages/wallet/api/src/lib-dehydrate.js @@ -86,10 +86,9 @@ export const makeDehydrator = (initialUnnamedCount = 0) => { }; /** - * @template T * @param {string} kind * @param {{ useLegacyMap?: boolean }} [legacyOptions] - * @returns {Mapping} + * @returns {Mapping} */ const makeMapping = (kind, { useLegacyMap = false } = {}) => { typeof kind === 'string' || `kind ${kind} must be a string`; @@ -97,9 +96,9 @@ export const makeDehydrator = (initialUnnamedCount = 0) => { // These are actually either a LegacyMap or a MapStore depending on // useLegacyMap. Fortunately, the LegacyMap type is approximately the // intersection of these, so we can just use it. - /** @type {LegacyMap} */ + /** @type {LegacyMap} */ const rawValToPetname = makeMap('value'); - /** @type {LegacyMap} */ + /** @type {LegacyMap} */ const valToPetname = { ...rawValToPetname, set(key, val) { @@ -121,9 +120,9 @@ export const makeDehydrator = (initialUnnamedCount = 0) => { return mapIterable(rawValToPetname.values(), val => explode(val)); }, }; - /** @type {MapStore} */ + /** @type {MapStore} */ const rawPetnameToVal = makeScalarMapStore('petname'); - /** @type {MapStore} */ + /** @type {MapStore} */ const petnameToVal = { ...rawPetnameToVal, init(key, val) { @@ -270,7 +269,7 @@ export const makeDehydrator = (initialUnnamedCount = 0) => { petnameToVal.delete(petname); valToPetname.delete(val); }; - /** @type {Mapping} */ + /** @type {Mapping} */ const mapping = harden({ implode, explode, From 8fa4a3e47dc7f8a86ebb666aaba7bf5ec7e48c29 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 25 Apr 2024 13:00:36 -0700 Subject: [PATCH 27/57] chore(types): relax OfferSpec offerArgs --- packages/smart-wallet/src/offers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/smart-wallet/src/offers.js b/packages/smart-wallet/src/offers.js index bd4b73c0f01a..75f7685453e1 100644 --- a/packages/smart-wallet/src/offers.js +++ b/packages/smart-wallet/src/offers.js @@ -10,7 +10,7 @@ import '@agoric/zoe/src/zoeService/types-ambient.js'; * id: OfferId, * invitationSpec: import('./invitations.js').InvitationSpec, * proposal: Proposal, - * offerArgs?: unknown + * offerArgs?: any * }} OfferSpec */ From 8c9bdbc43de9e8c4fee686480d300364048c1dfc Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 25 Apr 2024 13:04:00 -0700 Subject: [PATCH 28/57] chore(types): unmarshallFromVstorage return any --- packages/internal/src/marshal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/internal/src/marshal.js b/packages/internal/src/marshal.js index fadbfc5d5359..a167cf0ea839 100644 --- a/packages/internal/src/marshal.js +++ b/packages/internal/src/marshal.js @@ -72,6 +72,7 @@ harden(assertCapData); * @param {string} key * @param {ReturnType['fromCapData']} fromCapData * @param {number} index index of the desired value in a deserialized stream cell + * @return {any} */ export const unmarshalFromVstorage = (data, key, fromCapData, index) => { const serialized = data.get(key) || Fail`no data for ${key}`; From 9a23b5dd22e61d1c8b1b0a80e612c63bc0730e76 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 26 Apr 2024 10:59:02 -0700 Subject: [PATCH 29/57] chore(types): alias Handle to RemotableObject --- packages/zoe/src/types-ambient.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/zoe/src/types-ambient.js b/packages/zoe/src/types-ambient.js index 653de401743d..dd640c506119 100644 --- a/packages/zoe/src/types-ambient.js +++ b/packages/zoe/src/types-ambient.js @@ -4,10 +4,7 @@ /** * @template {string} H - the name of the handle - * @typedef {H & import("@endo/marshal").Remotable} Handle A type constructor for an opaque type - * identified by the H string. This uses an intersection type - * ('MyHandle' & {}) to tag the handle's type even though the actual - * value is just an empty object. + * @typedef {import("@endo/marshal").RemotableObject} Handle Alias for RemotableObject */ /** From 4a9adc085eebd55ee96d9eb713810942766509c6 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 26 Apr 2024 11:13:28 -0700 Subject: [PATCH 30/57] chore(types): offerArgs any --- packages/smart-wallet/src/smartWallet.js | 2 +- .../swingsetTests/upgradeWalletFactory/walletFactory-V2.js | 1 + packages/smart-wallet/test/test-addAsset.js | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/smart-wallet/src/smartWallet.js b/packages/smart-wallet/src/smartWallet.js index 2926fb06da05..52d427dcedc2 100644 --- a/packages/smart-wallet/src/smartWallet.js +++ b/packages/smart-wallet/src/smartWallet.js @@ -62,7 +62,7 @@ const trace = makeTracer('SmrtWlt'); * id: OfferId, * invitationSpec: import('./invitations').InvitationSpec, * proposal: Proposal, - * offerArgs?: unknown + * offerArgs?: any * }} OfferSpec */ diff --git a/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/walletFactory-V2.js b/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/walletFactory-V2.js index b3282f9f38bf..a28040be2eda 100644 --- a/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/walletFactory-V2.js +++ b/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/walletFactory-V2.js @@ -27,6 +27,7 @@ export const prepare = async (zcf, privateArgs, baggage) => { const zoe = zcf.getZoeService(); const { storageNode, walletBridgeManager } = privateArgs; + /** @type {MapStore} */ const walletsByAddress = provideDurableMapStore(baggage, 'walletsByAddress'); const provider = makeAtomicProvider(walletsByAddress); diff --git a/packages/smart-wallet/test/test-addAsset.js b/packages/smart-wallet/test/test-addAsset.js index a9072c883b2c..0ba36801ba45 100644 --- a/packages/smart-wallet/test/test-addAsset.js +++ b/packages/smart-wallet/test/test-addAsset.js @@ -185,8 +185,9 @@ const makeScenario = t => { const uiBridge = Far('UIBridge', { /** @param {import('@endo/marshal').CapData} offerEncoding */ proposeOffer: async offerEncoding => { - /** @type {import('../src/offers.js').OfferSpec} */ - const offer = ctx.fromBoard.fromCapData(offerEncoding); + const offer = /** @type {import('../src/offers.js').OfferSpec} */ ( + ctx.fromBoard.fromCapData(offerEncoding) + ); const { give, want } = offer.proposal; for await (const [kw, amt] of entries({ ...give, ...want })) { // @ts-expect-error @@ -435,7 +436,6 @@ test.serial('trading in non-vbank asset: game real-estate NFTs', async t => { const { status: { id, result, payouts }, } = update; - // @ts-expect-error cast value to copyBag const names = payouts?.Places.value.payload.map(([name, _qty]) => name); t.log(id, 'result:', result, ', payouts:', names.join(', ')); From f3ef3b075e743d4b99d2d5c6b20ec8280da927d7 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 25 Apr 2024 10:03:54 -0700 Subject: [PATCH 31/57] chore(types): kmarshal --- packages/kmarshal/src/kmarshal.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/kmarshal/src/kmarshal.js b/packages/kmarshal/src/kmarshal.js index b72a204e4d0b..707daf6d828d 100644 --- a/packages/kmarshal/src/kmarshal.js +++ b/packages/kmarshal/src/kmarshal.js @@ -2,7 +2,10 @@ import { Far, passStyleOf } from '@endo/far'; import { makeMarshal } from '@endo/marshal'; import { assert, Fail } from '@agoric/assert'; -/** @import { ERef } from '@endo/far' */ +/** + * @import { ERef } from '@endo/far'; + * @import {ConvertSlotToVal} from '@endo/marshal'; + */ // Simple wrapper for serializing and unserializing marshalled values inside the // kernel, where we don't actually want to use clists nor actually allocate real @@ -98,9 +101,7 @@ export { makeStandinPromise }; harden(makeStandinPromise); /** - * @param {string} kref - * @param {string} [iface] - * @returns {ERef} + * @type {ConvertSlotToVal} */ export const kslot = (kref, iface = 'undefined') => { assert.typeof(kref, 'string'); From cc364ad1b4b7c3fffdcbab456912e345f6eb1ffd Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 25 Apr 2024 12:31:07 -0700 Subject: [PATCH 32/57] chore: deeplyFulfilledObject for better types --- packages/inter-protocol/src/provisionPoolKit.js | 5 +++-- .../test/vaultFactory/test-replacePriceAuthority.js | 10 +++++++--- .../test/vaultFactory/test-vaultFactory.js | 10 +++++++--- .../test/vaultFactory/test-vaultLiquidation.js | 10 +++++++--- packages/vats/src/nameHub.js | 4 ++-- 5 files changed, 26 insertions(+), 13 deletions(-) diff --git a/packages/inter-protocol/src/provisionPoolKit.js b/packages/inter-protocol/src/provisionPoolKit.js index 179c562b2818..768a4440e96a 100644 --- a/packages/inter-protocol/src/provisionPoolKit.js +++ b/packages/inter-protocol/src/provisionPoolKit.js @@ -1,5 +1,6 @@ // @ts-check import { AmountMath, BrandShape } from '@agoric/ertp'; +import { deeplyFulfilledObject } from '@agoric/internal'; import { UnguardedHelperI } from '@agoric/internal/src/typeGuards.js'; import { observeIteration, @@ -19,7 +20,7 @@ import { } from '@agoric/zoe/src/contractSupport/topics.js'; import { InstanceHandleShape } from '@agoric/zoe/src/typeGuards.js'; import { E } from '@endo/far'; -import { Far, deeplyFulfilled } from '@endo/marshal'; +import { Far } from '@endo/marshal'; const { details: X, quote: q, Fail } = assert; @@ -197,7 +198,7 @@ export const prepareProvisionPoolKit = ( namesByAddressAdmin, walletFactory, }); - const refs = await deeplyFulfilled(obj); + const refs = await deeplyFulfilledObject(obj); Object.assign(this.state, refs); }, makeHandler() { diff --git a/packages/inter-protocol/test/vaultFactory/test-replacePriceAuthority.js b/packages/inter-protocol/test/vaultFactory/test-replacePriceAuthority.js index f442a7818086..a960b9736875 100644 --- a/packages/inter-protocol/test/vaultFactory/test-replacePriceAuthority.js +++ b/packages/inter-protocol/test/vaultFactory/test-replacePriceAuthority.js @@ -2,13 +2,17 @@ import '@agoric/zoe/exported.js'; import { test as unknownTest } from '@agoric/zoe/tools/prepare-test-env-ava.js'; import { AmountMath, makeIssuerKit } from '@agoric/ertp'; -import { allValues, makeTracer, objectMap } from '@agoric/internal'; +import { + allValues, + deeplyFulfilledObject, + makeTracer, + objectMap, +} from '@agoric/internal'; import { unsafeMakeBundleCache } from '@agoric/swingset-vat/tools/bundleTool.js'; import { makeRatio } from '@agoric/zoe/src/contractSupport/index.js'; import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js'; import { buildManualTimer } from '@agoric/swingset-vat/tools/manual-timer.js'; import { E } from '@endo/eventual-send'; -import { deeplyFulfilled } from '@endo/marshal'; import { TimeMath } from '@agoric/time'; import { providePriceAuthorityRegistry } from '@agoric/vats/src/priceAuthorityRegistry.js'; import { makeScalarMapStore } from '@agoric/vat-data/src/index.js'; @@ -107,7 +111,7 @@ test.before(async t => { referencedUi: undefined, rates: defaultParamValues(run.brand), }; - const frozenCtx = await deeplyFulfilled(harden(contextPs)); + const frozenCtx = await deeplyFulfilledObject(harden(contextPs)); t.context = { ...frozenCtx, bundleCache, diff --git a/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js b/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js index 5ab027d7a214..9518797d5340 100644 --- a/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js +++ b/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js @@ -3,7 +3,12 @@ import { test as unknownTest } from '@agoric/zoe/tools/prepare-test-env-ava.js'; import { AmountMath, AssetKind, makeIssuerKit } from '@agoric/ertp'; import { combine, split } from '@agoric/ertp/src/legacy-payment-helpers.js'; -import { allValues, makeTracer, objectMap } from '@agoric/internal'; +import { + allValues, + deeplyFulfilledObject, + makeTracer, + objectMap, +} from '@agoric/internal'; import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js'; import { makeNotifierFromAsyncIterable } from '@agoric/notifier'; import { M, matches } from '@agoric/store'; @@ -21,7 +26,6 @@ import { makeManualPriceAuthority } from '@agoric/zoe/tools/manualPriceAuthority import { documentStorageSchema } from '@agoric/governance/tools/storageDoc.js'; import buildManualTimer from '@agoric/zoe/tools/manualTimer.js'; import { E } from '@endo/eventual-send'; -import { deeplyFulfilled } from '@endo/marshal'; import { calculateCurrentDebt } from '../../src/interest-math.js'; import { SECONDS_PER_YEAR } from '../../src/interest.js'; import { startVaultFactory } from '../../src/proposals/econ-behaviors.js'; @@ -116,7 +120,7 @@ test.before(async t => { referencedUi: undefined, rates: defaultParamValues(run.brand), }; - const frozenCtx = await deeplyFulfilled(harden(contextPs)); + const frozenCtx = await deeplyFulfilledObject(harden(contextPs)); t.context = { ...frozenCtx, bundleCache, diff --git a/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js b/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js index 16423355617c..466557881451 100644 --- a/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js +++ b/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js @@ -2,7 +2,12 @@ import '@agoric/zoe/exported.js'; import { test as unknownTest } from '@agoric/zoe/tools/prepare-test-env-ava.js'; import { AmountMath, makeIssuerKit } from '@agoric/ertp'; -import { allValues, makeTracer, objectMap } from '@agoric/internal'; +import { + allValues, + deeplyFulfilledObject, + makeTracer, + objectMap, +} from '@agoric/internal'; import { unsafeMakeBundleCache } from '@agoric/swingset-vat/tools/bundleTool.js'; import { ceilMultiplyBy, @@ -12,7 +17,6 @@ import { import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js'; import { buildManualTimer } from '@agoric/swingset-vat/tools/manual-timer.js'; import { E } from '@endo/eventual-send'; -import { deeplyFulfilled } from '@endo/marshal'; import { TimeMath } from '@agoric/time'; import { assertPayoutAmount } from '@agoric/zoe/test/zoeTestHelpers.js'; import { multiplyBy } from '@agoric/zoe/src/contractSupport/ratio.js'; @@ -112,7 +116,7 @@ test.before(async t => { referencedUi: undefined, rates: defaultParamValues(run.brand), }; - const frozenCtx = await deeplyFulfilled(harden(contextPs)); + const frozenCtx = await deeplyFulfilledObject(harden(contextPs)); t.context = { ...frozenCtx, bundleCache, diff --git a/packages/vats/src/nameHub.js b/packages/vats/src/nameHub.js index 7f767bc6b2f6..d93d449fb134 100644 --- a/packages/vats/src/nameHub.js +++ b/packages/vats/src/nameHub.js @@ -9,7 +9,7 @@ import { prepareGuardedAttenuator, } from '@agoric/internal/src/callback.js'; import { makeHeapZone } from '@agoric/zone'; -import { deeplyFulfilled } from '@endo/marshal'; +import { deeplyFulfilledObject } from '@agoric/internal'; const { Fail, quote: q } = assert; @@ -118,7 +118,7 @@ const updated = (updateCallback, hub, _newValue = undefined) => { } // wait for values to settle before writing - return E.when(deeplyFulfilled(hub.entries()), settledEntries => + return E.when(deeplyFulfilledObject(hub.entries()), settledEntries => E(updateCallback).write(settledEntries), ); }; From c73f4f9686215a37e8c5f82ce8dbe4742886a02b Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 25 Apr 2024 12:53:27 -0700 Subject: [PATCH 33/57] fix(types): board defer Key marshal --- packages/boot/tools/drivers.ts | 14 ++---- packages/inter-protocol/src/provisionPool.js | 4 +- packages/internal/src/lib-chainStorage.js | 7 ++- packages/notifier/src/stored-notifier.js | 3 +- packages/notifier/src/storesub.js | 2 +- packages/smart-wallet/src/marshal-contexts.js | 48 ++++++++++--------- .../src/collectionManager.js | 8 +++- .../src/virtualObjectManager.js | 5 +- packages/vat-data/src/vat-data-bindings.js | 1 + packages/vats/src/lib-board.js | 18 ++++--- 10 files changed, 63 insertions(+), 47 deletions(-) diff --git a/packages/boot/tools/drivers.ts b/packages/boot/tools/drivers.ts index b2464856d2d5..431edc437b3e 100644 --- a/packages/boot/tools/drivers.ts +++ b/packages/boot/tools/drivers.ts @@ -96,25 +96,21 @@ export const makeWalletFactoryDriver = async ( }, getCurrentWalletRecord(): CurrentWalletRecord { - const fromCapData = (...args) => - Reflect.apply(marshaller.fromCapData, marshaller, args); return unmarshalFromVstorage( storage.data, `published.wallet.${walletAddress}.current`, - fromCapData, + (...args) => Reflect.apply(marshaller.fromCapData, marshaller, args), -1, - ); + ) as any; }, getLatestUpdateRecord(): UpdateRecord { - const fromCapData = (...args) => - Reflect.apply(marshaller.fromCapData, marshaller, args); return unmarshalFromVstorage( storage.data, `published.wallet.${walletAddress}`, - fromCapData, + (...args) => Reflect.apply(marshaller.fromCapData, marshaller, args), -1, - ); + ) as any; }, }); @@ -286,7 +282,7 @@ export const makeGovernanceDriver = async ( const enactLatestProposal = async () => { const latestQuestionRecord = testKit.readLatest( 'published.committees.Economic_Committee.latestQuestion', - ); + ) as any; const chosenPositions = [latestQuestionRecord.positions[0]]; diff --git a/packages/inter-protocol/src/provisionPool.js b/packages/inter-protocol/src/provisionPool.js index 27a7622cf643..647aab72006e 100644 --- a/packages/inter-protocol/src/provisionPool.js +++ b/packages/inter-protocol/src/provisionPool.js @@ -14,6 +14,8 @@ import { prepareRecorderKitMakers } from '@agoric/zoe/src/contractSupport/record import { TopicsRecordShape } from '@agoric/zoe/src/contractSupport/topics.js'; import { prepareProvisionPoolKit } from './provisionPoolKit.js'; +/** @import {Marshal} from '@endo/marshal'; */ + /** @type {ContractMeta} */ export const meta = { privateArgsShape: M.splitRecord( @@ -45,7 +47,7 @@ harden(meta); * >; * initialPoserInvitation: Invitation; * storageNode: StorageNode; - * marshaller: Marshaller; + * marshaller: Marshal; * metricsOverride?: import('./provisionPoolKit.js').MetricsNotification; * }} privateArgs * @param {import('@agoric/vat-data').Baggage} baggage diff --git a/packages/internal/src/lib-chainStorage.js b/packages/internal/src/lib-chainStorage.js index 2591b1370c07..984a72c576eb 100644 --- a/packages/internal/src/lib-chainStorage.js +++ b/packages/internal/src/lib-chainStorage.js @@ -5,7 +5,10 @@ import { M } from '@endo/patterns'; import { makeHeapZone } from '@agoric/base-zone/heap.js'; import * as cb from './callback.js'; -/** @import { ERef } from '@endo/far' */ +/** + * @import {ERef} from '@endo/far'; + * @import {PassableCap} from '@endo/marshal'; + */ const { Fail } = assert; @@ -265,7 +268,7 @@ harden(makeStorageNodeChild); /** * @param {ERef} storageNode * @param {ERef} marshaller - * @returns {(value: unknown) => Promise} + * @returns {(value: PassableCap) => Promise} */ export const makeSerializeToStorage = (storageNode, marshaller) => { return async value => { diff --git a/packages/notifier/src/stored-notifier.js b/packages/notifier/src/stored-notifier.js index ef36fd952c47..0f434ed4789b 100644 --- a/packages/notifier/src/stored-notifier.js +++ b/packages/notifier/src/stored-notifier.js @@ -9,6 +9,7 @@ import { observeNotifier } from './asyncIterableAdaptor.js'; * @import {ERef} from '@endo/far'; * @import {BaseNotifier, Notifier} from './types.js'; * @import {Marshaller, StoredFacet, StorageNode, Unserializer} from '@agoric/internal/src/lib-chainStorage.js'; + * @import {PassableCap, RemotableObject} from '@endo/pass-style'; */ /** @@ -25,7 +26,7 @@ import { observeNotifier } from './asyncIterableAdaptor.js'; * the iteration themselves, or obtain information to subscribe to the stored * data out-of-band. * - * @template T + * @template {PassableCap} T * @param {ERef>} notifier * @param {ERef} storageNode * @param {ERef} marshaller diff --git a/packages/notifier/src/storesub.js b/packages/notifier/src/storesub.js index bed0f4e91854..bd9d8ba64a5f 100644 --- a/packages/notifier/src/storesub.js +++ b/packages/notifier/src/storesub.js @@ -44,7 +44,7 @@ export const forEachPublicationRecord = async (subscriber, consumeValue) => { * the iteration themselves, or obtain information to subscribe to the stored * data out-of-band. * - * @template T + * @template {import('@endo/marshal').PassableCap} T * @param {Subscriber} subscriber * @param {ERef} storageNode * @param {ERef>} marshaller diff --git a/packages/smart-wallet/src/marshal-contexts.js b/packages/smart-wallet/src/marshal-contexts.js index 475dd4515e55..588c97ddfda1 100644 --- a/packages/smart-wallet/src/marshal-contexts.js +++ b/packages/smart-wallet/src/marshal-contexts.js @@ -6,7 +6,11 @@ import { DEFAULT_PREFIX } from '@agoric/vats/src/lib-board.js'; const { Fail, quote: q } = assert; -/** @import {BoardId} from '@agoric/vats/src/lib-board.js' */ +/** + * @import {PassableCap} from '@endo/marshal'; + * @import {Key} from '@endo/patterns'; + * @import {BoardId} from '@agoric/vats/src/lib-board.js'; + */ /** * ID from a board made with { prefix: DEFAULT_PREFIX } @@ -79,8 +83,8 @@ const parseWalletSlot = (tables, slot) => { */ /** - * @template Slot - * @template Val + * @template {Key} Slot + * @template {PassableCap} Val * * @typedef {{ * bySlot: MapStore, @@ -89,9 +93,9 @@ const parseWalletSlot = (tables, slot) => { */ /** - * @template Slot - * @template Val - * @param {IdTable} table + * @template {Key} Slot + * @template {PassableCap} Val + * @param {IdTable} table * @param {Slot} slot * @param {Val} val */ @@ -126,13 +130,13 @@ export const makeExportContext = () => { byVal: makeScalarMapStore(), }, // TODO: offer, contact, dapp - /** @type {IdTable} */ + /** @type {IdTable} */ unknown: { bySlot: makeScalarMapStore(), byVal: makeScalarMapStore(), }, }; - /** @type {IdTable} */ + /** @type {IdTable} */ const boardObjects = { bySlot: makeScalarMapStore(), byVal: makeScalarMapStore(), @@ -161,7 +165,7 @@ export const makeExportContext = () => { let unknownNonce = 0; /** - * @param {unknown} val + * @param {PassableCap} val * @returns {MixedSlot} */ const valToSlot = val => { @@ -181,7 +185,7 @@ export const makeExportContext = () => { }; /** - * @template V + * @template {PassableCap} V * @param {string & keyof typeof walletObjects} kind * @param {IdTable} table */ @@ -208,14 +212,14 @@ export const makeExportContext = () => { purseEntries: walletObjects.purse.bySlot.entries, /** * @param {BoardId} id - * @param {unknown} val + * @param {PassableCap} val */ initBoardId: (id, val) => { initSlotVal(boardObjects, id, val); }, /** * @param {BoardId} id - * @param {unknown} val + * @param {PassableCap} val */ ensureBoardId: (id, val) => { if (boardObjects.byVal.has(val)) { @@ -238,35 +242,35 @@ const defaultMakePresence = iface => { * Make context for marshalling wallet or board data. * To be imported into the client, which never exports objects. * - * @param {(iface: string) => unknown} [makePresence] + * @param {(iface: string) => PassableCap} [makePresence] */ export const makeImportContext = (makePresence = defaultMakePresence) => { const walletObjects = { - /** @type {IdTable} */ + /** @type {IdTable} */ purse: { bySlot: makeScalarMapStore(), byVal: makeScalarMapStore(), }, - /** @type {IdTable} */ + /** @type {IdTable} */ payment: { bySlot: makeScalarMapStore(), byVal: makeScalarMapStore(), }, - /** @type {IdTable} */ + /** @type {IdTable} */ unknown: { bySlot: makeScalarMapStore(), byVal: makeScalarMapStore(), }, }; - /** @type {IdTable} */ + /** @type {IdTable} */ const boardObjects = { bySlot: makeScalarMapStore(), byVal: makeScalarMapStore(), }; /** - * @template Slot - * @template Val + * @template {Key} Slot + * @template {PassableCap} Val * @param {IdTable} table * @param {Slot} slot * @param {string} iface @@ -308,7 +312,7 @@ export const makeImportContext = (makePresence = defaultMakePresence) => { const valToSlot = { fromBoard: val => boardObjects.byVal.get(val), - /** @param {unknown} val */ + /** @param {PassableCap} val */ fromMyWallet: val => { const kind = findKey(walletObjects, k => walletObjects[k].byVal.has(val)); if (kind === undefined) { @@ -334,14 +338,14 @@ export const makeImportContext = (makePresence = defaultMakePresence) => { return harden({ /** * @param {BoardId} id - * @param {unknown} val + * @param {PassableCap} val */ initBoardId: (id, val) => { initSlotVal(boardObjects, id, val); }, /** * @param {BoardId} id - * @param {unknown} val + * @param {PassableCap} val */ ensureBoardId: (id, val) => { if (boardObjects.byVal.has(val)) { diff --git a/packages/swingset-liveslots/src/collectionManager.js b/packages/swingset-liveslots/src/collectionManager.js index 3fa8a245be81..178514988f8a 100644 --- a/packages/swingset-liveslots/src/collectionManager.js +++ b/packages/swingset-liveslots/src/collectionManager.js @@ -26,6 +26,10 @@ import { } from './vatstore-iterators.js'; import { makeCache } from './cache.js'; +/** + * @import {ToCapData, FromCapData} from '@endo/marshal'; + */ + // XXX TODO: The following key length limit was put in place due to limitations // in LMDB. With the move away from LMDB, it is no longer relevant, but I'm // leaving it in place for the time being as a general defensive measure against @@ -112,8 +116,8 @@ function makeSchemaCache(syscall, unserialize) { * @param {(val: any) => string | undefined} convertValToSlot * @param {*} convertSlotToVal * @param {*} registerValue - * @param {import('@endo/marshal').ToCapData} serialize - * @param {import('@endo/marshal').FromCapData} unserialize + * @param {ToCapData} serialize + * @param {FromCapData} unserialize * @param {(capDatas: any) => void} assertAcceptableSyscallCapdataSize */ export function makeCollectionManager( diff --git a/packages/swingset-liveslots/src/virtualObjectManager.js b/packages/swingset-liveslots/src/virtualObjectManager.js index 63b653c83544..3a349f483cc0 100644 --- a/packages/swingset-liveslots/src/virtualObjectManager.js +++ b/packages/swingset-liveslots/src/virtualObjectManager.js @@ -24,6 +24,7 @@ import { * @import {DurableKindHandle} from '@agoric/swingset-liveslots' * @import {DefineKindOptions} from '@agoric/swingset-liveslots' * @import {ClassContextProvider, KitContextProvider} from '@endo/exo' + * @import {ToCapData, FromCapData} from '@endo/marshal'; */ const { @@ -276,8 +277,8 @@ const insistSameCapData = (oldCD, newCD) => { * @param {(slot: string) => object} requiredValForSlot * @param {*} registerValue Function to register a new slot+value in liveSlot's * various tables - * @param {import('@endo/marshal').ToCapData} serialize Serializer for this vat - * @param {import('@endo/marshal').FromCapData} unserialize Unserializer for this vat + * @param {ToCapData} serialize Serializer for this vat + * @param {FromCapData} unserialize Unserializer for this vat * @param {*} assertAcceptableSyscallCapdataSize Function to check for oversized * syscall params * @param {import('./types.js').LiveSlotsOptions} [liveSlotsOptions] diff --git a/packages/vat-data/src/vat-data-bindings.js b/packages/vat-data/src/vat-data-bindings.js index 39e3b5b759af..2c2235d952d8 100644 --- a/packages/vat-data/src/vat-data-bindings.js +++ b/packages/vat-data/src/vat-data-bindings.js @@ -9,6 +9,7 @@ import { provideLazy } from '@agoric/store'; let VatDataGlobal; if ('VatData' in globalThis) { globalThis.VatData || Fail`VatData defined in global as null or undefined`; + // @ts-expect-error XXX VatDataGlobal = globalThis.VatData; } else { // XXX this module has been known to get imported (transitively) in cases that diff --git a/packages/vats/src/lib-board.js b/packages/vats/src/lib-board.js index 1e6551569868..16c70e708e97 100644 --- a/packages/vats/src/lib-board.js +++ b/packages/vats/src/lib-board.js @@ -15,7 +15,10 @@ import { makeMarshal } from '@endo/marshal'; import { crc6 } from './crc.js'; -/** @import {Key} from '@endo/patterns') */ +/** + * @import {PassableCap} from '@endo/marshal'; + * @import {Key} from '@endo/patterns'); + */ export const DEFAULT_CRC_DIGITS = 2; export const DEFAULT_PREFIX = 'board0'; @@ -99,13 +102,13 @@ const initDurableBoardState = ( const immutable = { prefix, crcDigits }; const lastSequence = BigInt(initSequence); - /** @type {MapStore} */ + /** @type {MapStore} */ const idToVal = makeScalarBigMapStore('idToVal', { durable: true, keyShape: IdShape, valueShape: ValShape, }); - /** @type {MapStore} */ + /** @type {MapStore} */ const valToId = makeScalarBigMapStore('valToId', { durable: true, keyShape: ValShape, @@ -127,7 +130,7 @@ const initDurableBoardState = ( // transient marshallers that get GCed when the function completes. /** - * @param {Key} value + * @param {PassableCap} value * @param {BoardState} state */ const getId = (value, state) => { @@ -185,7 +188,7 @@ const makeSlotToVal = state => { /** * @param {BoardId} slot * @param {string} iface - * @returns {unknown} + * @returns {any} */ const slotToVal = (slot, iface) => { if (slot !== null) { @@ -264,7 +267,7 @@ export const prepareBoardKit = baggage => { * `value` for its entire lifetime. For a well-known board, this is * essentially forever. * - * @param {Key} value + * @param {PassableCap} value * @throws if `value` is not a Key in the @agoric/store sense */ getId(value) { @@ -295,13 +298,14 @@ export const prepareBoardKit = baggage => { return board; } const [first, ...rest] = path; + /** @type {any} */ const firstValue = board.getValue(/** @type {BoardId} */ (first)); if (rest.length === 0) { return firstValue; } return E(firstValue).lookup(...rest); }, - /** @param {Key} val */ + /** @param {PassableCap} val */ has(val) { const { state } = this; return state.valToId.has(val); From 6110c6a544ec8a37de86d462c032611651f8e459 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 25 Apr 2024 12:32:26 -0700 Subject: [PATCH 34/57] feat(types): parameterize NameHub --- packages/vats/src/types.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/vats/src/types.d.ts b/packages/vats/src/types.d.ts index 1f33d7c65c22..8ee51fccf409 100644 --- a/packages/vats/src/types.d.ts +++ b/packages/vats/src/types.d.ts @@ -9,7 +9,7 @@ export type Board = ReturnType< * allow passing a remote iterable, there would be an inordinate number of round * trips for the contents of even the simplest nameHub. */ -export type NameHub = { +export type NameHub = { has: (key: string) => boolean; /** * Look up a path of keys starting from the current NameHub. Wait on any @@ -17,11 +17,11 @@ export type NameHub = { */ lookup: (...path: string[]) => Promise; /** get all the entries available in the current NameHub */ - entries: (includeReserved?: boolean) => [string, unknown][]; + entries: (includeReserved?: boolean) => [string, Value][]; /** get all names available in the current NameHub */ keys: () => string[]; /** get all values available in the current NameHub */ - values: () => unknown[]; + values: () => Value[]; }; /** write access to a node in a name hierarchy */ @@ -39,13 +39,13 @@ export type NameAdmin = { */ default: (key: string, newValue: T, newAdmin?: NameAdmin) => T; /** Update only if already initialized. Reject if not. */ - set: (key: string, newValue: unknown, newAdmin?: NameAdmin) => void; + set: (key: string, newValue: V, newAdmin?: NameAdmin) => void; /** * Fulfill an outstanding reserved promise (if any) to the newValue and set * the key to the newValue. If newAdmin is provided, set that to return via * lookupAdmin. */ - update: (key: string, newValue: unknown, newAdmin?: NameAdmin) => void; + update: (key: string, newValue: V, newAdmin?: NameAdmin) => void; /** * Look up the `newAdmin` from the path of keys starting from the current * NameAdmin. Wait on any reserved promises. @@ -59,7 +59,7 @@ export type NameAdmin = { }; export type NameHubUpdateHandler = { - write: (entries: [string, unknown][]) => void; + write: (entries: [string, V][]) => void; }; /** a node in a name hierarchy */ From 5ad2633cad41f2f57ad9db1080658fdf2ca32928 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 3 May 2024 12:05:04 -0700 Subject: [PATCH 35/57] chore(types): constrain makeEphemeraProvider --- packages/zoe/src/contractSupport/durability.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zoe/src/contractSupport/durability.js b/packages/zoe/src/contractSupport/durability.js index 644d54401d1c..878c5380765c 100644 --- a/packages/zoe/src/contractSupport/durability.js +++ b/packages/zoe/src/contractSupport/durability.js @@ -8,7 +8,7 @@ import { E } from '@endo/eventual-send'; * representative also remains. * * @template {{}} E Ephemeral state - * @template {{}} [K=any] key on which to provision + * @template {WeakKey} K key on which to provision * @param {(key: K) => E} init */ export const makeEphemeraProvider = init => { From 279b903a559710511d69f1614badddeab801b90d Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 3 May 2024 12:58:23 -0700 Subject: [PATCH 36/57] fix(types): template syntax --- packages/governance/src/types.js | 4 ++-- packages/inter-protocol/src/contractSupport.js | 4 ++-- packages/notifier/src/types.js | 2 +- packages/smart-wallet/src/marshal-contexts.js | 4 ++-- packages/swing-store/src/exporter.js | 4 ++-- packages/swing-store/src/snapStore.js | 3 +-- packages/vats/test/test-bootstrapPayment.js | 6 +----- 7 files changed, 11 insertions(+), 16 deletions(-) diff --git a/packages/governance/src/types.js b/packages/governance/src/types.js index 5d2671d87a1f..f909ee5b0042 100644 --- a/packages/governance/src/types.js +++ b/packages/governance/src/types.js @@ -61,7 +61,7 @@ export {}; /** * @template {ParamType} [T=ParamType] - * @typedef {{ type: T, value: ParamValueForType }} ParamValueTyped + * @typedef {{ type: T, value: ParamValueForType }} ParamValueTyped */ /** @@ -73,7 +73,7 @@ export {}; * governedParams: import('./contractGovernance/typedParamManager.js').ParamRecordsFromTypes - * }} GovernanceTerms + * }} GovernanceTerms */ /** diff --git a/packages/inter-protocol/src/contractSupport.js b/packages/inter-protocol/src/contractSupport.js index e007d1d47e20..3226ce8fddf9 100644 --- a/packages/inter-protocol/src/contractSupport.js +++ b/packages/inter-protocol/src/contractSupport.js @@ -79,14 +79,14 @@ export const checkDebtLimit = (debtLimit, totalDebt, toMint) => { /** * @template T - * @typedef {object} MetricsPublisherKit + * @typedef {object} MetricsPublisherKit * @property {IterationObserver} metricsPublication * @property {StoredSubscription} metricsSubscription */ /** * @template T - * @typedef {object} MetricsPublishKit + * @typedef {object} MetricsPublishKit * @property {Publisher} metricsPublisher * @property {StoredSubscriber} metricsSubscriber */ diff --git a/packages/notifier/src/types.js b/packages/notifier/src/types.js index 37c7c0e02bb1..7533439b6778 100644 --- a/packages/notifier/src/types.js +++ b/packages/notifier/src/types.js @@ -248,7 +248,7 @@ export {}; /** * @template T - * @typedef {object} NotifierRecord the produced notifier/updater pair + * @typedef {object} NotifierRecord the produced notifier/updater pair * @property {import('@endo/marshal').RemotableObject & IterationObserver} updater the (closely-held) notifier producer * @property {Notifier} notifier the (widely-held) notifier consumer */ diff --git a/packages/smart-wallet/src/marshal-contexts.js b/packages/smart-wallet/src/marshal-contexts.js index 588c97ddfda1..99789be72e4e 100644 --- a/packages/smart-wallet/src/marshal-contexts.js +++ b/packages/smart-wallet/src/marshal-contexts.js @@ -27,7 +27,7 @@ const isDefaultBoardId = specimen => { * using prefixes. * * @template {Record>} T - * @typedef {`${string & keyof T}:${Digits}`} WalletSlot + * @typedef {`${string & keyof T}:${Digits}`} WalletSlot */ /** * @template {string} K @@ -74,7 +74,7 @@ const parseWalletSlot = (tables, slot) => { * we an mix them without confusion. * * @template {Record>} T - * @typedef {WalletSlot | BoardId} MixedSlot + * @typedef {WalletSlot | BoardId} MixedSlot */ /** * @typedef {`1` | `12` | `123`} Digits - 1 or more digits. diff --git a/packages/swing-store/src/exporter.js b/packages/swing-store/src/exporter.js index 799877e7e663..0666c7240ec2 100644 --- a/packages/swing-store/src/exporter.js +++ b/packages/swing-store/src/exporter.js @@ -13,11 +13,11 @@ import { validateArtifactMode } from './internal.js'; /** * @template T - * @typedef { Iterable | AsyncIterable } AnyIterable + * @typedef { Iterable | AsyncIterable } AnyIterable */ /** * @template T - * @typedef { IterableIterator | AsyncIterableIterator } AnyIterableIterator + * @typedef { IterableIterator | AsyncIterableIterator } AnyIterableIterator */ /** diff --git a/packages/swing-store/src/snapStore.js b/packages/swing-store/src/snapStore.js index 3d1ac29f7434..3d67ad503b89 100644 --- a/packages/swing-store/src/snapStore.js +++ b/packages/swing-store/src/snapStore.js @@ -25,8 +25,7 @@ import { buffer } from './util.js'; */ /** - * @template T - * @typedef { import('./exporter.js').AnyIterableIterator } AnyIterableIterator + * @import {AnyIterableIterator} from './exporter.js' */ /** diff --git a/packages/vats/test/test-bootstrapPayment.js b/packages/vats/test/test-bootstrapPayment.js index e3555282816a..b59f636df001 100644 --- a/packages/vats/test/test-bootstrapPayment.js +++ b/packages/vats/test/test-bootstrapPayment.js @@ -10,11 +10,7 @@ import { claim } from '@agoric/ertp/src/legacy-payment-helpers.js'; import centralSupplyBundle from '../bundles/bundle-centralSupply.js'; import { feeIssuerConfig } from '../src/core/utils.js'; -/** - * @template T @typedef - * {import('@agoric/zoe/src/zoeService/utils.js').Installation} - * Installation - */ +/** @import {Installation} from '@agoric/zoe/src/zoeService/utils.js' */ /** * @typedef {import('ava').ExecutionContext<{ * zoe: ZoeService; From 314783822c257e4b0dab90c0f29b24b2e116ba37 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Mon, 29 Apr 2024 11:38:09 -0700 Subject: [PATCH 37/57] docs: correct Brand issuer caveat --- packages/ERTP/src/types.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ERTP/src/types.js b/packages/ERTP/src/types.js index 90607ccef177..d192706d7347 100644 --- a/packages/ERTP/src/types.js +++ b/packages/ERTP/src/types.js @@ -136,8 +136,8 @@ export {}; * asset described. The alleged name (such as 'BTC' or 'moola') is provided by * the maker of the issuer and should not be trusted as accurate. * - * Every amount created by a particular AmountMath will share the same brand, - * but recipients cannot rely on the brand to verify that a purported amount + * Every amount created by a particular issuer will share the same brand, but + * recipients cannot rely on the brand to verify that a purported amount * represents the issuer they intended, since the same brand can be reused by * a misbehaving issuer. */ From 649956afec6dedd4285c6e27260d657445e09057 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Mon, 29 Apr 2024 12:04:19 -0700 Subject: [PATCH 38/57] fix(types): Zoe startInstance --- packages/ERTP/src/amountMath.js | 2 ++ packages/zoe/src/zoeService/startInstance.js | 10 +++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/ERTP/src/amountMath.js b/packages/ERTP/src/amountMath.js index 1e8ffc190a5e..a6e362ba045e 100644 --- a/packages/ERTP/src/amountMath.js +++ b/packages/ERTP/src/amountMath.js @@ -194,6 +194,8 @@ const isGTE = (leftAmount, rightAmount, brand = undefined) => { * the abstract right to participate in a particular exchange. */ const AmountMath = { + // TODO use overloading to handle when Brand has an AssetKind and when it doesn't. + // a AmountForValue utility could help DRY those cases. /** * Make an amount from a value by adding the brand. * diff --git a/packages/zoe/src/zoeService/startInstance.js b/packages/zoe/src/zoeService/startInstance.js index cd88e6801e60..d18869da1307 100644 --- a/packages/zoe/src/zoeService/startInstance.js +++ b/packages/zoe/src/zoeService/startInstance.js @@ -275,16 +275,12 @@ export const makeStartInstance = ( ); /** - * - * @param {Promise} installationP - * @param {IssuerKeywordRecord} uncleanIssuerKeywordRecord - * @param {unknown} customTerms - * @param {unknown} privateArgs - * @param {string} instanceLabel + * @type {import('./utils.js').StartInstance} */ const startInstance = async ( installationP, uncleanIssuerKeywordRecord = harden({}), + // @ts-expect-error FIXME may not match the expected terms of SF customTerms = harden({}), privateArgs = undefined, instanceLabel = '', @@ -364,6 +360,7 @@ export const makeStartInstance = ( // creatorInvitation can be undefined, but if it is defined, // let's make sure it is an invitation. + // @ts-expect-error cast return E.when( Promise.all([ creatorInvitationP, @@ -392,6 +389,5 @@ export const makeStartInstance = ( }, ); }; - // @ts-expect-error cast return harden(startInstance); }; From 0b2609ce164e2b62b4d4544a53547efe62bc0619 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 2 May 2024 14:45:45 -0700 Subject: [PATCH 39/57] build: force source-map version --- packages/xsnap-lockdown/package.json | 3 ++- yarn.lock | 22 +++++----------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/packages/xsnap-lockdown/package.json b/packages/xsnap-lockdown/package.json index 891e539c5609..679a311369c4 100644 --- a/packages/xsnap-lockdown/package.json +++ b/packages/xsnap-lockdown/package.json @@ -25,7 +25,8 @@ "ava": "^5.3.0", "c8": "^9.1.0", "rollup": "^2.58.0", - "rollup-plugin-string": "^3.0.0" + "rollup-plugin-string": "^3.0.0", + "source-map": "^0.7.4" }, "files": [ "LICENSE*", diff --git a/yarn.lock b/yarn.lock index a06fdbccfadd..003c84e0dc57 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8732,10 +8732,10 @@ minimatch@5.1.0: dependencies: brace-expansion "^2.0.1" -"minimatch@6 || 7 || 8 || 9", minimatch@^9.0.1, minimatch@^9.0.3: - version "9.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" - integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== +"minimatch@6 || 7 || 8 || 9", minimatch@^9.0.1, minimatch@^9.0.3, minimatch@^9.0.4: + version "9.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.4.tgz#8e49c731d1749cbec05050ee5145147b32496a51" + integrity sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw== dependencies: brace-expansion "^2.0.1" @@ -8753,13 +8753,6 @@ minimatch@^5.0.1: dependencies: brace-expansion "^2.0.1" -minimatch@^9.0.4: - version "9.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.4.tgz#8e49c731d1749cbec05050ee5145147b32496a51" - integrity sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw== - dependencies: - brace-expansion "^2.0.1" - minimist-options@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" @@ -11366,12 +11359,7 @@ triple-beam@^1.3.0: resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.4.1.tgz#6fde70271dc6e5d73ca0c3b24e2d92afb7441984" integrity sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg== -ts-api-utils@^1.0.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.2.1.tgz#f716c7e027494629485b21c0df6180f4d08f5e8b" - integrity sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA== - -ts-api-utils@^1.3.0: +ts-api-utils@^1.0.1, ts-api-utils@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== From a417c55222a53f964557bbbdfc1eec669bcf9e65 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 24 Apr 2024 17:13:53 -0700 Subject: [PATCH 40/57] chore(types): remotable objects --- packages/SwingSet/src/vats/timer/vat-timer.js | 11 +++++--- packages/store/src/stores/scalarMapStore.js | 2 +- .../store/src/stores/scalarWeakMapStore.js | 4 +-- packages/zoe/src/zoeService/utils.d.ts | 26 +++++++++---------- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/packages/SwingSet/src/vats/timer/vat-timer.js b/packages/SwingSet/src/vats/timer/vat-timer.js index 9dfb411c62f5..6f449c9aec35 100644 --- a/packages/SwingSet/src/vats/timer/vat-timer.js +++ b/packages/SwingSet/src/vats/timer/vat-timer.js @@ -15,6 +15,11 @@ import { import { makeScalarWeakMapStore } from '@agoric/store'; import { TimeMath } from '@agoric/time'; +/** + * @import {Passable, RemotableObject} from '@endo/pass-style') + * @import {Key} from '@endo/patterns') + */ + // This consumes O(N) RAM only for outstanding promises, via wakeAt(), // delay(), and Notifiers/Iterators (for each actively-waiting // client). Everything else should remain in the DB. @@ -31,10 +36,10 @@ import { TimeMath } from '@agoric/time'; * Handler is a user-provided Far object with .wake(time) used for callbacks * @property {(scheduled: Timestamp) => unknown} wake * - * @typedef {unknown} CancelToken + * @typedef {Key} CancelToken * CancelToken must be pass-by-reference and durable, either local or remote * - * @typedef {{ + * @typedef {RemotableObject & { * scheduleYourself: () => void, * fired: (now: TimestampValue) => void, * cancel: () => void, @@ -42,7 +47,7 @@ import { TimeMath } from '@agoric/time'; * * @typedef {MapStore} Schedule * - * @typedef {{ cancel: () => void }} Cancellable + * @typedef {RemotableObject & { cancel: () => void }} Cancellable * * @typedef {WeakMapStore} CancelTable * diff --git a/packages/store/src/stores/scalarMapStore.js b/packages/store/src/stores/scalarMapStore.js index 2c88f652af10..6847800b33c3 100644 --- a/packages/store/src/stores/scalarMapStore.js +++ b/packages/store/src/stores/scalarMapStore.js @@ -135,7 +135,7 @@ export const makeMapStoreMethods = ( * * @param {string} [tag] - the column name for the key * @param {StoreOptions} [options] - * @returns {RemotableObject & MapStore} + * @returns {MapStore} */ export const makeScalarMapStore = ( tag = 'key', diff --git a/packages/store/src/stores/scalarWeakMapStore.js b/packages/store/src/stores/scalarWeakMapStore.js index 640abffa04f5..6bf46df0cbc6 100644 --- a/packages/store/src/stores/scalarWeakMapStore.js +++ b/packages/store/src/stores/scalarWeakMapStore.js @@ -8,7 +8,7 @@ import { /** * @import {Key} from '@endo/patterns'; - * @import {Passable} from '@endo/pass-style'; + * @import {Passable, RemotableObject} from '@endo/pass-style'; * @import {WeakMapStore, StoreOptions} from '../types.js'; */ @@ -102,7 +102,7 @@ export const makeWeakMapStoreMethods = ( * @template K,V * @param {string} [tag] - tag for debugging * @param {StoreOptions} [options] - * @returns {WeakMapStore} + * @returns {RemotableObject & WeakMapStore} */ export const makeScalarWeakMapStore = ( tag = 'key', diff --git a/packages/zoe/src/zoeService/utils.d.ts b/packages/zoe/src/zoeService/utils.d.ts index 3e3c2d9833c5..395b47714dde 100644 --- a/packages/zoe/src/zoeService/utils.d.ts +++ b/packages/zoe/src/zoeService/utils.d.ts @@ -3,6 +3,7 @@ import type { Tagged } from '@agoric/internal/src/tagged.js'; import type { Callable } from '@agoric/internal/src/utils.js'; import type { Baggage } from '@agoric/swingset-liveslots'; import type { VatUpgradeResults } from '@agoric/swingset-vat'; +import type { RemotableObject } from '@endo/marshal'; // XXX https://github.com/Agoric/agoric-sdk/issues/4565 type SourceBundle = Record; @@ -14,19 +15,18 @@ type ContractFacet = { /** * Installation of a contract, typed by its start function. */ -export type Installation = Tagged< - { - getBundle: () => SourceBundle; - getBundleLabel: () => string; - }, - 'StartFunction', - SF ->; -export type Instance = Tagged< - Handle<'Instance'>, - 'StartFunction', - SF ->; +export type Installation = + RemotableObject & + Tagged< + { + getBundle: () => SourceBundle; + getBundleLabel: () => string; + }, + 'StartFunction', + SF + >; +export type Instance = + RemotableObject & Tagged, 'StartFunction', SF>; export type InstallationStart = I extends Installation ? SF : never; From b53d99b708c39cdf4ec2872eee6bee9117e2335d Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 24 Apr 2024 16:41:50 -0700 Subject: [PATCH 41/57] chore(types): IssuerKit --- packages/inter-protocol/src/auction/auctioneer.js | 2 +- packages/inter-protocol/src/price/fluxAggregatorContract.js | 1 + packages/inter-protocol/src/price/roundsManager.js | 2 +- packages/inter-protocol/src/proposals/add-auction.js | 6 +++++- packages/inter-protocol/src/proposals/startPSM.js | 2 ++ .../test/vaultFactory/test-replacePriceAuthority.js | 2 ++ packages/inter-protocol/test/vaultFactory/test-storage.js | 1 - .../inter-protocol/test/vaultFactory/test-vaultFactory.js | 2 ++ .../test/vaultFactory/test-vaultLiquidation.js | 2 ++ packages/vats/src/types.d.ts | 2 ++ packages/vats/src/vat-bank.js | 4 ++-- packages/vats/tools/bank-utils.js | 2 +- packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js | 3 ++- 13 files changed, 23 insertions(+), 8 deletions(-) diff --git a/packages/inter-protocol/src/auction/auctioneer.js b/packages/inter-protocol/src/auction/auctioneer.js index 8807b00f5a16..88ace013d94e 100644 --- a/packages/inter-protocol/src/auction/auctioneer.js +++ b/packages/inter-protocol/src/auction/auctioneer.js @@ -693,7 +693,7 @@ export const start = async (zcf, privateArgs, baggage) => { const creatorFacet = makeFarGovernorFacet( Far('Auctioneer creatorFacet', { /** - * @param {Issuer} issuer + * @param {Issuer<'nat'>} issuer * @param {Keyword} kwd */ async addBrand(issuer, kwd) { diff --git a/packages/inter-protocol/src/price/fluxAggregatorContract.js b/packages/inter-protocol/src/price/fluxAggregatorContract.js index 3f06800d3e79..0eb968edd2b4 100644 --- a/packages/inter-protocol/src/price/fluxAggregatorContract.js +++ b/packages/inter-protocol/src/price/fluxAggregatorContract.js @@ -67,6 +67,7 @@ export const start = async (zcf, privateArgs, baggage) => { // xxx uses contract baggage as issuerBagage, assumes one issuer in this contract /** @type {import('./roundsManager.js').QuoteKit} */ + // @ts-expect-error cast const quoteIssuerKit = prepareIssuerKit( baggage, 'quote', diff --git a/packages/inter-protocol/src/price/roundsManager.js b/packages/inter-protocol/src/price/roundsManager.js index 2d4c1256824a..f9436c7b77fa 100644 --- a/packages/inter-protocol/src/price/roundsManager.js +++ b/packages/inter-protocol/src/price/roundsManager.js @@ -62,7 +62,7 @@ const validRoundId = roundId => { * @property {number} roundTimeout */ -/** @typedef {IssuerKit<'set'>} QuoteKit */ +/** @typedef {IssuerKit<'set', PriceDescription>} QuoteKit */ /** * @typedef {Readonly< diff --git a/packages/inter-protocol/src/proposals/add-auction.js b/packages/inter-protocol/src/proposals/add-auction.js index 1eafb2e747f3..7616e8aac566 100644 --- a/packages/inter-protocol/src/proposals/add-auction.js +++ b/packages/inter-protocol/src/proposals/add-auction.js @@ -121,11 +121,15 @@ export const addAuction = async ({ const { Bid: _istIssuer, ...auctionIssuers } = allIssuers; await Promise.all( Object.keys(auctionIssuers).map(kwd => - E(governedCreatorFacet).addBrand(auctionIssuers[kwd], kwd), + E(governedCreatorFacet).addBrand( + /** @type {Issuer<'nat'>} */ (auctionIssuers[kwd]), + kwd, + ), ), ); newAuctioneerKit.resolve( + // @ts-expect-error XXX governance types harden({ label: 'auctioneer', creatorFacet: governedCreatorFacet, diff --git a/packages/inter-protocol/src/proposals/startPSM.js b/packages/inter-protocol/src/proposals/startPSM.js index a13e38efc0fa..121813acf99e 100644 --- a/packages/inter-protocol/src/proposals/startPSM.js +++ b/packages/inter-protocol/src/proposals/startPSM.js @@ -363,6 +363,7 @@ export const makeAnchorAsset = async ( const brand = await E(issuer).getBrand(); const kit = harden({ mint, issuer, brand }); + // @ts-expect-error XXX AssetIssuerKit testFirstAnchorKit.resolve(kit); const toSlotReviver = makeHistoryReviver( @@ -397,6 +398,7 @@ export const makeAnchorAsset = async ( denom, keyword, proposedName, + // @ts-expect-error XXX AssetIssuerKit kit, // with mint ), ]); diff --git a/packages/inter-protocol/test/vaultFactory/test-replacePriceAuthority.js b/packages/inter-protocol/test/vaultFactory/test-replacePriceAuthority.js index a960b9736875..53f04b6bbfc2 100644 --- a/packages/inter-protocol/test/vaultFactory/test-replacePriceAuthority.js +++ b/packages/inter-protocol/test/vaultFactory/test-replacePriceAuthority.js @@ -115,7 +115,9 @@ test.before(async t => { t.context = { ...frozenCtx, bundleCache, + // @ts-expect-error XXX AssetIssuerKit aeth, + // @ts-expect-error XXX AssetIssuerKit run, }; trace(t, 'CONTEXT'); diff --git a/packages/inter-protocol/test/vaultFactory/test-storage.js b/packages/inter-protocol/test/vaultFactory/test-storage.js index 0235c60d91cb..a5f579afeaf7 100644 --- a/packages/inter-protocol/test/vaultFactory/test-storage.js +++ b/packages/inter-protocol/test/vaultFactory/test-storage.js @@ -147,7 +147,6 @@ test('quotes storage', async t => { quoteValue.amountIn.value, quoteValue.amountOut.value / quoteValue.amountIn.value, ); - // @ts-expect-error thinks the left argument is Number t.is(quoteValue.amountOut.value / quoteValue.amountIn.value, highPrice); }); diff --git a/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js b/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js index 9518797d5340..6852667f7374 100644 --- a/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js +++ b/packages/inter-protocol/test/vaultFactory/test-vaultFactory.js @@ -124,7 +124,9 @@ test.before(async t => { t.context = { ...frozenCtx, bundleCache, + // @ts-expect-error XXX AssetIssuerKit aeth, + // @ts-expect-error XXX AssetIssuerKit run, }; trace(t, 'CONTEXT'); diff --git a/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js b/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js index 466557881451..45cf37a1bf8e 100644 --- a/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js +++ b/packages/inter-protocol/test/vaultFactory/test-vaultLiquidation.js @@ -120,7 +120,9 @@ test.before(async t => { t.context = { ...frozenCtx, bundleCache, + // @ts-expect-error XXX AssetIssuerKit aeth, + // @ts-expect-error XXX AssetIssuerKit run, }; trace(t, 'CONTEXT'); diff --git a/packages/vats/src/types.d.ts b/packages/vats/src/types.d.ts index 8ee51fccf409..465fc541d326 100644 --- a/packages/vats/src/types.d.ts +++ b/packages/vats/src/types.d.ts @@ -1,3 +1,5 @@ +import type { Guarded } from '@endo/exo'; + export type Board = ReturnType< ReturnType >['board']; diff --git a/packages/vats/src/vat-bank.js b/packages/vats/src/vat-bank.js index f81ad6640e6c..ce22cef1bca3 100644 --- a/packages/vats/src/vat-bank.js +++ b/packages/vats/src/vat-bank.js @@ -348,8 +348,8 @@ const prepareAssetSubscription = zone => { /** * @template {AssetKind} [K=AssetKind] * @typedef {object} AssetIssuerKit - * @property {ERef>} [mint] - * @property {ERef>} issuer + * @property {Mint} [mint] + * @property {Issuer} issuer * @property {Brand} brand */ diff --git a/packages/vats/tools/bank-utils.js b/packages/vats/tools/bank-utils.js index 13a0047b78c6..b0d95423262c 100644 --- a/packages/vats/tools/bank-utils.js +++ b/packages/vats/tools/bank-utils.js @@ -5,7 +5,7 @@ import { Far } from '@endo/marshal'; /** @param {Pick[]} issuerKits */ export const makeFakeBankKit = issuerKits => { - /** @type {MapStore>} */ + /** @type {MapStore} */ const issuers = makeScalarMapStore(); /** * @type {MapStore< diff --git a/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js b/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js index e31feb903472..f17718e5add2 100644 --- a/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js +++ b/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js @@ -11,6 +11,8 @@ export const provideQuoteMint = baggage => { baggage, 'quoteMintIssuerBaggage', ); + /** @type {IssuerKit<'set', PriceDescription>} */ + // @ts-expect-error cast const issuerKit = prepareIssuerKit( issuerBaggage, 'quote', @@ -19,6 +21,5 @@ export const provideQuoteMint = baggage => { undefined, { recoverySetsOption: 'noRecoverySets' }, ); - // @ts-expect-error checked cast return issuerKit.mint; }; From b70765cbae25261be5944f5836d8b4b7ae58fca7 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 26 Apr 2024 11:00:59 -0700 Subject: [PATCH 42/57] fix(types): misc --- packages/inter-protocol/src/proposals/core-proposal.js | 2 +- packages/smart-wallet/src/invitations.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/inter-protocol/src/proposals/core-proposal.js b/packages/inter-protocol/src/proposals/core-proposal.js index 11c476629e94..ba31357f616d 100644 --- a/packages/inter-protocol/src/proposals/core-proposal.js +++ b/packages/inter-protocol/src/proposals/core-proposal.js @@ -27,7 +27,7 @@ export const storeInterContractStartKits = async ({ }, }) => { /** - * @param {Promise>} storeP + * @param {Promise>} storeP * @param {Promise<{ instance: Instance }>[]} kitPs */ const storeAll = async (storeP, kitPs) => { diff --git a/packages/smart-wallet/src/invitations.js b/packages/smart-wallet/src/invitations.js index 6920b7a3e5c8..729686f67188 100644 --- a/packages/smart-wallet/src/invitations.js +++ b/packages/smart-wallet/src/invitations.js @@ -103,7 +103,6 @@ export const makeInvitationsHelper = ( mustMatch(spec, shape.PurseInvitationSpec); const { instance, description } = spec; - // @ts-expect-error TS thinks it's always true. I'm doubtful. (instance && description) || Fail`missing instance or description`; const purseAmount = await E(invitationsPurse).getCurrentAmount(); const invitations = AmountMath.getValue(invitationBrand, purseAmount); From 3eeffaa241f18105bf71fc1559a8e006529d654e Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Fri, 26 Apr 2024 14:19:25 -0700 Subject: [PATCH 43/57] fix(types): durable wrapping non-durable --- packages/pegasus/src/contract.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/pegasus/src/contract.js b/packages/pegasus/src/contract.js index d8d08b72ca11..8f4d84ef4a80 100644 --- a/packages/pegasus/src/contract.js +++ b/packages/pegasus/src/contract.js @@ -1,3 +1,4 @@ +// @ts-check import { prepareVowTools } from '@agoric/vow/vat.js'; import { makeDurableZone } from '@agoric/zone/durable.js'; import { makePegasus } from './pegasus.js'; @@ -8,8 +9,8 @@ import '../exported.js'; /** * @type {ContractStartFn, - * namesByAddress: ERef + * board: Remote, + * namesByAddress: Remote * }>} */ export const start = (zcf, privateArgs, baggage) => { @@ -23,10 +24,12 @@ export const start = (zcf, privateArgs, baggage) => { // start requires that the object passed in must be durable. Given that we // haven't made pegasus durable yet, we'll wrap its non-durable methods within // an exo object to workaround this requirement. + // @ts-expect-error makePegasus returns a remotable object const publicFacet = zone.exo('PublicFacet', undefined, { ...makePegasus({ zcf, board, namesByAddress, when }), }); + // @ts-expect-error XXX durable wrapping non-durable return harden({ publicFacet, }); From 1749514b5b69a3112d60293ffc141885e4ff2edd Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 25 Apr 2024 11:33:15 -0700 Subject: [PATCH 44/57] chore(types): suppress deferals --- packages/SwingSet/misc-tools/classify-promises.js | 1 + packages/SwingSet/src/controller/initializeKernel.js | 1 + packages/SwingSet/src/devices/bundle/device-bundle.js | 1 + .../SwingSet/src/devices/vat-admin/device-vat-admin.js | 7 +++++++ packages/SwingSet/test/devices/device-raw-0.js | 1 + packages/governance/src/contractGovernance/paramManager.js | 4 ++-- packages/inter-protocol/src/auction/sortedOffers.js | 1 + packages/inter-protocol/src/econCommitteeCharter.js | 1 + packages/inter-protocol/src/proposals/econ-behaviors.js | 4 ++++ packages/inter-protocol/src/provisionPool.js | 1 + packages/inter-protocol/src/vaultFactory/vaultHolder.js | 1 + packages/inter-protocol/src/vaultFactory/vaultManager.js | 2 ++ .../test/swingsetTests/psmUpgrade/bootstrap-psm-upgrade.js | 2 ++ .../reserve/bootstrap-assetReserve-upgrade.js | 1 + packages/notifier/test/iterable-testing-tools.js | 4 ++-- packages/orchestration/src/exos/localchainAccountKit.js | 1 + packages/orchestration/src/exos/stakingAccountKit.js | 1 + packages/vats/src/core/startWalletFactory.js | 2 ++ packages/vats/src/core/utils.js | 1 + packages/vats/src/virtual-purse.js | 1 + packages/vats/test/test-bootstrapPayment.js | 1 + packages/vats/test/test-clientBundle.js | 1 + packages/vats/test/test-vat-bank-integration.js | 2 ++ packages/wallet/api/src/lib-wallet.js | 1 + packages/zoe/src/contractFacet/offerHandlerStorage.js | 5 +++++ 25 files changed, 44 insertions(+), 4 deletions(-) diff --git a/packages/SwingSet/misc-tools/classify-promises.js b/packages/SwingSet/misc-tools/classify-promises.js index 63bafaaf998b..410d2b9dbd89 100755 --- a/packages/SwingSet/misc-tools/classify-promises.js +++ b/packages/SwingSet/misc-tools/classify-promises.js @@ -1,4 +1,5 @@ #!/usr/bin/env node +// @ts-nocheck XXX /* eslint no-labels: "off", no-extra-label: "off", no-underscore-dangle: "off" */ import process from 'process'; import sqlite3 from 'better-sqlite3'; diff --git a/packages/SwingSet/src/controller/initializeKernel.js b/packages/SwingSet/src/controller/initializeKernel.js index 67552acf6299..3378a28c39f9 100644 --- a/packages/SwingSet/src/controller/initializeKernel.js +++ b/packages/SwingSet/src/controller/initializeKernel.js @@ -212,6 +212,7 @@ export async function initializeKernel(config, kernelStorage, options = {}) { // See https://github.com/Agoric/agoric-sdk/issues/2780 errorIdNum: 60_000, }); + // @ts-expect-error xxx const args = kunser(m.serialize(harden([vatObj0s, deviceObj0s]))); const rootKref = exportRootObject(kernelKeeper, bootstrapVatID); const resultKpid = queueToKref(rootKref, 'bootstrap', args, 'panic'); diff --git a/packages/SwingSet/src/devices/bundle/device-bundle.js b/packages/SwingSet/src/devices/bundle/device-bundle.js index d4038c9d935f..1b3dfa74d77d 100644 --- a/packages/SwingSet/src/devices/bundle/device-bundle.js +++ b/packages/SwingSet/src/devices/bundle/device-bundle.js @@ -103,6 +103,7 @@ export function buildDevice(tools, endowments) { const dispatch = { invoke: (dnid, method, argsCapdata) => { + /** @type {any} */ const args = unserialize(argsCapdata); if (dnid === ROOT) { diff --git a/packages/SwingSet/src/devices/vat-admin/device-vat-admin.js b/packages/SwingSet/src/devices/vat-admin/device-vat-admin.js index 59e9d583852d..3aec158d0994 100644 --- a/packages/SwingSet/src/devices/vat-admin/device-vat-admin.js +++ b/packages/SwingSet/src/devices/vat-admin/device-vat-admin.js @@ -156,6 +156,7 @@ export function buildDevice(tools, endowments) { // D(devices.vatAdmin).createMeter(remaining, threshold) -> meterID if (method === 'createMeter') { + /** @type {any} */ const args = unserialize(argsCapdata); const [remaining, threshold] = args; assert.typeof(remaining, 'bigint', 'createMeter() remaining'); @@ -172,6 +173,7 @@ export function buildDevice(tools, endowments) { // D(devices.vatAdmin).addMeterRemaining(meterID, delta) if (method === 'addMeterRemaining') { + /** @type {any} */ const args = unserialize(argsCapdata); const [meterID, delta] = args; assert.typeof(meterID, 'string', 'addMeterRemaining() meterID'); @@ -182,6 +184,7 @@ export function buildDevice(tools, endowments) { // D(devices.vatAdmin).setMeterThreshold(meterID, threshold) if (method === 'setMeterThreshold') { + /** @type {any} */ const args = unserialize(argsCapdata); const [meterID, threshold] = args; assert.typeof(meterID, 'string', 'setMeterThreshold() meterID'); @@ -192,6 +195,7 @@ export function buildDevice(tools, endowments) { // D(devices.vatAdmin).getMeter(meterID) -> { remaining, threshold } if (method === 'getMeter') { + /** @type {any} */ const args = unserialize(argsCapdata); const [meterID] = args; assert.typeof(meterID, 'string', 'getMeter() meterID'); @@ -265,6 +269,7 @@ export function buildDevice(tools, endowments) { // D(devices.bundle).getBundleCap(id) -> bundlecap if (method === 'getBundleCap') { const args = unserialize(argsCapdata); + /** @type {any} */ const [bundleID] = args; assert.typeof(bundleID, 'string', 'getBundleCap() bundleID'); assert(bundleIDRE.test(bundleID), 'getBundleCap() not a bundleID'); @@ -273,6 +278,7 @@ export function buildDevice(tools, endowments) { // D(devices.bundle).getNamedBundleCap(name) -> bundlecap if (method === 'getNamedBundleCap') { const args = unserialize(argsCapdata); + /** @type {any} */ const [name] = args; assert.typeof(name, 'string', 'getNamedBundleCap() name'); let bundleID; @@ -287,6 +293,7 @@ export function buildDevice(tools, endowments) { // D(devices.bundle).getBundleIDByName(name) -> id if (method === 'getBundleIDByName') { const args = unserialize(argsCapdata); + /** @type {any} */ const [name] = args; assert.typeof(name, 'string', 'getBundleIDByName() name'); let bundleID; diff --git a/packages/SwingSet/test/devices/device-raw-0.js b/packages/SwingSet/test/devices/device-raw-0.js index 63e673f3dd39..d4e1ff1021bb 100644 --- a/packages/SwingSet/test/devices/device-raw-0.js +++ b/packages/SwingSet/test/devices/device-raw-0.js @@ -17,6 +17,7 @@ export function buildDevice(tools, endowments) { const dispatch = { invoke: (dnid, method, argsCapdata) => { + /** @type {any} */ const args = unserialize(argsCapdata); if (dnid === ROOT) { diff --git a/packages/governance/src/contractGovernance/paramManager.js b/packages/governance/src/contractGovernance/paramManager.js index ed96f7cb3df2..b9cca051cb55 100644 --- a/packages/governance/src/contractGovernance/paramManager.js +++ b/packages/governance/src/contractGovernance/paramManager.js @@ -49,7 +49,7 @@ const assertElectorateMatches = (paramManager, governedParams) => { * @property {(name: string, value: Invitation) => ParamManagerBuilder} addInvitation * @property {(name: string, value: bigint) => ParamManagerBuilder} addNat * @property {(name: string, value: Ratio) => ParamManagerBuilder} addRatio - * @property {(name: string, value: import('@endo/marshal').CopyRecord) => ParamManagerBuilder} addRecord + * @property {(name: string, value: import('@endo/marshal').CopyRecord) => ParamManagerBuilder} addRecord * @property {(name: string, value: string) => ParamManagerBuilder} addString * @property {(name: string, value: import('@agoric/time').Timestamp) => ParamManagerBuilder} addTimestamp * @property {(name: string, value: import('@agoric/time').RelativeTime) => ParamManagerBuilder} addRelativeTime @@ -184,7 +184,7 @@ const makeParamManagerBuilder = (publisherKit, zoe) => { return builder; }; - /** @type {(name: string, value: import('@endo/marshal').CopyRecord, builder: ParamManagerBuilder) => ParamManagerBuilder} */ + /** @type {(name: string, value: import('@endo/marshal').CopyRecord, builder: ParamManagerBuilder) => ParamManagerBuilder} */ const addRecord = (name, value, builder) => { const assertRecord = v => { passStyleOf(v); diff --git a/packages/inter-protocol/src/auction/sortedOffers.js b/packages/inter-protocol/src/auction/sortedOffers.js index 031c73e3ebef..f1d0e211d492 100644 --- a/packages/inter-protocol/src/auction/sortedOffers.js +++ b/packages/inter-protocol/src/auction/sortedOffers.js @@ -88,6 +88,7 @@ const bidScalingRatioFromKey = (bidScaleFloat, numBrand, useDecimals) => { * @returns {[normalizedPrice: Ratio, sequenceNumber: bigint]} */ export const fromPriceOfferKey = (key, numBrand, denomBrand, useDecimals) => { + // @ts-expect-error XXX const [pricePart, sequenceNumberPart] = decodeData(key); return [ priceRatioFromFloat(pricePart, numBrand, denomBrand, useDecimals), diff --git a/packages/inter-protocol/src/econCommitteeCharter.js b/packages/inter-protocol/src/econCommitteeCharter.js index e0ff71923935..6fc146cb167d 100644 --- a/packages/inter-protocol/src/econCommitteeCharter.js +++ b/packages/inter-protocol/src/econCommitteeCharter.js @@ -79,6 +79,7 @@ export const start = async (zcf, privateArgs, baggage) => { const governor = instanceToGovernor.get(instance); return E(governor).voteOnParamChanges(counter, deadline, { ...path, + // @ts-expect-error XXX changes: params, }); }; diff --git a/packages/inter-protocol/src/proposals/econ-behaviors.js b/packages/inter-protocol/src/proposals/econ-behaviors.js index c5fec37281f1..c3fbff712bd8 100644 --- a/packages/inter-protocol/src/proposals/econ-behaviors.js +++ b/packages/inter-protocol/src/proposals/econ-behaviors.js @@ -166,6 +166,7 @@ export const setupReserve = async ({ ]); reserveKit.resolve( + // @ts-expect-error XXX harden({ label: 'AssetReserve', instance, @@ -350,6 +351,7 @@ export const startVaultFactory = async ( ); vaultFactoryKit.resolve( + // @ts-expect-error XXX harden({ label: 'VaultFactory', creatorFacet: vaultFactoryCreator, @@ -465,6 +467,7 @@ export const startRewardDistributor = async ({ const instanceKit = await E(zoe).startInstance( feeDistributor, { Fee: centralIssuer }, + // @ts-expect-error XXX feeDistributorTerms, undefined, 'feeDistributor', @@ -623,6 +626,7 @@ export const startAuctioneer = async ( ]); auctioneerKit.resolve( + // @ts-expect-error XXX harden({ label: 'auctioneer', creatorFacet: governedCreatorFacet, diff --git a/packages/inter-protocol/src/provisionPool.js b/packages/inter-protocol/src/provisionPool.js index 647aab72006e..7eb37c61dd1d 100644 --- a/packages/inter-protocol/src/provisionPool.js +++ b/packages/inter-protocol/src/provisionPool.js @@ -86,6 +86,7 @@ export const start = async (zcf, privateArgs, baggage) => { makeProvisionPoolKit({ // XXX governance can change the brand of the amount but should only be able to change the value // NB: changing the brand will break this pool + // @ts-expect-error XXX Brand AssetKind poolBrand: params.getPerAccountInitialAmount().brand, storageNode: privateArgs.storageNode, }), diff --git a/packages/inter-protocol/src/vaultFactory/vaultHolder.js b/packages/inter-protocol/src/vaultFactory/vaultHolder.js index 9552d27857fd..c4a4acd49b73 100644 --- a/packages/inter-protocol/src/vaultFactory/vaultHolder.js +++ b/packages/inter-protocol/src/vaultFactory/vaultHolder.js @@ -52,6 +52,7 @@ export const prepareVaultHolder = (baggage, makeRecorderKit) => { */ (vault, storageNode) => { // must be the fully synchronous maker because the kit is held in durable state + // @ts-expect-error XXX Patterns const topicKit = makeRecorderKit(storageNode, PUBLIC_TOPICS.vault[1]); return { topicKit, vault }; diff --git a/packages/inter-protocol/src/vaultFactory/vaultManager.js b/packages/inter-protocol/src/vaultFactory/vaultManager.js index fbbde1eb5426..c3f74b98bb0e 100644 --- a/packages/inter-protocol/src/vaultFactory/vaultManager.js +++ b/packages/inter-protocol/src/vaultFactory/vaultManager.js @@ -439,7 +439,9 @@ export const prepareVaultManagerKit = ( collateralUnit, debtBrand, ); + // @ts-expect-error XXX quotes ephemera.storedQuotesNotifier = makeStoredNotifier( + // @ts-expect-error XXX quotes quoteNotifier, E(storageNode).makeChildNode('quotes'), marshaller, diff --git a/packages/inter-protocol/test/swingsetTests/psmUpgrade/bootstrap-psm-upgrade.js b/packages/inter-protocol/test/swingsetTests/psmUpgrade/bootstrap-psm-upgrade.js index e3a2d4c9e87f..3cb5c471c3d0 100644 --- a/packages/inter-protocol/test/swingsetTests/psmUpgrade/bootstrap-psm-upgrade.js +++ b/packages/inter-protocol/test/swingsetTests/psmUpgrade/bootstrap-psm-upgrade.js @@ -131,6 +131,7 @@ export const buildRootObject = async () => { * @param {any} devices */ bootstrap: async (vats, devices) => { + // @ts-expect-error XXX adminNode vatAdmin = await E(vats.vatAdmin).createVatAdminService(devices.vatAdmin); ({ feeMintAccess, zoeService } = await E(vats.zoe).buildZoe( vatAdmin, @@ -215,6 +216,7 @@ export const buildRootObject = async () => { governorFacets = await E(zoeService).startInstance( NonNullish(installations.puppetContractGovernor), undefined, + // @ts-expect-error XXX timer governorTerms, { governed: { diff --git a/packages/inter-protocol/test/swingsetTests/reserve/bootstrap-assetReserve-upgrade.js b/packages/inter-protocol/test/swingsetTests/reserve/bootstrap-assetReserve-upgrade.js index c6f00c8655a9..fce40bbd8203 100644 --- a/packages/inter-protocol/test/swingsetTests/reserve/bootstrap-assetReserve-upgrade.js +++ b/packages/inter-protocol/test/swingsetTests/reserve/bootstrap-assetReserve-upgrade.js @@ -188,6 +188,7 @@ export const buildRootObject = async () => { governorFacets = await E(zoeService).startInstance( NonNullish(installations.puppetContractGovernor), undefined, + // @ts-expect-error XXX timer governorTerms, { governed: { diff --git a/packages/notifier/test/iterable-testing-tools.js b/packages/notifier/test/iterable-testing-tools.js index 6849cd807046..1f74a720fa74 100644 --- a/packages/notifier/test/iterable-testing-tools.js +++ b/packages/notifier/test/iterable-testing-tools.js @@ -65,7 +65,7 @@ const refReason = Error('bar'); * * @param {boolean} fails Does the returned async iterable finish successfully * or fail? - * @returns {AsyncIterable} + * @returns {AsyncIterable} */ const makeTestIterable = fails => { return harden({ @@ -251,7 +251,7 @@ export const paula = iterationObserver => { * See the Alice example in the README * * @param {AsyncIterable} asyncIterable - * @returns {Promise} + * @returns {Promise} */ export const alice = async asyncIterable => { const log = []; diff --git a/packages/orchestration/src/exos/localchainAccountKit.js b/packages/orchestration/src/exos/localchainAccountKit.js index 7a023a96844f..37c71421b7eb 100644 --- a/packages/orchestration/src/exos/localchainAccountKit.js +++ b/packages/orchestration/src/exos/localchainAccountKit.js @@ -61,6 +61,7 @@ export const prepareLocalchainAccountKit = (baggage, makeRecorderKit, zcf) => { */ (account, storageNode) => { // must be the fully synchronous maker because the kit is held in durable state + // @ts-expect-error XXX Patterns const topicKit = makeRecorderKit(storageNode, PUBLIC_TOPICS.account[1]); return { account, topicKit }; diff --git a/packages/orchestration/src/exos/stakingAccountKit.js b/packages/orchestration/src/exos/stakingAccountKit.js index ba0096e496a6..c32f492fcc31 100644 --- a/packages/orchestration/src/exos/stakingAccountKit.js +++ b/packages/orchestration/src/exos/stakingAccountKit.js @@ -117,6 +117,7 @@ export const prepareStakingAccountKit = (baggage, makeRecorderKit, zcf) => { */ (account, storageNode, chainAddress, icqConnection, bondDenom) => { // must be the fully synchronous maker because the kit is held in durable state + // @ts-expect-error XXX Patterns const topicKit = makeRecorderKit(storageNode, PUBLIC_TOPICS.account[1]); return { account, chainAddress, topicKit, icqConnection, bondDenom }; diff --git a/packages/vats/src/core/startWalletFactory.js b/packages/vats/src/core/startWalletFactory.js index 9b04c34227d0..a2dd87df3425 100644 --- a/packages/vats/src/core/startWalletFactory.js +++ b/packages/vats/src/core/startWalletFactory.js @@ -154,10 +154,12 @@ export const startWalletFactory = async ( slotToBoardRemote, ); + /** @type {() => any} */ const reviveOldMetrics = () => { if (!dataReviver.has(OLD_POOL_METRICS_STORAGE_PATH)) { return undefined; } + /** @type {any} */ const oldPoolMetrics = dataReviver.getItem(OLD_POOL_METRICS_STORAGE_PATH); const newBrandFromOldSlotID = makeMap([ [oldPoolMetrics.totalMintedProvided.brand.getBoardId(), feeBrand], diff --git a/packages/vats/src/core/utils.js b/packages/vats/src/core/utils.js index 4256abf1d130..69b7484cc266 100644 --- a/packages/vats/src/core/utils.js +++ b/packages/vats/src/core/utils.js @@ -362,6 +362,7 @@ export const makeVatSpace = ( { get: (_target, name, _rx) => { assert.typeof(name, 'string'); + // @ts-expect-error XXX return provideAsync(name, createVatByName).then(vat => { if (!durableStore.has(name)) { durableStore.init(name, vat); diff --git a/packages/vats/src/virtual-purse.js b/packages/vats/src/virtual-purse.js index 8f7e1c97fd41..34064e1acfe6 100644 --- a/packages/vats/src/virtual-purse.js +++ b/packages/vats/src/virtual-purse.js @@ -303,6 +303,7 @@ export const prepareVirtualPurse = zone => { recoveryPurse, escrowPurse, }).purse; + // @ts-expect-error XXX return vpurse; }; diff --git a/packages/vats/test/test-bootstrapPayment.js b/packages/vats/test/test-bootstrapPayment.js index b59f636df001..efc1081e5123 100644 --- a/packages/vats/test/test-bootstrapPayment.js +++ b/packages/vats/test/test-bootstrapPayment.js @@ -40,6 +40,7 @@ test.before(async (/** @type {CentralSupplyTestContext} */ t) => { }; t.context = await deeplyFulfilled( + // @ts-expect-error XXX harden({ zoe, feeMintAccess: feeMintAccessP, diff --git a/packages/vats/test/test-clientBundle.js b/packages/vats/test/test-clientBundle.js index fcc066c55c12..e44fb8a58780 100644 --- a/packages/vats/test/test-clientBundle.js +++ b/packages/vats/test/test-clientBundle.js @@ -45,6 +45,7 @@ test('connectFaucet produces payments', async t => { const { zoe, feeMintAccessP, vatAdminSvc } = await setUpZoeForTest({ feeIssuerConfig, + // @ts-expect-error XXX vatAdminSvc: makePopulatedFakeVatAdmin().vatAdminService, }); produce.zoe.resolve(zoe); diff --git a/packages/vats/test/test-vat-bank-integration.js b/packages/vats/test/test-vat-bank-integration.js index 1ef20aa8ef5d..d8f6fcce5848 100644 --- a/packages/vats/test/test-vat-bank-integration.js +++ b/packages/vats/test/test-vat-bank-integration.js @@ -34,9 +34,11 @@ test('mintInitialSupply, addBankAssets bootstrap actions', async t => { produce.agoricNamesAdmin.resolve(agoricNamesAdmin); const { vatAdminService } = makePopulatedFakeVatAdmin(); + // @ts-expect-error XXX const { zoeService, feeMintAccess: fma } = makeZoeKitForTest(vatAdminService); produce.zoe.resolve(zoeService); produce.feeMintAccess.resolve(fma); + // @ts-expect-error XXX produce.vatAdminSvc.resolve(vatAdminService); await installBootContracts({ consume, diff --git a/packages/wallet/api/src/lib-wallet.js b/packages/wallet/api/src/lib-wallet.js index d94f12623978..fd0947ea11a9 100644 --- a/packages/wallet/api/src/lib-wallet.js +++ b/packages/wallet/api/src/lib-wallet.js @@ -754,6 +754,7 @@ export function makeWalletRoot({ * @param {string} [address] */ const addContact = async (petname, actions, address = undefined) => { + // @ts-expect-error XXX ERef const already = await E(board).has(actions); let depositFacet; if (already) { diff --git a/packages/zoe/src/contractFacet/offerHandlerStorage.js b/packages/zoe/src/contractFacet/offerHandlerStorage.js index f874a56cba0d..26ff65aaff15 100644 --- a/packages/zoe/src/contractFacet/offerHandlerStorage.js +++ b/packages/zoe/src/contractFacet/offerHandlerStorage.js @@ -6,6 +6,11 @@ import { canBeDurable, provideDurableWeakMapStore } from '@agoric/vat-data'; import { defineDurableHandle } from '../makeHandle.js'; +/** + * @import {RemotableBrand} from '@endo/eventual-send'; + * @import {RemotableObject} from '@endo/pass-style'; + */ + /** * @typedef {RemotableBrand & RemotableObject & OfferHandler} PassableOfferHandler */ From 41866a1fd89cb412b08cd6c97deea6165a168845 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 25 Apr 2024 11:43:50 -0700 Subject: [PATCH 45/57] chore(types): remotables --- packages/network/src/types.js | 15 ++++++++++++--- packages/vow/src/types.js | 5 +++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/network/src/types.js b/packages/network/src/types.js index 204a8a4fcaf5..e056672bc5aa 100644 --- a/packages/network/src/types.js +++ b/packages/network/src/types.js @@ -3,7 +3,10 @@ // Ensure this is a module. export {}; -/** @import {PromiseVow, Remote} from '@agoric/vow' */ +/** + * @import {Passable, RemotableObject} from '@endo/pass-style'; + * @import {PromiseVow, Remote} from '@agoric/vow'; + */ /** * @template {import('@endo/exo').Methods} M @@ -22,9 +25,12 @@ export {}; */ /** - * @typedef {object} Closable A closable object + * @typedef {object} ClosableI A closable object * @property {() => PromiseVow} close Terminate the object */ +/** + * @typedef {RemotableObject & ClosableI} Closable + */ /** * @typedef {object} Protocol The network Protocol @@ -73,7 +79,7 @@ export {}; */ /** - * @typedef {object} Connection + * @typedef {object} ConnectionI * @property {( * packetBytes: Bytes, * opts?: Record, @@ -84,6 +90,9 @@ export {}; * connection * @property {() => Endpoint} getRemoteAddress Get the name of the counterparty */ +/** + * @typedef {RemotableObject & ConnectionI} Connection + */ /** * @typedef {object} ConnectionHandler A handler for a given Connection diff --git a/packages/vow/src/types.js b/packages/vow/src/types.js index a13b8b9b2503..ac7a94bcf56f 100644 --- a/packages/vow/src/types.js +++ b/packages/vow/src/types.js @@ -4,9 +4,10 @@ export {}; /** * @import {RemotableBrand} from '@endo/eventual-send' * @import {CopyTagged} from '@endo/pass-style' + * @import {RemotableObject} from '@endo/pass-style'; + * @import {PromiseVow, Remote} from '@agoric/vow'; * @import {prepareVowTools} from './tools.js' */ - /** @typedef {(...args: any[]) => any} Callable */ /** @@ -82,7 +83,7 @@ export {}; /** * @template [T=any] * @typedef {object} VowPayload - * @property {Remote>} vowV0 + * @property {RemotableObject & Remote>} vowV0 */ /** From 0b2e7e1664c3fd2c0c5790448dd49bb396924417 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 25 Apr 2024 12:01:58 -0700 Subject: [PATCH 46/57] chore(types): adopt Passable --- packages/cache/src/cache.js | 8 ++++++-- packages/cache/src/store.js | 11 ++++++----- .../src/contractGovernance/governApi.js | 5 +++-- .../src/contractGovernance/governParam.js | 1 + packages/governance/src/contractGovernorKit.js | 3 ++- packages/governance/src/types.js | 16 ++++++++++------ .../test/unitTests/test-typedParamManager.js | 2 ++ .../governance/tools/puppetContractGovernor.js | 3 ++- 8 files changed, 32 insertions(+), 17 deletions(-) diff --git a/packages/cache/src/cache.js b/packages/cache/src/cache.js index 1788745a74f5..19412f782617 100644 --- a/packages/cache/src/cache.js +++ b/packages/cache/src/cache.js @@ -4,9 +4,13 @@ import { E, Far } from '@endo/far'; import { makeScalarStoreCoordinator } from './store.js'; +/** + * @import {Passable, RemotableObject} from '@endo/pass-style'; + */ + /** * @typedef {{ [x: PropertyKey]: any } | string | symbol | bigint | null | - * undefined | number | ((oldValue: any) => ERef)} Update a `newValue` + * undefined | number | ((oldValue: any) => ERef)} Update a `newValue` * to update to. If a function, then it should take an oldValue and return a * `newValue` or promise for `newValue` */ @@ -19,7 +23,7 @@ export const makeCache = (coordinator = makeScalarStoreCoordinator()) => { * The ground state for a cache key value is `undefined`. It is impossible to * distinguish a set value of `undefined` from an unset key * - * @param {unknown} key the cache key (any key type acceptable to the cache) + * @param {Passable} key the cache key (any key type acceptable to the cache) * @param {[] | [Update] | [Update, Pattern]} optUpdateGuardPattern an optional */ const cache = (key, ...optUpdateGuardPattern) => { diff --git a/packages/cache/src/store.js b/packages/cache/src/store.js index 1619641d27cc..b3700a284e99 100644 --- a/packages/cache/src/store.js +++ b/packages/cache/src/store.js @@ -7,7 +7,7 @@ import { withGroundState, makeState } from './state.js'; /** @import {Passable} from '@endo/pass-style' */ /** - * @param {(obj: unknown) => unknown} [sanitize] + * @param {(obj: Passable) => Passable} [sanitize] * @returns {(key: Passable) => Promise} */ const makeKeyToString = (sanitize = obj => obj) => { @@ -36,16 +36,16 @@ const makeKeyToString = (sanitize = obj => obj) => { /** * @param {string} keyStr - * @param {(oldValue: unknown) => unknown} txn + * @param {(oldValue: Passable) => Passable} txn * @param {Pattern} guardPattern - * @param {(obj: unknown) => unknown} sanitize Process keys and values with + * @param {(obj: Passable) => Passable} sanitize Process keys and values with * this function before storing them * @param {{ * get(key: string): import('./state.js').State; * set(key: string, value: import('./state.js').State): void; * init(key: string, value: import('./state.js').State): void; * }} stateStore - * @returns {Promise} the value of the updated state + * @returns {Promise} the value of the updated state */ const applyCacheTransaction = async ( keyStr, @@ -112,6 +112,7 @@ const applyCacheTransaction = async ( * @returns {Promise} */ const stringifyStateStore = async (stateStore, marshaller) => { + /** @type {Passable} */ const obj = {}; for (const [key, value] of stateStore.entries()) { obj[key] = E(marshaller).toCapData(value); @@ -126,7 +127,7 @@ const stringifyStateStore = async (stateStore, marshaller) => { * currently enforce any cache eviction, but that would be a useful feature. * * @param {MapStore} [stateStore] - * @param {(obj: unknown) => unknown} [sanitize] Process keys and values with + * @param {(obj: Passable) => Passable} [sanitize] Process keys and values with * this function before storing them. Defaults to deeplyFulfilled. */ export const makeScalarStoreCoordinator = ( diff --git a/packages/governance/src/contractGovernance/governApi.js b/packages/governance/src/contractGovernance/governApi.js index 386e89e801e7..e13debafc73a 100644 --- a/packages/governance/src/contractGovernance/governApi.js +++ b/packages/governance/src/contractGovernance/governApi.js @@ -10,6 +10,7 @@ import { } from '../question.js'; /** + * @import {Passable, RemotableObject} from '@endo/pass-style'; * @import {Position, ApiGovernor, ApiInvocationIssue, PoserFacet, VoteOnApiInvocation} from '../types.js'; */ @@ -21,7 +22,7 @@ const { Fail, quote: q } = assert; * arguments that were provided. * * @param {string} apiMethodName - * @param {unknown[]} methodArgs + * @param {Passable[]} methodArgs */ const makeApiInvocationPositions = (apiMethodName, methodArgs) => { const positive = harden({ apiMethodName, methodArgs }); @@ -32,7 +33,7 @@ const makeApiInvocationPositions = (apiMethodName, methodArgs) => { /** * manage contracts that allow governance to invoke functions. * - * @param {ERef<{ [methodName: string]: (...args: any) => unknown }>} governedApis + * @param {ERef<{ [methodName: string]: (...args: any) => Passable }>} governedApis * @param {Array} governedNames names of the governed API methods * @param {ERef} timer * @param {() => Promise} getUpdatedPoserFacet diff --git a/packages/governance/src/contractGovernance/governParam.js b/packages/governance/src/contractGovernance/governParam.js index f06c7d4bb194..789a441d32a3 100644 --- a/packages/governance/src/contractGovernance/governParam.js +++ b/packages/governance/src/contractGovernance/governParam.js @@ -78,6 +78,7 @@ const setupParamGovernance = ( paramSpec, ) => { const paramMgr = await E(paramManagerRetriever).get(paramSpec.paramPath); + /** @type {import('@endo/marshal').Passable} */ const changePs = {}; for (const name of Object.keys(paramSpec.changes)) { const proposedValue = E(paramMgr).getVisibleValue( diff --git a/packages/governance/src/contractGovernorKit.js b/packages/governance/src/contractGovernorKit.js index 3bdf7e7bf6a4..b7b6abe8e5b6 100644 --- a/packages/governance/src/contractGovernorKit.js +++ b/packages/governance/src/contractGovernorKit.js @@ -129,7 +129,8 @@ export const prepareContractGovernorKit = (baggage, powers) => { ]); trace('setupApiGovernance'); apiGovernance = governedNames.length - ? setupApiGovernance(governedApis, governedNames, timer, () => + ? // @ts-expect-error FIXME + setupApiGovernance(governedApis, governedNames, timer, () => this.facets.helper.getUpdatedPoserFacet(), ) : { diff --git a/packages/governance/src/types.js b/packages/governance/src/types.js index f909ee5b0042..3a3f0b531a10 100644 --- a/packages/governance/src/types.js +++ b/packages/governance/src/types.js @@ -1,6 +1,10 @@ export {}; -/** @import {ContractStartFunction} from '@agoric/zoe/src/zoeService/utils.js' */ +/** + * @import {Guarded} from '@endo/exo'; + * @import {Passable, Container} from '@endo/pass-style'; + * @import {ContractStartFunction} from '@agoric/zoe/src/zoeService/utils.js'; + */ /** * @typedef { 'unranked' | 'order' | 'plurality' } ChoiceMethod @@ -34,9 +38,9 @@ export {}; */ /** - * @typedef { Amount | Brand | Installation | Instance | bigint | + * @typedef { Amount | Brand | Installation | Instance | number | bigint | * Ratio | string | import('@agoric/time').TimestampRecord | - * import('@agoric/time').RelativeTimeRecord | unknown } ParamValue + * import('@agoric/time').RelativeTimeRecord | Container } ParamValue */ // XXX better to use the manifest constant ParamTypes @@ -484,7 +488,7 @@ export {}; /** * @typedef {object} ChangeParamsPosition - * @property {Record} changes one or more changes to parameters + * @property {Record} changes one or more changes to parameters */ /** @@ -500,7 +504,7 @@ export {}; /** * @typedef {object} InvokeApiPosition * @property {string} apiMethodName - * @property {unknown[]} methodArgs + * @property {Passable[]} methodArgs */ /** @@ -625,7 +629,7 @@ export {}; /** * @callback VoteOnApiInvocation * @param {string} apiMethodName - * @param {unknown[]} methodArgs + * @param {Passable[]} methodArgs * @param {Installation} voteCounterInstallation * @param {import('@agoric/time').Timestamp} deadline * @returns {Promise} diff --git a/packages/governance/test/unitTests/test-typedParamManager.js b/packages/governance/test/unitTests/test-typedParamManager.js index 505d826acfa8..a4ef53487db7 100644 --- a/packages/governance/test/unitTests/test-typedParamManager.js +++ b/packages/governance/test/unitTests/test-typedParamManager.js @@ -228,6 +228,7 @@ test('Invitation', async t => { const { instance, zcf, zoe } = await setupZCFTest(issuerKeywordRecord, terms); + /** @type {Invitation} */ const invitation = await E(E(zoe).getPublicFacet(instance)).makeInvitation(); const invitationAmount = await E(E(zoe).getInvitationIssuer()).getAmountOf( @@ -251,6 +252,7 @@ test('Invitation', async t => { await eventLoopIteration(); const invitationActualAmount = paramManager.getInvite().value; t.deepEqual(invitationActualAmount, invitationAmount.value); + // @ts-expect-error XXX t.is(invitationActualAmount[0].description, 'simple'); t.is(await paramManager.getInternalParamValue('Invite'), invitation); diff --git a/packages/governance/tools/puppetContractGovernor.js b/packages/governance/tools/puppetContractGovernor.js index 3f6db072a1d4..d4edd79883b4 100644 --- a/packages/governance/tools/puppetContractGovernor.js +++ b/packages/governance/tools/puppetContractGovernor.js @@ -7,6 +7,7 @@ import { CONTRACT_ELECTORATE } from '../src/contractGovernance/governParam.js'; import { makeApiInvocationPositions } from '../src/contractGovernance/governApi.js'; /** + * @import {Passable, RemotableObject} from '@endo/pass-style'; * @import {GovernableStartFn, ParamChangesSpec} from '../src/types.js'; */ @@ -72,7 +73,7 @@ export const start = async (zcf, privateArgs) => { /** * @param {string} apiMethodName - * @param {unknown[]} methodArgs + * @param {Passable[]} methodArgs */ const invokeAPI = async (apiMethodName, methodArgs) => { const governedNames = await E(governedCF).getGovernedApiNames(); From 8e51b1e469a9947de71a3f450b40490866014907 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 24 Apr 2024 17:42:16 -0700 Subject: [PATCH 47/57] chore(types): adapt to new coverage --- packages/SwingSet/src/types-external.js | 9 +++++--- packages/agoric-cli/src/lib/format.js | 2 ++ packages/base-zone/src/types.js | 6 ++--- packages/governance/src/types.js | 2 +- .../inter-protocol/src/provisionPoolKit.js | 1 - packages/pegasus/src/contract.js | 4 ++++ packages/smart-wallet/src/smartWallet.js | 1 - packages/smart-wallet/test/contexts.js | 1 - .../test/test-marshal-contexts.js | 12 ++++++---- packages/solo/src/pipe-entrypoint.js | 1 + packages/solo/src/pipe.js | 1 + packages/telemetry/src/slog-to-otel.js | 5 ++++- packages/vat-data/src/vat-data-bindings.js | 4 ++-- packages/vats/src/core/basic-behaviors.js | 3 +++ packages/vats/src/types.d.ts | 4 ++-- packages/vats/src/vat-bank.js | 22 ++++++++++++++----- packages/vats/test/test-bootstrapPayment.js | 1 - packages/vats/test/test-lib-board.js | 1 + packages/wallet/api/src/lib-wallet.js | 1 + .../priceAuthorityQuoteMint.js | 5 +++++ .../priceAuthorityTransform.js | 4 ++-- packages/zoe/src/zoeService/utils.d.ts | 2 +- packages/zoe/tools/types.js | 2 +- 23 files changed, 65 insertions(+), 29 deletions(-) diff --git a/packages/SwingSet/src/types-external.js b/packages/SwingSet/src/types-external.js index b27d225eacb7..7b45acfa86ca 100644 --- a/packages/SwingSet/src/types-external.js +++ b/packages/SwingSet/src/types-external.js @@ -2,6 +2,11 @@ export {}; +/** + * @import {Guarded} from '@endo/exo') + * @import {Passable, RemotableObject} from '@endo/pass-style') + */ + /* This file defines types that part of the external API of swingset. That * includes standard services which user-provided vat code might interact * with, like VatAdminService. */ @@ -350,9 +355,7 @@ export {}; * incarnation. * * - * @typedef {object} CreateVatResults - * @property {object} root - * @property {VatAdminFacet} adminNode + * @typedef {{ adminNode: Guarded, root: object }} CreateVatResults * * @typedef {object} VatAdminSvc * @property {(id: BundleID) => ERef} waitForBundleCap diff --git a/packages/agoric-cli/src/lib/format.js b/packages/agoric-cli/src/lib/format.js index cad70a023dc2..9e50c4d6e33e 100644 --- a/packages/agoric-cli/src/lib/format.js +++ b/packages/agoric-cli/src/lib/format.js @@ -54,7 +54,9 @@ export const makeAmountFormatter = assets => amt => { return [issuerName, Number(value) / 10 ** decimalPlaces]; case 'set': assert(Array.isArray(value)); + // @ts-expect-error narrowed if (value[0]?.handle?.iface?.includes('InvitationHandle')) { + // @ts-expect-error narrowed return [issuerName, value.map(v => v.description)]; } return [issuerName, value]; diff --git a/packages/base-zone/src/types.js b/packages/base-zone/src/types.js index d4eafcdbeeff..26ddc574df4b 100644 --- a/packages/base-zone/src/types.js +++ b/packages/base-zone/src/types.js @@ -33,9 +33,9 @@ export {}; * @typedef {object} Stores * @property {() => Stores} detached obtain store providers which are detached (the stores are anonymous rather than bound to `label` in the zone) * @property {(specimen: unknown) => boolean} isStorable return true if the specimen can be stored in the zone, whether as exo-object state or in a store - * @property {(label: string, options?: StoreOptions) => MapStore} mapStore provide a Map-like store named `label` in the zone - * @property {(label: string, options?: StoreOptions) => SetStore} setStore provide a Set-like store named `label` in the zone - * @property {( + * @property {(label: string, options?: StoreOptions) => MapStore} mapStore provide a Map-like store named `label` in the zone + * @property {(label: string, options?: StoreOptions) => SetStore} setStore provide a Set-like store named `label` in the zone + * @property {( * label: string, options?: StoreOptions) => WeakMapStore * } weakMapStore provide a WeakMap-like store named `label` in the zone * @property {( diff --git a/packages/governance/src/types.js b/packages/governance/src/types.js index 3a3f0b531a10..c47b567dc0db 100644 --- a/packages/governance/src/types.js +++ b/packages/governance/src/types.js @@ -731,7 +731,7 @@ export {}; * Akin to StartedInstanceKit but designed for the results of starting governed contracts. Used in bootstrap space. * @property {AdminFacet} adminFacet of the governed contract * @property {LimitedCF} creatorFacet creator-like facet within the governed contract (without the powers the governor needs) - * @property {GovernorCreatorFacet} governorCreatorFacet of the governing contract + * @property {Guarded>} governorCreatorFacet of the governing contract * @property {AdminFacet} governorAdminFacet of the governing contract * @property {Awaited>['publicFacet']} publicFacet * @property {Instance} instance diff --git a/packages/inter-protocol/src/provisionPoolKit.js b/packages/inter-protocol/src/provisionPoolKit.js index 768a4440e96a..cd87e8571dfe 100644 --- a/packages/inter-protocol/src/provisionPoolKit.js +++ b/packages/inter-protocol/src/provisionPoolKit.js @@ -348,7 +348,6 @@ export const prepareProvisionPoolKit = ( console.log('provisionPool notified of new asset', desc.brand); await zcf.saveIssuer(desc.issuer, desc.issuerName); /** @type {ERef} */ - // @ts-expect-error vbank purse is close enough for our use. const exchangePurse = E(poolBank).getPurse(desc.brand); void observeNotifier( E(exchangePurse).getCurrentAmountNotifier(), diff --git a/packages/pegasus/src/contract.js b/packages/pegasus/src/contract.js index 8f4d84ef4a80..06868d497104 100644 --- a/packages/pegasus/src/contract.js +++ b/packages/pegasus/src/contract.js @@ -7,6 +7,10 @@ import '@agoric/zoe/exported.js'; import '../exported.js'; +/** + * @import {Remote} from '@agoric/vow'; + */ + /** * @type {ContractStartFn, diff --git a/packages/smart-wallet/src/smartWallet.js b/packages/smart-wallet/src/smartWallet.js index 52d427dcedc2..34aa63d65939 100644 --- a/packages/smart-wallet/src/smartWallet.js +++ b/packages/smart-wallet/src/smartWallet.js @@ -770,7 +770,6 @@ export const prepareSmartWallet = (baggage, shared) => { const { registry, invitationBrand } = shared; if (registry.has(brand)) { - // @ts-expect-error virtual purse return E(state.bank).getPurse(brand); } else if (invitationBrand === brand) { return state.invitationPurse; diff --git a/packages/smart-wallet/test/contexts.js b/packages/smart-wallet/test/contexts.js index 7429634122ae..728c64a090ab 100644 --- a/packages/smart-wallet/test/contexts.js +++ b/packages/smart-wallet/test/contexts.js @@ -62,7 +62,6 @@ export const makeDefaultTestContext = async (t, makeSpace) => { }; const anchor = withAmountUtils( - // @ts-expect-error incomplete typedef await deeplyFulfilledObject(consume.testFirstAnchorKit), ); diff --git a/packages/smart-wallet/test/test-marshal-contexts.js b/packages/smart-wallet/test/test-marshal-contexts.js index 596096da37f6..7ee179d0eac8 100644 --- a/packages/smart-wallet/test/test-marshal-contexts.js +++ b/packages/smart-wallet/test/test-marshal-contexts.js @@ -62,10 +62,13 @@ test('makeImportContext preserves identity across AMM and wallet', t => { slots: ['board011'], }); - /** @type {Brand[]} */ - const [b1] = context.fromBoard.fromCapData(ammMetricsCapData); - /** @type {Brand[]} */ - const [b2] = context.fromBoard.fromCapData(amm.getMetrics()); + const [b1] = /** @type {Brand[]} */ ( + context.fromBoard.fromCapData(ammMetricsCapData) + ); + + const [b2] = /** @type {Brand[]} */ ( + context.fromBoard.fromCapData(amm.getMetrics()) + ); t.is(b1, b2, 'unserialization twice from same source'); const myWallet = makeOnChainWallet(board); @@ -85,6 +88,7 @@ test('makeImportContext preserves identity across AMM and wallet', t => { slots: ['board011', 'purse:ATOM'], }); + /** @type {any} */ const walletState = context.fromMyWallet.fromCapData(walletCapData); t.is(walletState[0].brand, b1, 'unserialization across sources'); diff --git a/packages/solo/src/pipe-entrypoint.js b/packages/solo/src/pipe-entrypoint.js index 0914ccfa36eb..81781f78f9da 100644 --- a/packages/solo/src/pipe-entrypoint.js +++ b/packages/solo/src/pipe-entrypoint.js @@ -29,6 +29,7 @@ const main = async () => { mutex.resolve(undefined); return; } + /** @type {any} */ const as = parse(`${msg}`); deliverator(...as).then(() => send('go')); }); diff --git a/packages/solo/src/pipe.js b/packages/solo/src/pipe.js index 4a743e4144e1..ade11381e697 100644 --- a/packages/solo/src/pipe.js +++ b/packages/solo/src/pipe.js @@ -31,6 +31,7 @@ export const connectToPipe = async ({ method, args, deliverInboundToMbx }) => { return; } // console.log('pipe.js', msg); + /** @type {any} */ const as = parse(`${msg}`); deliverInboundToMbx(...as).then(() => cp.send('go')); }); diff --git a/packages/telemetry/src/slog-to-otel.js b/packages/telemetry/src/slog-to-otel.js index 0cadc4911d03..e53583d1b21d 100644 --- a/packages/telemetry/src/slog-to-otel.js +++ b/packages/telemetry/src/slog-to-otel.js @@ -139,7 +139,10 @@ export const makeSlogToOtelKit = (tracer, overrideAttrs = {}) => { serializeBodyFormat: 'smallcaps', }); - /** @param {import('@agoric/swingset-vat').SwingSetCapData} data */ + /** + * @param {import('@agoric/swingset-vat').SwingSetCapData} data + * @returns {any} + */ const unserialize = data => { try { const body = rawUnserialize(data); diff --git a/packages/vat-data/src/vat-data-bindings.js b/packages/vat-data/src/vat-data-bindings.js index 2c2235d952d8..f336d606ea05 100644 --- a/packages/vat-data/src/vat-data-bindings.js +++ b/packages/vat-data/src/vat-data-bindings.js @@ -9,8 +9,8 @@ import { provideLazy } from '@agoric/store'; let VatDataGlobal; if ('VatData' in globalThis) { globalThis.VatData || Fail`VatData defined in global as null or undefined`; - // @ts-expect-error XXX - VatDataGlobal = globalThis.VatData; + // XXX types incompatibility + VatDataGlobal = /** @type {any} */ (globalThis.VatData); } else { // XXX this module has been known to get imported (transitively) in cases that // never use it so we make a version that will satisfy module resolution but diff --git a/packages/vats/src/core/basic-behaviors.js b/packages/vats/src/core/basic-behaviors.js index c25922d5ea8c..c5cc5dcee130 100644 --- a/packages/vats/src/core/basic-behaviors.js +++ b/packages/vats/src/core/basic-behaviors.js @@ -63,6 +63,7 @@ export const makeVatsFromBundles = async ({ // NOTE: we rely on multiple createVatAdminService calls // to return cooperating services. const svc = E(vats.vatAdmin).createVatAdminService(devices.vatAdmin); + // @ts-expect-error XXX vatAdminSvc.resolve(svc); const durableStore = await vatStore; @@ -77,6 +78,7 @@ export const makeVatsFromBundles = async ({ if (bundleName) { console.info(`createVatByName(${bundleName})`); /** @type {Promise} */ + // @ts-expect-error XXX const vatInfo = E(svc).createVatByName(bundleName, { ...defaultVatCreationOptions, name: vatName, @@ -87,6 +89,7 @@ export const makeVatsFromBundles = async ({ assert(bundleID); const bcap = await E(svc).getBundleCap(bundleID); /** @type {Promise} */ + // @ts-expect-error XXX const vatInfo = E(svc).createVat(bcap, { ...defaultVatCreationOptions, name: vatName, diff --git a/packages/vats/src/types.d.ts b/packages/vats/src/types.d.ts index 465fc541d326..081567ee76f5 100644 --- a/packages/vats/src/types.d.ts +++ b/packages/vats/src/types.d.ts @@ -93,12 +93,12 @@ export type BridgeHandler = { }; /** An object which handles messages for a specific bridge */ -export type ScopedBridgeManager = { +export type ScopedBridgeManager = Guarded<{ toBridge: (obj: any) => Promise; fromBridge: (obj: any) => PromiseVow; initHandler: (handler: ERef) => void; setHandler: (handler: ERef) => void; -}; +}>; /** The object to manage this bridge */ export type BridgeManager = { diff --git a/packages/vats/src/vat-bank.js b/packages/vats/src/vat-bank.js index ce22cef1bca3..8025f269d45c 100644 --- a/packages/vats/src/vat-bank.js +++ b/packages/vats/src/vat-bank.js @@ -21,6 +21,11 @@ import { import '@agoric/notifier/exported.js'; +/** + * @import {Guarded} from '@endo/exo') + * @import {Passable, RemotableObject} from '@endo/pass-style') + */ + const { Fail } = assert; const { VirtualPurseControllerI } = makeVirtualPurseKitIKit(); @@ -38,8 +43,9 @@ const BridgeChannelI = M.interface('BridgeChannel', { */ /** - * @typedef {object} BalanceUpdater - * @property {(value: string, nonce?: string) => void} update + * @typedef {Guarded<{ + * update: (value: string, nonce?: string) => void; + * }>} BalanceUpdater */ const BalanceUpdaterI = M.interface('BalanceUpdater', { @@ -362,12 +368,17 @@ const AssetIssuerKitShape = M.splitRecord(BaseIssuerKitShape, { mint: M.remotable('Mint'), }); -/** @typedef {AssetIssuerKit & { denom: string; escrowPurse?: ERef }} AssetRecord */ +/** + * @typedef {AssetIssuerKit & { + * denom: string; + * escrowPurse?: RemotableObject & ERef; + * }} AssetRecord + */ /** * @typedef {object} AssetDescriptor * @property {Brand} brand - * @property {ERef} issuer + * @property {RemotableObject & ERef} issuer * @property {string} issuerName * @property {string} denom * @property {string} proposedName @@ -411,6 +422,7 @@ const prepareBank = ( // (which we emulate, since we know both address and denom are JSONable). If // we decide to partition the provider and use `brandToVPurse` directly, we'd // need ephemera for each `makeBank` call. + /** @type {MapStore} */ const addressDenomToPurse = zone.mapStore('addressDenomToPurse'); /** * @type {import('@agoric/store/src/stores/store-utils.js').AtomicProvider< @@ -584,7 +596,7 @@ const prepareBankManager = ( /** * @type {MapStore< * string, - * { bank: Bank; brandToVPurse: MapStore } + * { bank: Guarded; brandToVPurse: MapStore } * >} */ const addressToBank = detachedZone.mapStore('addressToBank'); diff --git a/packages/vats/test/test-bootstrapPayment.js b/packages/vats/test/test-bootstrapPayment.js index efc1081e5123..b59f636df001 100644 --- a/packages/vats/test/test-bootstrapPayment.js +++ b/packages/vats/test/test-bootstrapPayment.js @@ -40,7 +40,6 @@ test.before(async (/** @type {CentralSupplyTestContext} */ t) => { }; t.context = await deeplyFulfilled( - // @ts-expect-error XXX harden({ zoe, feeMintAccess: feeMintAccessP, diff --git a/packages/vats/test/test-lib-board.js b/packages/vats/test/test-lib-board.js index e9ec6d264c31..70e90b159491 100644 --- a/packages/vats/test/test-lib-board.js +++ b/packages/vats/test/test-lib-board.js @@ -51,6 +51,7 @@ test('makeBoard', async t => { test('board values must be scalar keys', async t => { const board = makeFakeBoard(); const nonKey = harden({ a: 1 }); + // @ts-expect-error intentional error await t.throwsAsync(() => E(board).getId(nonKey), { message: /arg 0: A "copyRecord" cannot be a scalar key: {"a":1}/, }); diff --git a/packages/wallet/api/src/lib-wallet.js b/packages/wallet/api/src/lib-wallet.js index fd0947ea11a9..50793f3fc3ef 100644 --- a/packages/wallet/api/src/lib-wallet.js +++ b/packages/wallet/api/src/lib-wallet.js @@ -756,6 +756,7 @@ export function makeWalletRoot({ const addContact = async (petname, actions, address = undefined) => { // @ts-expect-error XXX ERef const already = await E(board).has(actions); + /** @type {any} */ let depositFacet; if (already) { depositFacet = actions; diff --git a/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js b/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js index f17718e5add2..de26f9bb0c3d 100644 --- a/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js +++ b/packages/zoe/src/contractSupport/priceAuthorityQuoteMint.js @@ -1,6 +1,11 @@ import { AssetKind, prepareIssuerKit } from '@agoric/ertp'; import { provideDurableMapStore } from '@agoric/vat-data'; +/** + * @import {EOnly} from '@endo/eventual-send'; + * @import {MutableQuote, PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; + */ + /** * * @param {import('@agoric/vat-data').Baggage} baggage diff --git a/packages/zoe/src/contractSupport/priceAuthorityTransform.js b/packages/zoe/src/contractSupport/priceAuthorityTransform.js index 69fe75368a8d..fbfd509c7078 100644 --- a/packages/zoe/src/contractSupport/priceAuthorityTransform.js +++ b/packages/zoe/src/contractSupport/priceAuthorityTransform.js @@ -6,7 +6,7 @@ import { makeNotifier } from '@agoric/notifier'; /** * @import {EOnly} from '@endo/eventual-send'; - * @import {MutableQuote, PriceAuthority, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; + * @import {MutableQuote, PriceAuthority, PriceQuote, PriceDescription,} from '@agoric/zoe/tools/types.js'; */ /** @@ -14,7 +14,7 @@ import { makeNotifier } from '@agoric/notifier'; * @param {Amount<'nat'>} amountIn * @param {Amount<'nat'>} amountOut * @param {import('@agoric/time').TimerService} timer - * @param {import('@agoric/time').Timestamp} timestamp + * @param {import('@agoric/time').TimestampRecord} timestamp * @param {ERef>} quoteMint * @returns {Promise} */ diff --git a/packages/zoe/src/zoeService/utils.d.ts b/packages/zoe/src/zoeService/utils.d.ts index 395b47714dde..f94b6762d98a 100644 --- a/packages/zoe/src/zoeService/utils.d.ts +++ b/packages/zoe/src/zoeService/utils.d.ts @@ -37,7 +37,7 @@ export type ContractStartFunction = ( baggage?: Baggage, ) => ERef<{ creatorFacet?: {}; publicFacet?: {} }>; -export type AdminFacet = { +export type AdminFacet = RemotableObject & { // Completion, which is currently any getVatShutdownPromise: () => Promise; upgradeContract: Parameters[1] extends undefined diff --git a/packages/zoe/tools/types.js b/packages/zoe/tools/types.js index 94c2d1d60df5..527b2d79676f 100644 --- a/packages/zoe/tools/types.js +++ b/packages/zoe/tools/types.js @@ -24,7 +24,7 @@ export {}; * The quoted result of trading `amountIn` * @property {import('@endo/pass-style').RemotableObject & import('@agoric/time').TimerService} timer * The service that gave the `timestamp` - * @property {import('@agoric/time').Timestamp} timestamp + * @property {import('@agoric/time').TimestampRecord} timestamp * A timestamp according to `timer` for the quote * @property {any} [conditions] * Additional conditions for the quote From c05c5defc65c8d8f43eecfd0910123a9596aad3c Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 2 May 2024 16:19:47 -0700 Subject: [PATCH 48/57] chore: update type-coverage --- packages/ERTP/package.json | 2 +- packages/SwingSet/package.json | 2 +- packages/agoric-cli/package.json | 2 +- packages/base-zone/package.json | 2 +- packages/boot/package.json | 2 +- packages/cache/package.json | 2 +- packages/deploy-script-support/package.json | 2 +- packages/governance/package.json | 2 +- packages/inter-protocol/package.json | 2 +- packages/internal/package.json | 2 +- packages/network/package.json | 2 +- packages/notifier/package.json | 2 +- packages/orchestration/package.json | 2 +- packages/smart-wallet/package.json | 2 +- packages/store/package.json | 2 +- packages/swingset-liveslots/package.json | 2 +- packages/swingset-runner/package.json | 2 +- packages/telemetry/package.json | 2 +- packages/time/package.json | 2 +- packages/vats/package.json | 2 +- packages/vow/package.json | 2 +- packages/zoe/package.json | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/ERTP/package.json b/packages/ERTP/package.json index 0daece068db9..b319be6f27bb 100644 --- a/packages/ERTP/package.json +++ b/packages/ERTP/package.json @@ -86,6 +86,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 90.61 + "atLeast": 91.21 } } diff --git a/packages/SwingSet/package.json b/packages/SwingSet/package.json index 69dbaf6965fa..425ddcbe7615 100644 --- a/packages/SwingSet/package.json +++ b/packages/SwingSet/package.json @@ -100,6 +100,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 75.01 + "atLeast": 74.99 } } diff --git a/packages/agoric-cli/package.json b/packages/agoric-cli/package.json index 2bf0150b58d6..bbf2447c2838 100644 --- a/packages/agoric-cli/package.json +++ b/packages/agoric-cli/package.json @@ -98,6 +98,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 76.98 + "atLeast": 76.88 } } diff --git a/packages/base-zone/package.json b/packages/base-zone/package.json index 33953f2a93be..f7ea86438bc8 100644 --- a/packages/base-zone/package.json +++ b/packages/base-zone/package.json @@ -56,6 +56,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 89.75 + "atLeast": 89.87 } } diff --git a/packages/boot/package.json b/packages/boot/package.json index ba7a03b8bbd1..de075d2e075a 100644 --- a/packages/boot/package.json +++ b/packages/boot/package.json @@ -91,6 +91,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 86.46 + "atLeast": 86.47 } } diff --git a/packages/cache/package.json b/packages/cache/package.json index 18959d176a78..5344052b8e51 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -47,6 +47,6 @@ "timeout": "20m" }, "typeCoverage": { - "atLeast": 90.97 + "atLeast": 94.12 } } diff --git a/packages/deploy-script-support/package.json b/packages/deploy-script-support/package.json index 58562381c959..54c953bcb654 100644 --- a/packages/deploy-script-support/package.json +++ b/packages/deploy-script-support/package.json @@ -73,6 +73,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 81.51 + "atLeast": 81.63 } } diff --git a/packages/governance/package.json b/packages/governance/package.json index 5c9dd06f2a82..3e4bf5514d86 100644 --- a/packages/governance/package.json +++ b/packages/governance/package.json @@ -77,6 +77,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 89.25 + "atLeast": 89.31 } } diff --git a/packages/inter-protocol/package.json b/packages/inter-protocol/package.json index 5fb811042a34..86f24840e08f 100644 --- a/packages/inter-protocol/package.json +++ b/packages/inter-protocol/package.json @@ -83,6 +83,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 95.85 + "atLeast": 95.86 } } diff --git a/packages/internal/package.json b/packages/internal/package.json index 92e6a4c83855..4801037dd49f 100755 --- a/packages/internal/package.json +++ b/packages/internal/package.json @@ -53,6 +53,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 93.73 + "atLeast": 93.81 } } diff --git a/packages/network/package.json b/packages/network/package.json index 1d12835f659d..0597def3148a 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -68,6 +68,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 89.47 + "atLeast": 89.5 } } diff --git a/packages/notifier/package.json b/packages/notifier/package.json index df54287d7093..2113eccd82e8 100644 --- a/packages/notifier/package.json +++ b/packages/notifier/package.json @@ -76,6 +76,6 @@ "timeout": "2m" }, "typeCoverage": { - "atLeast": 89.76 + "atLeast": 90.34 } } diff --git a/packages/orchestration/package.json b/packages/orchestration/package.json index 1f0534a09e15..7667ab2a0dd9 100644 --- a/packages/orchestration/package.json +++ b/packages/orchestration/package.json @@ -81,6 +81,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 95.96 + "atLeast": 96.18 } } diff --git a/packages/smart-wallet/package.json b/packages/smart-wallet/package.json index 239dfff3f21f..93084dbce86d 100644 --- a/packages/smart-wallet/package.json +++ b/packages/smart-wallet/package.json @@ -68,6 +68,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 94.01 + "atLeast": 94.36 } } diff --git a/packages/store/package.json b/packages/store/package.json index 2af60428d5fe..baf5439dd025 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -58,6 +58,6 @@ "timeout": "2m" }, "typeCoverage": { - "atLeast": 86.12 + "atLeast": 89.45 } } diff --git a/packages/swingset-liveslots/package.json b/packages/swingset-liveslots/package.json index b0cf2368d835..9d5141ecb79d 100644 --- a/packages/swingset-liveslots/package.json +++ b/packages/swingset-liveslots/package.json @@ -67,6 +67,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 75.31 + "atLeast": 75.24 } } diff --git a/packages/swingset-runner/package.json b/packages/swingset-runner/package.json index e6d0ae3eb122..c61d73a409e2 100644 --- a/packages/swingset-runner/package.json +++ b/packages/swingset-runner/package.json @@ -59,6 +59,6 @@ "timeout": "2m" }, "typeCoverage": { - "atLeast": 55.46 + "atLeast": 54.95 } } diff --git a/packages/telemetry/package.json b/packages/telemetry/package.json index a4cf37d3e97f..ab45e418d036 100644 --- a/packages/telemetry/package.json +++ b/packages/telemetry/package.json @@ -63,6 +63,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 87.07 + "atLeast": 87.04 } } diff --git a/packages/time/package.json b/packages/time/package.json index 5f284f9a6747..3809a3b1d792 100644 --- a/packages/time/package.json +++ b/packages/time/package.json @@ -54,6 +54,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 86.95 + "atLeast": 87.11 } } diff --git a/packages/vats/package.json b/packages/vats/package.json index 9535fbbd2d02..a7630efce352 100644 --- a/packages/vats/package.json +++ b/packages/vats/package.json @@ -78,6 +78,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 91.26 + "atLeast": 91.33 } } diff --git a/packages/vow/package.json b/packages/vow/package.json index a7b3827362ef..f346e36aa9cc 100755 --- a/packages/vow/package.json +++ b/packages/vow/package.json @@ -47,6 +47,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 89.21 + "atLeast": 89.38 } } diff --git a/packages/zoe/package.json b/packages/zoe/package.json index 16cab1139ba6..3cf2fb7d911d 100644 --- a/packages/zoe/package.json +++ b/packages/zoe/package.json @@ -139,6 +139,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 84.88 + "atLeast": 84.91 } } From 0d281837e1ddcc4812815db1dbd751a7bc3ee4d3 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Tue, 7 May 2024 14:49:13 -0700 Subject: [PATCH 49/57] fix: Correct endo sync integration instructions --- MAINTAINERS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 659876c2dceb..9b26082f89a9 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -264,8 +264,8 @@ From `origin/master`, begin a branch for syncing Endo. ```sh NOW=`date -u +%Y-%m-%d-%H-%M-%S` -git checkout -b "$USER-sync-endo-$NOW" origin/endo-integration-master -git rebase origin/master +git checkout -b "$USER-sync-endo-$NOW" +git rebase origin/integration-endo-master ``` Use a helper script from the Endo repository to update the dependency versions From edb6a2d10128ff68202fb11048f97ba5094d1a40 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Tue, 7 May 2024 15:01:34 -0700 Subject: [PATCH 50/57] chore: Sync Endo versions --- package.json | 2 +- packages/ERTP/package.json | 14 ++++---- packages/SwingSet/package.json | 32 +++++++++---------- packages/agoric-cli/package.json | 20 ++++++------ packages/assert/package.json | 2 +- packages/base-zone/package.json | 14 ++++---- packages/benchmark/package.json | 2 +- packages/boot/package.json | 20 ++++++------ packages/builders/package.json | 16 +++++----- packages/cache/package.json | 4 +-- packages/casting/package.json | 12 +++---- packages/cosmic-proto/package.json | 4 +-- packages/cosmic-swingset/package.json | 16 +++++----- packages/deploy-script-support/package.json | 16 +++++----- packages/deployment/package.json | 4 +-- packages/eslint-config/package.json | 2 +- packages/governance/package.json | 18 +++++------ packages/inter-protocol/package.json | 18 +++++------ packages/internal/package.json | 18 +++++------ packages/kmarshal/package.json | 4 +-- packages/network/package.json | 11 ++++--- packages/notifier/package.json | 12 +++---- packages/orchestration/package.json | 10 +++--- packages/pegasus/package.json | 12 +++---- packages/smart-wallet/package.json | 16 +++++----- packages/solo/package.json | 14 ++++---- packages/spawner/package.json | 10 +++--- packages/store/package.json | 12 +++---- packages/swing-store/package.json | 10 +++--- packages/swingset-liveslots/package.json | 22 ++++++------- packages/swingset-runner/package.json | 10 +++--- .../swingset-xsnap-supervisor/package.json | 8 ++--- packages/telemetry/package.json | 10 +++--- packages/time/package.json | 8 ++--- packages/vat-data/package.json | 9 +++--- packages/vats/package.json | 18 +++++------ packages/vow/package.json | 15 +++++---- packages/wallet/api/package.json | 14 ++++---- packages/xsnap-lockdown/package.json | 4 +-- packages/xsnap/package.json | 16 +++++----- packages/zoe/package.json | 24 +++++++------- packages/zone/package.json | 6 ++-- 42 files changed, 256 insertions(+), 253 deletions(-) diff --git a/package.json b/package.json index 11153111813a..8aa07223b4a3 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "type": "module", "packageManager": "yarn@1.22.19", "devDependencies": { - "@endo/eslint-plugin": "^2.1.2", + "@endo/eslint-plugin": "^2.1.3", "@jessie.js/eslint-plugin": "^0.4.1", "@types/express": "^4.17.17", "@types/node": "^18.19.24", diff --git a/packages/ERTP/package.json b/packages/ERTP/package.json index b319be6f27bb..47585342f793 100644 --- a/packages/ERTP/package.json +++ b/packages/ERTP/package.json @@ -44,16 +44,16 @@ "@agoric/store": "^0.9.2", "@agoric/vat-data": "^0.5.2", "@agoric/zone": "^0.2.2", - "@endo/eventual-send": "^1.2.1", - "@endo/far": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/nat": "^5.0.6", - "@endo/patterns": "^1.3.1", - "@endo/promise-kit": "^1.1.1" + "@endo/eventual-send": "^1.2.2", + "@endo/far": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/nat": "^5.0.7", + "@endo/patterns": "^1.4.0", + "@endo/promise-kit": "^1.1.2" }, "devDependencies": { "@agoric/swingset-vat": "^0.32.2", - "@endo/bundle-source": "^3.2.2", + "@endo/bundle-source": "^3.2.3", "@fast-check/ava": "^1.1.5", "ava": "^5.3.0", "tsd": "^0.30.7" diff --git a/packages/SwingSet/package.json b/packages/SwingSet/package.json index 425ddcbe7615..a2985df7de32 100644 --- a/packages/SwingSet/package.json +++ b/packages/SwingSet/package.json @@ -38,22 +38,22 @@ "@agoric/vat-data": "^0.5.2", "@agoric/xsnap": "^0.14.2", "@agoric/xsnap-lockdown": "^0.14.0", - "@endo/base64": "^1.0.4", - "@endo/bundle-source": "^3.2.2", - "@endo/captp": "^4.1.1", - "@endo/check-bundle": "^1.0.6", - "@endo/compartment-mapper": "^1.1.4", - "@endo/eventual-send": "^1.2.1", - "@endo/far": "^1.1.1", - "@endo/import-bundle": "^1.1.1", - "@endo/init": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/nat": "^5.0.6", - "@endo/patterns": "^1.3.1", - "@endo/promise-kit": "^1.1.1", - "@endo/ses-ava": "^1.2.1", - "@endo/stream": "^1.2.1", - "@endo/zip": "^1.0.4", + "@endo/base64": "^1.0.5", + "@endo/bundle-source": "^3.2.3", + "@endo/captp": "^4.2.0", + "@endo/check-bundle": "^1.0.7", + "@endo/compartment-mapper": "^1.1.5", + "@endo/eventual-send": "^1.2.2", + "@endo/far": "^1.1.2", + "@endo/import-bundle": "^1.1.2", + "@endo/init": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/nat": "^5.0.7", + "@endo/patterns": "^1.4.0", + "@endo/promise-kit": "^1.1.2", + "@endo/ses-ava": "^1.2.2", + "@endo/stream": "^1.2.2", + "@endo/zip": "^1.0.5", "ansi-styles": "^6.2.1", "anylogger": "^0.21.0", "better-sqlite3": "^9.1.1", diff --git a/packages/agoric-cli/package.json b/packages/agoric-cli/package.json index bbf2447c2838..10fd336c2f7a 100644 --- a/packages/agoric-cli/package.json +++ b/packages/agoric-cli/package.json @@ -58,16 +58,16 @@ "@cosmjs/math": "^0.32.3", "@cosmjs/proto-signing": "^0.32.3", "@cosmjs/stargate": "^0.32.3", - "@endo/bundle-source": "^3.2.2", - "@endo/captp": "^4.1.1", - "@endo/compartment-mapper": "^1.1.4", - "@endo/env-options": "^1.1.3", - "@endo/far": "^1.1.1", - "@endo/init": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/nat": "^5.0.6", - "@endo/patterns": "^1.3.1", - "@endo/promise-kit": "^1.1.1", + "@endo/bundle-source": "^3.2.3", + "@endo/captp": "^4.2.0", + "@endo/compartment-mapper": "^1.1.5", + "@endo/env-options": "^1.1.4", + "@endo/far": "^1.1.2", + "@endo/init": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/nat": "^5.0.7", + "@endo/patterns": "^1.4.0", + "@endo/promise-kit": "^1.1.2", "@iarna/toml": "^2.2.3", "anylogger": "^0.21.0", "chalk": "^5.2.0", diff --git a/packages/assert/package.json b/packages/assert/package.json index 1aac60a92f9b..5588bfacc10a 100755 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -18,7 +18,7 @@ "lint:types": "tsc" }, "devDependencies": { - "@endo/init": "^1.1.1", + "@endo/init": "^1.1.2", "ava": "^5.3.0" }, "ava": { diff --git a/packages/base-zone/package.json b/packages/base-zone/package.json index f7ea86438bc8..50e68a3b3b9d 100644 --- a/packages/base-zone/package.json +++ b/packages/base-zone/package.json @@ -28,15 +28,15 @@ "license": "Apache-2.0", "dependencies": { "@agoric/store": "^0.9.2", - "@endo/common": "^1.2.1", - "@endo/exo": "^1.4.0", - "@endo/far": "^1.1.1", - "@endo/pass-style": "^1.3.1", - "@endo/patterns": "^1.3.1" + "@endo/common": "^1.2.2", + "@endo/exo": "^1.5.0", + "@endo/far": "^1.1.2", + "@endo/pass-style": "^1.4.0", + "@endo/patterns": "^1.4.0" }, "devDependencies": { - "@endo/init": "^1.1.1", - "@endo/ses-ava": "^1.2.1", + "@endo/init": "^1.1.2", + "@endo/ses-ava": "^1.2.2", "ava": "^5.3.0" }, "publishConfig": { diff --git a/packages/benchmark/package.json b/packages/benchmark/package.json index 170ffc9f7eca..f1e3a9ef7180 100644 --- a/packages/benchmark/package.json +++ b/packages/benchmark/package.json @@ -29,7 +29,7 @@ "@agoric/inter-protocol": "^0.16.1", "@agoric/vats": "^0.15.1", "@agoric/zoe": "^0.26.2", - "@endo/init": "^1.1.1" + "@endo/init": "^1.1.2" }, "devDependencies": {}, "files": [ diff --git a/packages/boot/package.json b/packages/boot/package.json index de075d2e075a..aedb926b1f52 100644 --- a/packages/boot/package.json +++ b/packages/boot/package.json @@ -38,14 +38,14 @@ "@agoric/vow": "^0.1.0", "@agoric/zoe": "^0.26.2", "@agoric/zone": "^0.2.2", - "@endo/bundle-source": "^3.2.2", - "@endo/captp": "^4.1.1", - "@endo/eventual-send": "^1.2.1", - "@endo/far": "^1.1.1", - "@endo/init": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/promise-kit": "^1.1.1", - "@endo/stream": "^1.2.1", + "@endo/bundle-source": "^3.2.3", + "@endo/captp": "^4.2.0", + "@endo/eventual-send": "^1.2.2", + "@endo/far": "^1.1.2", + "@endo/init": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/promise-kit": "^1.1.2", + "@endo/stream": "^1.2.2", "import-meta-resolve": "^2.2.1" }, "devDependencies": { @@ -53,8 +53,8 @@ "@agoric/governance": "^0.10.3", "@agoric/store": "^0.9.2", "@agoric/swingset-liveslots": "^0.10.2", - "@endo/base64": "^1.0.4", - "@endo/patterns": "^1.3.1", + "@endo/base64": "^1.0.5", + "@endo/patterns": "^1.4.0", "ava": "^5.3.0", "c8": "^9.1.0", "tsx": "3.12.8" diff --git a/packages/builders/package.json b/packages/builders/package.json index b34c6f357c3d..a2b7b38ba8c5 100644 --- a/packages/builders/package.json +++ b/packages/builders/package.json @@ -30,14 +30,14 @@ "@agoric/vat-data": "^0.5.2", "@agoric/vats": "^0.15.1", "@agoric/zoe": "^0.26.2", - "@endo/bundle-source": "^3.2.2", - "@endo/captp": "^4.1.1", - "@endo/eventual-send": "^1.2.1", - "@endo/far": "^1.1.1", - "@endo/init": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/promise-kit": "^1.1.1", - "@endo/stream": "^1.2.1", + "@endo/bundle-source": "^3.2.3", + "@endo/captp": "^4.2.0", + "@endo/eventual-send": "^1.2.2", + "@endo/far": "^1.1.2", + "@endo/init": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/promise-kit": "^1.1.2", + "@endo/stream": "^1.2.2", "import-meta-resolve": "^2.2.1" }, "devDependencies": { diff --git a/packages/cache/package.json b/packages/cache/package.json index 5344052b8e51..c08891391c59 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -23,8 +23,8 @@ "@agoric/notifier": "^0.6.2", "@agoric/store": "^0.9.2", "@agoric/vat-data": "^0.5.2", - "@endo/far": "^1.1.1", - "@endo/marshal": "^1.4.1" + "@endo/far": "^1.1.2", + "@endo/marshal": "^1.5.0" }, "devDependencies": { "@agoric/zoe": "^0.26.2", diff --git a/packages/casting/package.json b/packages/casting/package.json index cae5060cf4f4..533bcae68556 100644 --- a/packages/casting/package.json +++ b/packages/casting/package.json @@ -30,16 +30,16 @@ "@cosmjs/proto-signing": "^0.32.3", "@cosmjs/stargate": "^0.32.3", "@cosmjs/tendermint-rpc": "^0.32.3", - "@endo/far": "^1.1.1", - "@endo/init": "^1.1.1", - "@endo/lockdown": "^1.0.6", - "@endo/marshal": "^1.4.1", - "@endo/promise-kit": "^1.1.1", + "@endo/far": "^1.1.2", + "@endo/init": "^1.1.2", + "@endo/lockdown": "^1.0.7", + "@endo/marshal": "^1.5.0", + "@endo/promise-kit": "^1.1.2", "node-fetch": "^2.6.0" }, "devDependencies": { "@agoric/cosmic-proto": "^0.4.0", - "@endo/ses-ava": "^1.2.1", + "@endo/ses-ava": "^1.2.2", "@types/node-fetch": "^2.6.2", "ava": "^5.3.0", "c8": "^9.1.0", diff --git a/packages/cosmic-proto/package.json b/packages/cosmic-proto/package.json index 18d22bc93c3e..4a6cace0a829 100644 --- a/packages/cosmic-proto/package.json +++ b/packages/cosmic-proto/package.json @@ -136,8 +136,8 @@ "@cosmjs/proto-signing": "^0.32.3", "@cosmjs/stargate": "^0.32.3", "@cosmjs/tendermint-rpc": "^0.32.3", - "@endo/base64": "^1.0.3", - "@endo/init": "^1.1.1" + "@endo/base64": "^1.0.5", + "@endo/init": "^1.1.2" }, "resolutions": { "**/axios": "^1.6.7", diff --git a/packages/cosmic-swingset/package.json b/packages/cosmic-swingset/package.json index bfc78de8b068..2e0c281f6fd7 100644 --- a/packages/cosmic-swingset/package.json +++ b/packages/cosmic-swingset/package.json @@ -32,14 +32,14 @@ "@agoric/swingset-vat": "^0.32.2", "@agoric/telemetry": "^0.6.2", "@agoric/vm-config": "^0.1.0", - "@endo/bundle-source": "^3.2.2", - "@endo/env-options": "^1.1.3", - "@endo/far": "^1.1.1", - "@endo/import-bundle": "^1.1.1", - "@endo/init": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/nat": "^5.0.6", - "@endo/promise-kit": "^1.1.1", + "@endo/bundle-source": "^3.2.3", + "@endo/env-options": "^1.1.4", + "@endo/far": "^1.1.2", + "@endo/import-bundle": "^1.1.2", + "@endo/init": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/nat": "^5.0.7", + "@endo/promise-kit": "^1.1.2", "@iarna/toml": "^2.2.3", "@opentelemetry/sdk-metrics": "~1.9.0", "@opentelemetry/api": "~1.3.0", diff --git a/packages/deploy-script-support/package.json b/packages/deploy-script-support/package.json index 54c953bcb654..74598aa3b273 100644 --- a/packages/deploy-script-support/package.json +++ b/packages/deploy-script-support/package.json @@ -42,17 +42,17 @@ "@agoric/store": "^0.9.2", "@agoric/time": "^0.3.2", "@agoric/zoe": "^0.26.2", - "@endo/base64": "^1.0.4", - "@endo/bundle-source": "^3.2.2", - "@endo/far": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/nat": "^5.0.6", - "@endo/promise-kit": "^1.1.1", - "@endo/zip": "^1.0.4" + "@endo/base64": "^1.0.5", + "@endo/bundle-source": "^3.2.3", + "@endo/far": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/nat": "^5.0.7", + "@endo/promise-kit": "^1.1.2", + "@endo/zip": "^1.0.5" }, "devDependencies": { "@agoric/vats": "^0.15.1", - "@endo/init": "^1.1.1", + "@endo/init": "^1.1.2", "ava": "^5.3.0", "import-meta-resolve": "^2.2.1" }, diff --git a/packages/deployment/package.json b/packages/deployment/package.json index aa964798dc35..193807d9f18b 100644 --- a/packages/deployment/package.json +++ b/packages/deployment/package.json @@ -20,8 +20,8 @@ "license": "Apache-2.0", "dependencies": { "@agoric/assert": "^0.6.0", - "@endo/init": "^1.1.1", - "@endo/marshal": "^1.4.1", + "@endo/init": "^1.1.2", + "@endo/marshal": "^1.5.0", "better-sqlite3": "^9.1.1", "chalk": "^5.2.0", "deterministic-json": "^1.0.5", diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index eac231278323..321e569b7d27 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -25,7 +25,7 @@ "eslint-config.*" ], "peerDependencies": { - "@endo/eslint-plugin": "^2.1.2", + "@endo/eslint-plugin": "^2.1.3", "@jessie.js/eslint-plugin": "^0.4.1", "typescript-eslint": "^7.2.0", "eslint": "^8.57.0", diff --git a/packages/governance/package.json b/packages/governance/package.json index 3e4bf5514d86..fd3344143e72 100644 --- a/packages/governance/package.json +++ b/packages/governance/package.json @@ -40,19 +40,19 @@ "@agoric/time": "^0.3.2", "@agoric/vat-data": "^0.5.2", "@agoric/zoe": "^0.26.2", - "@endo/bundle-source": "^3.2.2", - "@endo/captp": "^4.1.1", - "@endo/eventual-send": "^1.2.1", - "@endo/far": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/nat": "^5.0.6", - "@endo/promise-kit": "^1.1.1", + "@endo/bundle-source": "^3.2.3", + "@endo/captp": "^4.2.0", + "@endo/eventual-send": "^1.2.2", + "@endo/far": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/nat": "^5.0.7", + "@endo/promise-kit": "^1.1.2", "import-meta-resolve": "^2.2.1" }, "devDependencies": { "@agoric/swingset-vat": "^0.32.2", - "@endo/bundle-source": "^3.2.2", - "@endo/init": "^1.1.1", + "@endo/bundle-source": "^3.2.3", + "@endo/init": "^1.1.2", "ava": "^5.3.0", "c8": "^9.1.0" }, diff --git a/packages/inter-protocol/package.json b/packages/inter-protocol/package.json index 86f24840e08f..fe41e580aff5 100644 --- a/packages/inter-protocol/package.json +++ b/packages/inter-protocol/package.json @@ -41,12 +41,12 @@ "@agoric/vat-data": "^0.5.2", "@agoric/vats": "^0.15.1", "@agoric/zoe": "^0.26.2", - "@endo/captp": "^4.1.1", - "@endo/eventual-send": "^1.2.1", - "@endo/far": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/nat": "^5.0.6", - "@endo/promise-kit": "^1.1.1", + "@endo/captp": "^4.2.0", + "@endo/eventual-send": "^1.2.2", + "@endo/far": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/nat": "^5.0.7", + "@endo/promise-kit": "^1.1.2", "jessie.js": "^0.3.4" }, "devDependencies": { @@ -54,9 +54,9 @@ "@agoric/swingset-liveslots": "^0.10.2", "@agoric/swingset-vat": "^0.32.2", "@agoric/zone": "^0.2.2", - "@endo/bundle-source": "^3.2.2", - "@endo/init": "^1.1.1", - "@endo/promise-kit": "^1.1.1", + "@endo/bundle-source": "^3.2.3", + "@endo/init": "^1.1.2", + "@endo/promise-kit": "^1.1.2", "@fast-check/ava": "^1.1.5", "ava": "^5.3.0", "c8": "^9.1.0", diff --git a/packages/internal/package.json b/packages/internal/package.json index 4801037dd49f..59c9bdff0010 100755 --- a/packages/internal/package.json +++ b/packages/internal/package.json @@ -22,19 +22,19 @@ "dependencies": { "@agoric/assert": "^0.6.0", "@agoric/base-zone": "^0.1.0", - "@endo/common": "^1.2.1", - "@endo/far": "^1.1.1", - "@endo/init": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/pass-style": "^1.3.1", - "@endo/patterns": "^1.3.1", - "@endo/promise-kit": "^1.1.1", - "@endo/stream": "^1.2.1", + "@endo/common": "^1.2.2", + "@endo/far": "^1.1.2", + "@endo/init": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/pass-style": "^1.4.0", + "@endo/patterns": "^1.4.0", + "@endo/promise-kit": "^1.1.2", + "@endo/stream": "^1.2.2", "anylogger": "^0.21.0", "jessie.js": "^0.3.4" }, "devDependencies": { - "@endo/init": "^1.1.1", + "@endo/init": "^1.1.2", "ava": "^5.3.0", "tsd": "^0.30.7" }, diff --git a/packages/kmarshal/package.json b/packages/kmarshal/package.json index cf7eb2e08288..253bb73a69f8 100644 --- a/packages/kmarshal/package.json +++ b/packages/kmarshal/package.json @@ -21,8 +21,8 @@ "lint:eslint": "eslint ." }, "dependencies": { - "@endo/far": "^1.1.1", - "@endo/marshal": "^1.4.1", + "@endo/far": "^1.1.2", + "@endo/marshal": "^1.5.0", "@agoric/assert": "^0.6.0" }, "devDependencies": { diff --git a/packages/network/package.json b/packages/network/package.json index 0597def3148a..da2a4d421095 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -24,17 +24,18 @@ "@agoric/assert": "^0.6.0", "@agoric/internal": "^0.3.2", "@agoric/store": "^0.9.2", - "@endo/base64": "^1.0.4", - "@endo/far": "^1.1.1", - "@endo/patterns": "^1.3.1", - "@endo/promise-kit": "^1.1.1" + "@agoric/vat-data": "^0.5.2", + "@endo/base64": "^1.0.5", + "@endo/far": "^1.1.2", + "@endo/patterns": "^1.4.0", + "@endo/promise-kit": "^1.1.2" }, "devDependencies": { "@agoric/swingset-liveslots": "^0.10.2", "@agoric/swingset-vat": "^0.32.2", "@agoric/vow": "^0.1.0", "@agoric/zone": "^0.2.2", - "@endo/bundle-source": "^3.2.2", + "@endo/bundle-source": "^3.2.3", "ava": "^5.3.0", "c8": "^9.1.0" }, diff --git a/packages/notifier/package.json b/packages/notifier/package.json index 2113eccd82e8..5a512fe0939b 100644 --- a/packages/notifier/package.json +++ b/packages/notifier/package.json @@ -36,18 +36,18 @@ "@agoric/assert": "^0.6.0", "@agoric/internal": "^0.3.2", "@agoric/vat-data": "^0.5.2", - "@endo/far": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/patterns": "^1.3.1", - "@endo/promise-kit": "^1.1.1" + "@endo/far": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/patterns": "^1.4.0", + "@endo/promise-kit": "^1.1.2" }, "devDependencies": { "@agoric/kmarshal": "^0.1.0", "@agoric/swingset-liveslots": "^0.10.2", "@agoric/swing-store": "^0.9.1", "@agoric/swingset-vat": "^0.32.2", - "@endo/init": "^1.1.1", - "@endo/ses-ava": "^1.2.1", + "@endo/init": "^1.1.2", + "@endo/ses-ava": "^1.2.2", "ava": "^5.3.0", "c8": "^9.1.0" }, diff --git a/packages/orchestration/package.json b/packages/orchestration/package.json index 7667ab2a0dd9..698c30130ef4 100644 --- a/packages/orchestration/package.json +++ b/packages/orchestration/package.json @@ -42,15 +42,15 @@ "@agoric/vow": "^0.1.0", "@agoric/zoe": "^0.26.2", "@agoric/zone": "^0.2.2", - "@endo/base64": "^1.0.4", - "@endo/far": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/patterns": "^1.3.1" + "@endo/base64": "^1.0.5", + "@endo/far": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/patterns": "^1.4.0" }, "devDependencies": { "@cosmjs/amino": "^0.32.3", "@cosmjs/proto-signing": "^0.32.3", - "@endo/ses-ava": "^1.2.1", + "@endo/ses-ava": "^1.2.2", "ava": "^5.3.1" }, "ava": { diff --git a/packages/pegasus/package.json b/packages/pegasus/package.json index 8cb21c326d68..21ab27f7b0f9 100644 --- a/packages/pegasus/package.json +++ b/packages/pegasus/package.json @@ -38,13 +38,13 @@ "@agoric/vats": "^0.15.1", "@agoric/vow": "^0.1.0", "@agoric/zoe": "^0.26.2", - "@endo/bundle-source": "^3.2.2", + "@endo/bundle-source": "^3.2.3", "@agoric/zone": "^0.2.2", - "@endo/captp": "^4.1.1", - "@endo/far": "^1.1.1", - "@endo/init": "^1.1.1", - "@endo/nat": "^5.0.6", - "@endo/promise-kit": "^1.1.1" + "@endo/captp": "^4.2.0", + "@endo/far": "^1.1.2", + "@endo/init": "^1.1.2", + "@endo/nat": "^5.0.7", + "@endo/promise-kit": "^1.1.2" }, "devDependencies": { "ava": "^5.3.0", diff --git a/packages/smart-wallet/package.json b/packages/smart-wallet/package.json index 93084dbce86d..e18011f90512 100644 --- a/packages/smart-wallet/package.json +++ b/packages/smart-wallet/package.json @@ -19,9 +19,9 @@ "@agoric/cosmic-proto": "^0.4.0", "@agoric/swingset-vat": "^0.32.2", "@agoric/zone": "^0.2.2", - "@endo/bundle-source": "^3.2.2", - "@endo/captp": "^4.1.1", - "@endo/init": "^1.1.1", + "@endo/bundle-source": "^3.2.3", + "@endo/captp": "^4.2.0", + "@endo/init": "^1.1.2", "ava": "^5.3.0", "import-meta-resolve": "^2.2.1" }, @@ -35,11 +35,11 @@ "@agoric/vat-data": "^0.5.2", "@agoric/vats": "^0.15.1", "@agoric/zoe": "^0.26.2", - "@endo/eventual-send": "^1.2.1", - "@endo/far": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/nat": "^5.0.6", - "@endo/promise-kit": "^1.1.1" + "@endo/eventual-send": "^1.2.2", + "@endo/far": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/nat": "^5.0.7", + "@endo/promise-kit": "^1.1.2" }, "files": [ "src/" diff --git a/packages/solo/package.json b/packages/solo/package.json index 77d0e179b79a..78be1de10deb 100644 --- a/packages/solo/package.json +++ b/packages/solo/package.json @@ -36,12 +36,12 @@ "@agoric/time": "^0.3.2", "@agoric/vats": "^0.15.1", "@agoric/wallet": "^0.18.3", - "@endo/captp": "^4.1.1", - "@endo/eventual-send": "^1.2.1", - "@endo/import-bundle": "^1.1.1", - "@endo/init": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/promise-kit": "^1.1.1", + "@endo/captp": "^4.2.0", + "@endo/eventual-send": "^1.2.2", + "@endo/import-bundle": "^1.1.2", + "@endo/init": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/promise-kit": "^1.1.2", "anylogger": "^0.21.0", "deterministic-json": "^1.0.5", "esm": "agoric-labs/esm#Agoric-built", @@ -57,7 +57,7 @@ }, "devDependencies": { "@agoric/ertp": "^0.16.2", - "@endo/bundle-source": "^3.2.2", + "@endo/bundle-source": "^3.2.3", "ava": "^5.3.0", "c8": "^9.1.0" }, diff --git a/packages/spawner/package.json b/packages/spawner/package.json index 9ec34f77aed8..b9f8ecf3c272 100644 --- a/packages/spawner/package.json +++ b/packages/spawner/package.json @@ -32,15 +32,15 @@ "homepage": "https://github.com/Agoric/agoric-sdk#readme", "dependencies": { "@agoric/assert": "^0.6.0", - "@endo/eventual-send": "^1.2.1", - "@endo/import-bundle": "^1.1.1", - "@endo/marshal": "^1.4.1" + "@endo/eventual-send": "^1.2.2", + "@endo/import-bundle": "^1.1.2", + "@endo/marshal": "^1.5.0" }, "devDependencies": { "@agoric/internal": "^0.3.2", "@agoric/swingset-vat": "^0.32.2", - "@endo/bundle-source": "^3.2.2", - "@endo/init": "^1.1.1", + "@endo/bundle-source": "^3.2.3", + "@endo/init": "^1.1.2", "ava": "^5.3.0", "c8": "^9.1.0" }, diff --git a/packages/store/package.json b/packages/store/package.json index baf5439dd025..26105b60b697 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -30,14 +30,14 @@ }, "homepage": "https://github.com/Agoric/agoric-sdk#readme", "dependencies": { - "@endo/exo": "^1.4.0", - "@endo/marshal": "^1.4.1", - "@endo/pass-style": "^1.3.1", - "@endo/patterns": "^1.3.1" + "@endo/exo": "^1.5.0", + "@endo/marshal": "^1.5.0", + "@endo/pass-style": "^1.4.0", + "@endo/patterns": "^1.4.0" }, "devDependencies": { - "@endo/init": "^1.1.1", - "@endo/ses-ava": "^1.2.1", + "@endo/init": "^1.1.2", + "@endo/ses-ava": "^1.2.2", "ava": "^5.3.0" }, "files": [ diff --git a/packages/swing-store/package.json b/packages/swing-store/package.json index 4056d84f8089..41503038f91d 100644 --- a/packages/swing-store/package.json +++ b/packages/swing-store/package.json @@ -23,14 +23,14 @@ "dependencies": { "@agoric/assert": "^0.6.0", "@agoric/internal": "^0.3.2", - "@endo/base64": "^1.0.4", - "@endo/bundle-source": "^3.2.2", - "@endo/check-bundle": "^1.0.6", - "@endo/nat": "^5.0.6", + "@endo/base64": "^1.0.5", + "@endo/bundle-source": "^3.2.3", + "@endo/check-bundle": "^1.0.7", + "@endo/nat": "^5.0.7", "better-sqlite3": "^9.1.1" }, "devDependencies": { - "@endo/init": "^1.1.1", + "@endo/init": "^1.1.2", "@types/better-sqlite3": "^7.6.9", "ava": "^5.3.0", "c8": "^9.1.0", diff --git a/packages/swingset-liveslots/package.json b/packages/swingset-liveslots/package.json index 9d5141ecb79d..9052d45315b7 100644 --- a/packages/swingset-liveslots/package.json +++ b/packages/swingset-liveslots/package.json @@ -20,17 +20,17 @@ "@agoric/assert": "^0.6.0", "@agoric/internal": "^0.3.2", "@agoric/store": "^0.9.2", - "@endo/env-options": "^1.1.3", - "@endo/errors": "^1.2.1", - "@endo/eventual-send": "^1.2.1", - "@endo/exo": "^1.4.0", - "@endo/far": "^1.1.1", - "@endo/init": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/nat": "^5.0.6", - "@endo/pass-style": "^1.3.1", - "@endo/patterns": "^1.3.1", - "@endo/promise-kit": "^1.1.1" + "@endo/env-options": "^1.1.4", + "@endo/errors": "^1.2.2", + "@endo/eventual-send": "^1.2.2", + "@endo/exo": "^1.5.0", + "@endo/far": "^1.1.2", + "@endo/init": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/nat": "^5.0.7", + "@endo/pass-style": "^1.4.0", + "@endo/patterns": "^1.4.0", + "@endo/promise-kit": "^1.1.2" }, "devDependencies": { "ava": "^5.3.0", diff --git a/packages/swingset-runner/package.json b/packages/swingset-runner/package.json index c61d73a409e2..ea023cc5b460 100644 --- a/packages/swingset-runner/package.json +++ b/packages/swingset-runner/package.json @@ -32,11 +32,11 @@ "@agoric/telemetry": "^0.6.2", "@agoric/vat-data": "^0.5.2", "@agoric/zoe": "^0.26.2", - "@endo/bundle-source": "^3.2.2", - "@endo/eventual-send": "^1.2.1", - "@endo/init": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/nat": "^5.0.6", + "@endo/bundle-source": "^3.2.3", + "@endo/eventual-send": "^1.2.2", + "@endo/init": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/nat": "^5.0.7", "expose-gc": "^1.0.0", "n-readlines": "^1.0.1", "yargs": "^16.1.0" diff --git a/packages/swingset-xsnap-supervisor/package.json b/packages/swingset-xsnap-supervisor/package.json index fbb4de8e9426..c5f960205b6b 100644 --- a/packages/swingset-xsnap-supervisor/package.json +++ b/packages/swingset-xsnap-supervisor/package.json @@ -25,10 +25,10 @@ "devDependencies": { "@agoric/assert": "^0.6.0", "@agoric/swingset-liveslots": "^0.10.2", - "@endo/bundle-source": "^3.2.2", - "@endo/import-bundle": "^1.1.1", - "@endo/init": "^1.1.1", - "@endo/marshal": "^1.4.1", + "@endo/bundle-source": "^3.2.3", + "@endo/import-bundle": "^1.1.2", + "@endo/init": "^1.1.2", + "@endo/marshal": "^1.5.0", "ava": "^5.3.0", "c8": "^9.1.0" }, diff --git a/packages/telemetry/package.json b/packages/telemetry/package.json index ab45e418d036..d95369d3be92 100644 --- a/packages/telemetry/package.json +++ b/packages/telemetry/package.json @@ -25,9 +25,9 @@ "@agoric/assert": "^0.6.0", "@agoric/internal": "^0.3.2", "@agoric/store": "^0.9.2", - "@endo/init": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/stream": "^1.2.1", + "@endo/init": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/stream": "^1.2.2", "@opentelemetry/api": "~1.3.0", "@opentelemetry/exporter-prometheus": "~0.35.0", "@opentelemetry/exporter-trace-otlp-http": "~0.35.0", @@ -40,8 +40,8 @@ "tmp": "^0.2.1" }, "devDependencies": { - "@endo/lockdown": "^1.0.6", - "@endo/ses-ava": "^1.2.1", + "@endo/lockdown": "^1.0.7", + "@endo/ses-ava": "^1.2.2", "ava": "^5.3.0", "c8": "^9.1.0", "tmp": "^0.2.1" diff --git a/packages/time/package.json b/packages/time/package.json index 3809a3b1d792..59034ece3ab8 100644 --- a/packages/time/package.json +++ b/packages/time/package.json @@ -32,12 +32,12 @@ "homepage": "https://github.com/Agoric/agoric-sdk#readme", "dependencies": { "@agoric/assert": "^0.6.0", - "@endo/nat": "^5.0.6", - "@endo/patterns": "^1.3.1" + "@endo/nat": "^5.0.7", + "@endo/patterns": "^1.4.0" }, "devDependencies": { - "@endo/far": "^1.1.1", - "@endo/init": "^1.1.1", + "@endo/far": "^1.1.2", + "@endo/init": "^1.1.2", "ava": "^5.3.0" }, "ava": { diff --git a/packages/vat-data/package.json b/packages/vat-data/package.json index b92466dae999..4c2a3df117d2 100644 --- a/packages/vat-data/package.json +++ b/packages/vat-data/package.json @@ -24,12 +24,13 @@ "@agoric/store": "^0.9.2", "@agoric/swingset-liveslots": "^0.10.2", "@agoric/vow": "^0.1.0", - "@endo/exo": "^1.4.0", - "@endo/patterns": "^1.3.1" + "@endo/exo": "^1.5.0", + "@endo/patterns": "^1.4.0" }, "devDependencies": { - "@endo/init": "^1.1.1", - "@endo/ses-ava": "^1.2.1", + "@endo/init": "^1.1.2", + "@endo/far": "^1.1.2", + "@endo/ses-ava": "^1.2.2", "ava": "^5.3.0", "tsd": "^0.30.7" }, diff --git a/packages/vats/package.json b/packages/vats/package.json index a7630efce352..a888e7125de3 100644 --- a/packages/vats/package.json +++ b/packages/vats/package.json @@ -36,20 +36,20 @@ "@agoric/vow": "^0.1.0", "@agoric/zoe": "^0.26.2", "@agoric/zone": "^0.2.2", - "@endo/base64": "^1.0.4", - "@endo/far": "^1.1.1", - "@endo/import-bundle": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/nat": "^5.0.6", - "@endo/patterns": "^1.3.1", - "@endo/promise-kit": "^1.1.1", + "@endo/base64": "^1.0.5", + "@endo/far": "^1.1.2", + "@endo/import-bundle": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/nat": "^5.0.7", + "@endo/patterns": "^1.4.0", + "@endo/promise-kit": "^1.1.2", "import-meta-resolve": "^2.2.1", "jessie.js": "^0.3.4" }, "devDependencies": { "@agoric/swingset-liveslots": "^0.10.2", - "@endo/bundle-source": "^3.2.2", - "@endo/init": "^1.1.1", + "@endo/bundle-source": "^3.2.3", + "@endo/init": "^1.1.2", "ava": "^5.3.0", "c8": "^9.1.0" }, diff --git a/packages/vow/package.json b/packages/vow/package.json index f346e36aa9cc..ee70956b4b10 100755 --- a/packages/vow/package.json +++ b/packages/vow/package.json @@ -22,15 +22,16 @@ "dependencies": { "@agoric/base-zone": "^0.1.0", "@agoric/internal": "^0.3.2", - "@endo/env-options": "^1.1.3", - "@endo/eventual-send": "^1.2.1", - "@endo/pass-style": "^1.3.1", - "@endo/patterns": "^1.3.1", - "@endo/promise-kit": "^1.1.1" + "@endo/env-options": "^1.1.4", + "@endo/eventual-send": "^1.2.2", + "@endo/pass-style": "^1.4.0", + "@endo/patterns": "^1.4.0", + "@endo/promise-kit": "^1.1.2" }, "devDependencies": { - "@endo/far": "^1.1.1", - "@endo/init": "^1.1.1", + "@agoric/internal": "^0.3.2", + "@endo/far": "^1.1.2", + "@endo/init": "^1.1.2", "ava": "^5.3.0" }, "ava": { diff --git a/packages/wallet/api/package.json b/packages/wallet/api/package.json index 97deb0e472d1..c481af923c0d 100644 --- a/packages/wallet/api/package.json +++ b/packages/wallet/api/package.json @@ -15,9 +15,9 @@ }, "devDependencies": { "@agoric/vats": "^0.15.1", - "@endo/bundle-source": "^3.2.2", - "@endo/far": "^1.1.1", - "@endo/init": "^1.1.1", + "@endo/bundle-source": "^3.2.3", + "@endo/far": "^1.1.2", + "@endo/init": "^1.1.2", "ava": "^5.3.0" }, "dependencies": { @@ -32,10 +32,10 @@ "@agoric/vat-data": "^0.5.2", "@agoric/zoe": "^0.26.2", "@agoric/zone": "^0.2.2", - "@endo/eventual-send": "^1.2.1", - "@endo/marshal": "^1.4.1", - "@endo/nat": "^5.0.6", - "@endo/promise-kit": "^1.1.1", + "@endo/eventual-send": "^1.2.2", + "@endo/marshal": "^1.5.0", + "@endo/nat": "^5.0.7", + "@endo/promise-kit": "^1.1.2", "import-meta-resolve": "^2.2.1" }, "keywords": [], diff --git a/packages/xsnap-lockdown/package.json b/packages/xsnap-lockdown/package.json index 679a311369c4..cb0a724c193e 100644 --- a/packages/xsnap-lockdown/package.json +++ b/packages/xsnap-lockdown/package.json @@ -20,8 +20,8 @@ "test:xs": "exit 0" }, "devDependencies": { - "@endo/bundle-source": "^3.2.2", - "@endo/init": "^1.1.1", + "@endo/bundle-source": "^3.2.3", + "@endo/init": "^1.1.2", "ava": "^5.3.0", "c8": "^9.1.0", "rollup": "^2.58.0", diff --git a/packages/xsnap/package.json b/packages/xsnap/package.json index 63714f36c772..963c7c13bc5a 100644 --- a/packages/xsnap/package.json +++ b/packages/xsnap/package.json @@ -30,18 +30,18 @@ "@agoric/assert": "^0.6.0", "@agoric/internal": "^0.3.2", "@agoric/xsnap-lockdown": "^0.14.0", - "@endo/bundle-source": "^3.2.2", - "@endo/eventual-send": "^1.2.1", - "@endo/init": "^1.1.1", - "@endo/netstring": "^1.0.6", - "@endo/promise-kit": "^1.1.1", - "@endo/stream": "^1.2.1", - "@endo/stream-node": "^1.1.1", + "@endo/bundle-source": "^3.2.3", + "@endo/eventual-send": "^1.2.2", + "@endo/init": "^1.1.2", + "@endo/netstring": "^1.0.7", + "@endo/promise-kit": "^1.1.2", + "@endo/stream": "^1.2.2", + "@endo/stream-node": "^1.1.2", "glob": "^7.1.6", "tmp": "^0.2.1" }, "devDependencies": { - "@endo/base64": "^1.0.4", + "@endo/base64": "^1.0.5", "@types/glob": "^8.1.0", "ava": "^5.3.0", "c8": "^9.1.0" diff --git a/packages/zoe/package.json b/packages/zoe/package.json index 3cf2fb7d911d..3eac2e2f9d69 100644 --- a/packages/zoe/package.json +++ b/packages/zoe/package.json @@ -54,21 +54,21 @@ "@agoric/time": "^0.3.2", "@agoric/vat-data": "^0.5.2", "@agoric/zone": "^0.2.2", - "@endo/bundle-source": "^3.2.2", - "@endo/common": "^1.2.1", - "@endo/captp": "^4.1.1", - "@endo/eventual-send": "^1.2.1", - "@endo/exo": "^1.4.0", - "@endo/far": "^1.1.1", - "@endo/import-bundle": "^1.1.1", - "@endo/marshal": "^1.4.1", - "@endo/nat": "^5.0.6", - "@endo/patterns": "^1.3.1", - "@endo/promise-kit": "^1.1.1", + "@endo/bundle-source": "^3.2.3", + "@endo/common": "^1.2.2", + "@endo/captp": "^4.2.0", + "@endo/eventual-send": "^1.2.2", + "@endo/exo": "^1.5.0", + "@endo/far": "^1.1.2", + "@endo/import-bundle": "^1.1.2", + "@endo/marshal": "^1.5.0", + "@endo/nat": "^5.0.7", + "@endo/patterns": "^1.4.0", + "@endo/promise-kit": "^1.1.2", "yargs-parser": "^21.1.1" }, "devDependencies": { - "@endo/init": "^1.1.1", + "@endo/init": "^1.1.2", "@agoric/kmarshal": "^0.1.0", "ava": "^5.3.0", "c8": "^9.1.0", diff --git a/packages/zone/package.json b/packages/zone/package.json index c2b3389c518f..2d90095fb53d 100644 --- a/packages/zone/package.json +++ b/packages/zone/package.json @@ -29,12 +29,12 @@ "dependencies": { "@agoric/base-zone": "^0.1.0", "@agoric/vat-data": "^0.5.2", - "@endo/far": "^1.1.1", - "@endo/pass-style": "^1.3.1" + "@endo/far": "^1.1.2", + "@endo/pass-style": "^1.4.0" }, "devDependencies": { "@agoric/swingset-liveslots": "^0.10.2", - "@endo/patterns": "^1.3.1", + "@endo/patterns": "^1.4.0", "ava": "^5.3.0" }, "publishConfig": { From 7a35bfd2013e456b8dced3af72f074244f1644be Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Tue, 7 May 2024 15:01:53 -0700 Subject: [PATCH 51/57] chore: Update yarn.lock --- yarn.lock | 394 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 233 insertions(+), 161 deletions(-) diff --git a/yarn.lock b/yarn.lock index 003c84e0dc57..6081769807c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -273,11 +273,21 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== +"@babel/helper-string-parser@^7.24.1": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz#f99c36d3593db9540705d0739a1f10b5e20c696e" + integrity sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ== + "@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== +"@babel/helper-validator-identifier@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.5.tgz#918b1a7fa23056603506370089bd990d8720db62" + integrity sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA== + "@babel/helper-validator-option@^7.18.6", "@babel/helper-validator-option@^7.22.15", "@babel/helper-validator-option@^7.23.5": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" @@ -1091,6 +1101,15 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" +"@babel/types@^7.24.0": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.5.tgz#7661930afc638a5383eb0c4aee59b74f38db84d7" + integrity sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ== + dependencies: + "@babel/helper-string-parser" "^7.24.1" + "@babel/helper-validator-identifier" "^7.24.5" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -1447,76 +1466,81 @@ resolved "https://registry.yarnpkg.com/@datadog/sketches-js/-/sketches-js-2.1.0.tgz#8c7e8028a5fc22ad102fa542b0a446c956830455" integrity sha512-smLocSfrt3s53H/XSVP3/1kP42oqvrkjUPtyaFd1F79ux24oE31BKt+q0c6lsa6hOYrFzsIwyc5GXAI5JmfOew== -"@endo/base64@^1.0.3", "@endo/base64@^1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@endo/base64/-/base64-1.0.4.tgz#1f9ea22fed1c0f60e56334197413af1c4e4167b1" - integrity sha512-J0anjfw6wijDrtT9SvqdxGAtoqPDm0wSRQQUfOp7N4COxQRxmX9uyVAQnLcjcHzbc2CaDtgLc5Y4Oew85qQO7g== - -"@endo/bundle-source@^3.2.2": - version "3.2.2" - resolved "https://registry.yarnpkg.com/@endo/bundle-source/-/bundle-source-3.2.2.tgz#3dda174db0bdf2dda0d84bc6ab21daafce4a066a" - integrity sha512-/zEmkICpu95YKIT2MSSYabxbTg/JiirJBSB6Lqf/MWcC3i9jju57q2rxrmEUQJHYkjMqUntsIWjXi85ARUYX9w== - dependencies: - "@endo/base64" "^1.0.4" - "@endo/compartment-mapper" "^1.1.4" - "@endo/evasive-transform" "^1.1.1" - "@endo/init" "^1.1.1" - "@endo/promise-kit" "^1.1.1" - "@endo/where" "^1.0.4" +"@endo/base64@^1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@endo/base64/-/base64-1.0.5.tgz#821a5107d1efc988cc630ba92aa31dab9fecfc45" + integrity sha512-onumize4hsF15ah85C6xPCI3LzvC9NOjf8QUuIhnAKLVR5bnQqhCAjKyt1EUMcsEGcDgJsq5DZFQrbU/tjWJAg== + +"@endo/bundle-source@^3.2.3": + version "3.2.3" + resolved "https://registry.yarnpkg.com/@endo/bundle-source/-/bundle-source-3.2.3.tgz#414634151ed78a71b69d4e616be221512c5c6ed2" + integrity sha512-D/qcyeIQzWw9AP+vdadjGdajGpanLAFCqpjPHewGz/vojEuIo+uFrbkNOSttoxbKc+CfoCRHsOCBWUNANiD/QQ== + dependencies: + "@endo/base64" "^1.0.5" + "@endo/compartment-mapper" "^1.1.5" + "@endo/evasive-transform" "^1.1.2" + "@endo/init" "^1.1.2" + "@endo/promise-kit" "^1.1.2" + "@endo/where" "^1.0.5" "@rollup/plugin-commonjs" "^19.0.0" "@rollup/plugin-node-resolve" "^13.0.0" acorn "^8.2.4" rollup "^2.79.1" -"@endo/captp@^4.1.1": - version "4.1.1" - resolved "https://registry.yarnpkg.com/@endo/captp/-/captp-4.1.1.tgz#ae9d3075e0b14d70cc08a02b928d3cc3aa3f9e9c" - integrity sha512-2GQ/UsntNO7Luw4IWGJajRzu+pI5/B3llhO1FxphGf8Cm/VDEfMhJ2AGOqXiDWMEeislt1pmtrxCY4tWhvxC4g== +"@endo/captp@^4.2.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@endo/captp/-/captp-4.2.0.tgz#18b820d37d3a2b47efc00580d5bcee01c50a090d" + integrity sha512-nauPor3d1883jiv/L+mQ49vTV4kdshGtPGl9uUxCR7fn+DlhJa2tBmkY9fLWGyERZkto4A9PhwVbFpjZ/nrf+Q== dependencies: - "@endo/errors" "^1.2.1" - "@endo/eventual-send" "^1.2.1" - "@endo/marshal" "^1.4.1" - "@endo/nat" "^5.0.6" - "@endo/promise-kit" "^1.1.1" + "@endo/errors" "^1.2.2" + "@endo/eventual-send" "^1.2.2" + "@endo/marshal" "^1.5.0" + "@endo/nat" "^5.0.7" + "@endo/promise-kit" "^1.1.2" -"@endo/check-bundle@^1.0.6": - version "1.0.6" - resolved "https://registry.yarnpkg.com/@endo/check-bundle/-/check-bundle-1.0.6.tgz#90912d7c9c8ac1782fbbe9d3ec957f68e45fc8a1" - integrity sha512-AiEpigIe2LTn1O73/a2nAcBEsvyTp/bwlv+T3KpzSAALQ2hblAz3wBSCDsXP+X1HmUzXG1vdjNFIOz7VbAUn4w== +"@endo/check-bundle@^1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@endo/check-bundle/-/check-bundle-1.0.7.tgz#908d7dcf5d381ef920a5f4109ddbc687dc5b2fb4" + integrity sha512-7tQA5sJSfTOMv9o8YclDxeugbbrzh35FmyXTxDZXyueKSmXEIKGmUFzivVeFMqcHOpylqZo8fGA9CPjdB1T93g== dependencies: - "@endo/base64" "^1.0.4" - "@endo/compartment-mapper" "^1.1.4" - "@endo/errors" "^1.2.1" + "@endo/base64" "^1.0.5" + "@endo/compartment-mapper" "^1.1.5" + "@endo/errors" "^1.2.2" -"@endo/cjs-module-analyzer@^1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@endo/cjs-module-analyzer/-/cjs-module-analyzer-1.0.4.tgz#36b30dfd3b931bf58dbaff8ff58feac795f84356" - integrity sha512-1kBTMTBLcdv8GgQDnQxouTUogTF6pf2nRBfb9E3nkKf6AUP5J0rrb649D5IGv9ZdGAbnU41y/HfXwPp8C9Ln6Q== +"@endo/cjs-module-analyzer@^1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@endo/cjs-module-analyzer/-/cjs-module-analyzer-1.0.5.tgz#5f3f7584a383317cd341c0b47dadfb7bea62a5a0" + integrity sha512-YFz2wiEiUJqo/AuYn00+1rsiqydzAGbrSgqFTnI48V/nLOmWofAA5Tl5qMqcL/Z33K6WaK9Bzgv9zdaAl6uMyw== -"@endo/common@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@endo/common/-/common-1.2.1.tgz#3a29407f1f1405b0794205cbc9ffff6f7651a771" - integrity sha512-pZWnZoflPRvy/qlN8+OpTY9k/BtWbJuexel6YOSki8IZh0EO4JSCgoAlRvuuaM0o445TBCM7gsCiqWZLC9PcHg== +"@endo/common@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@endo/common/-/common-1.2.2.tgz#4f0c761eebd373e6b6e75595e5b414e8512c11cf" + integrity sha512-JUHj2FyYiH8DqpG+DDLahJUsFLuRgIWS5vX6uiDjtE5iGcMKuZQiFCsJ7OnLtUEvYXdAyvjLZwzkeEl78hZFUg== dependencies: - "@endo/errors" "^1.2.1" - "@endo/eventual-send" "^1.2.1" - "@endo/promise-kit" "^1.1.1" + "@endo/errors" "^1.2.2" + "@endo/eventual-send" "^1.2.2" + "@endo/promise-kit" "^1.1.2" -"@endo/compartment-mapper@^1.1.4": - version "1.1.4" - resolved "https://registry.yarnpkg.com/@endo/compartment-mapper/-/compartment-mapper-1.1.4.tgz#3e7b7263f724936bf308f76c06f657da8267b14e" - integrity sha512-qc0NkgUpWP3pA487tyxxS1v1XWxojd4HGO2bqQ8aV+6n4dSyjh0k5oIf0ci9kTUHrz/aV9u2V3WWMi6xIPmTGg== +"@endo/compartment-mapper@^1.1.5": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@endo/compartment-mapper/-/compartment-mapper-1.1.5.tgz#c836c319853c4de80c3cb54c4c54ca1f6a61747f" + integrity sha512-k/ddX/g5qsTWrqpTyS5BbzAM7mEUMck/uQVTxhxIegPVY2Ik0Lnjy1WJXRD21skAYNAWtb12tfSsK0oR59OLuQ== dependencies: - "@endo/cjs-module-analyzer" "^1.0.4" - "@endo/static-module-record" "^1.1.1" - "@endo/zip" "^1.0.4" - ses "^1.4.1" + "@endo/cjs-module-analyzer" "^1.0.5" + "@endo/static-module-record" "^1.1.2" + "@endo/zip" "^1.0.5" + ses "^1.5.0" "@endo/env-options@^1.1.3": version "1.1.3" resolved "https://registry.yarnpkg.com/@endo/env-options/-/env-options-1.1.3.tgz#fc6969a715c5dba61b42102d4e88c4c5ccb1455d" integrity sha512-Em0Y7ZMc90qwCKzpBaFJQbaErDXyYMnVRtPTC1w0qtgYoNOvPe5lzDmXfiZYPyFIyh+9ZhFwDp8rzy+3erMvCw== +"@endo/env-options@^1.1.4": + version "1.1.4" + resolved "https://registry.yarnpkg.com/@endo/env-options/-/env-options-1.1.4.tgz#b40ce43a6b9fd9659ffe7b6533dd2cd277628bb1" + integrity sha512-hBwS+uijkN+KDFcEM4FRMvkCeusqm/drC2WuUXZA2aqjzaWgNjneIks3m5VcFmGvEZSpjDmGtGydAS31vdk7Mw== + "@endo/errors@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@endo/errors/-/errors-1.2.1.tgz#3f76e443d94c932cbb47371177550df960137bb1" @@ -1524,10 +1548,17 @@ dependencies: ses "^1.4.1" -"@endo/eslint-plugin@^2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@endo/eslint-plugin/-/eslint-plugin-2.1.2.tgz#15d7e6796af6d8f58b007b49471e13901e85bdf1" - integrity sha512-/CoraBpJE4+HYbCQlKUiJYfdn1Gz7YIhh4UyxKHV7tfykKQ9TeYWRpUjMGIE+AzIqTQfsZw8c5mJGUNiZH2L0g== +"@endo/errors@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@endo/errors/-/errors-1.2.2.tgz#34d0f721df09c79744cd2cf89dddd3511bba64fa" + integrity sha512-PQWkU8gR/asxaJnPxu95r+OyM87usCAUZHgWCXSnEjecxlnCjn1UjhBfijmTh+/DmJP0XmdYYSDPOSYemqzEfw== + dependencies: + ses "^1.5.0" + +"@endo/eslint-plugin@^2.1.3": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@endo/eslint-plugin/-/eslint-plugin-2.1.3.tgz#2151d169deb3104f58ea48e092981625f34ec5cf" + integrity sha512-/WSyjPDMpqs6BaTc2x3wR1sRteHH65r4sX5ubDDT1eoEu8oB8Z6ZSc1qNkY/6JTSSdQB7UF2AYfhLrAqevqctw== dependencies: requireindex "~1.1.0" ts-api-utils "~1.0.1" @@ -1535,10 +1566,10 @@ typescript "~5.5.0-dev.20240327" typescript-eslint "^7.3.1" -"@endo/evasive-transform@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@endo/evasive-transform/-/evasive-transform-1.1.1.tgz#eb66ec60055647f84ed26171636863aa1c0be865" - integrity sha512-XzKYwP3g4OS1tjdqN3ZoOjSZSNyatSF+OSibC6LyOLGLOLDnwyi4OZX9uba8glAy9EXHscA6aZcZucwgAOGgCw== +"@endo/evasive-transform@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@endo/evasive-transform/-/evasive-transform-1.1.2.tgz#a5d9aaf9eb51b699e0c9bfb87c907653eead9144" + integrity sha512-lRjNWOTh1CvNAXSBTuroikn6bXs6XNQYX8a06uIoTLT9Yxr+ITZulDx0NFJW/2tWT3l1AO9dFwj1li9j8HAz3g== dependencies: "@agoric/babel-generator" "^7.17.6" "@babel/parser" "^7.23.6" @@ -1552,20 +1583,27 @@ dependencies: "@endo/env-options" "^1.1.3" -"@endo/exo@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@endo/exo/-/exo-1.4.0.tgz#13a95012e8cc9afe6f76625e6a558842981b7fd9" - integrity sha512-BCoYacqVG44lwYU1ocK66+ouZJYWcoZw9pP+Bd/wM3PrAbxL1LBTB4n5KTpKfW9iPCVo4jMuiZeArKoYhhbx9g== +"@endo/eventual-send@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@endo/eventual-send/-/eventual-send-1.2.2.tgz#68cb93f104a9c5e28737be4358d6e58bfc624e1f" + integrity sha512-6CCLM440idVuQJV4fpZZ/F5++tJZQLVNYI1LHiZk5BA9KJxDwSHTYmCIqw4THiRYCE32zt1f/xL5BU0RH5YIFQ== dependencies: - "@endo/common" "^1.2.1" - "@endo/env-options" "^1.1.3" - "@endo/errors" "^1.2.1" - "@endo/eventual-send" "^1.2.1" - "@endo/far" "^1.1.1" - "@endo/pass-style" "^1.3.1" - "@endo/patterns" "^1.3.1" + "@endo/env-options" "^1.1.4" -"@endo/far@^1.0.0", "@endo/far@^1.1.1": +"@endo/exo@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@endo/exo/-/exo-1.5.0.tgz#97ea9354f6f48c75b6fb893a19cbb82d090c02ba" + integrity sha512-YiZYQQATh5vQ6ex+8yLqZLXnr4M6U7pgX+D7KPZP+LRkDCs3sF5rT+AR24ErdEPUDLrcYco7BbUw4uy/im1uWQ== + dependencies: + "@endo/common" "^1.2.2" + "@endo/env-options" "^1.1.4" + "@endo/errors" "^1.2.2" + "@endo/eventual-send" "^1.2.2" + "@endo/far" "^1.1.2" + "@endo/pass-style" "^1.4.0" + "@endo/patterns" "^1.4.0" + +"@endo/far@^1.0.0": version "1.1.1" resolved "https://registry.yarnpkg.com/@endo/far/-/far-1.1.1.tgz#c4df662e1fb3714d50606105bfe485ca01b1f2a5" integrity sha512-ZTEngkTnqQ8Xee1alkuLCsnVNept6a9SwWyBd+BzLHwtDO87cO9dl2t6X1d8ntRzSDFQp7OFFInlXVhidCqqEw== @@ -1574,60 +1612,69 @@ "@endo/eventual-send" "^1.2.1" "@endo/pass-style" "^1.3.1" -"@endo/import-bundle@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@endo/import-bundle/-/import-bundle-1.1.1.tgz#92257b155a6366b68f17d6b7d4182292c922ac68" - integrity sha512-qMXZ0+o0OPReWyCIIR23OkkGUO8ocLJoC0xrp5ku+WrPiMHYYYhwtDhP/W5DIl0MqGPxEH7dNi9ljmL1H+TwrQ== +"@endo/far@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@endo/far/-/far-1.1.2.tgz#a120ce86f508ea06f0117861d16c6356f0f9d817" + integrity sha512-cyq5ZbHwiLcvHal+uyhx5molas/SJhVvykmijxv0gT80RqclM7nU59fwnocmp42YljdpMsmPU/o2HP84uMchCg== dependencies: - "@endo/base64" "^1.0.4" - "@endo/compartment-mapper" "^1.1.4" - "@endo/errors" "^1.2.1" - "@endo/where" "^1.0.4" - ses "^1.4.1" + "@endo/errors" "^1.2.2" + "@endo/eventual-send" "^1.2.2" + "@endo/pass-style" "^1.4.0" -"@endo/init@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@endo/init/-/init-1.1.1.tgz#eeb766868998fed0b03a0115509be34a3d93a251" - integrity sha512-H+lAGJDTnQOL8PlqdN48lwcWZmxcteZ0mmCyoU8T6pNNF8vB2blmjXctMm0FfplyAu/YoEip/Roya99X5EngpA== +"@endo/import-bundle@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@endo/import-bundle/-/import-bundle-1.1.2.tgz#d2a3c70cd17ae9a70eca8c1a3c87a22be3bd74d3" + integrity sha512-Q0V1z/vU6TOHsU82utt8BIElg3WQIBhWH13G05jeqYv9crYDyaNauEoXfO1DnRxn2LAoahI25TdwUMnt6HXlMQ== dependencies: - "@endo/base64" "^1.0.4" - "@endo/eventual-send" "^1.2.1" - "@endo/lockdown" "^1.0.6" - "@endo/promise-kit" "^1.1.1" + "@endo/base64" "^1.0.5" + "@endo/compartment-mapper" "^1.1.5" + "@endo/errors" "^1.2.2" + "@endo/where" "^1.0.5" + ses "^1.5.0" -"@endo/lockdown@^1.0.6": - version "1.0.6" - resolved "https://registry.yarnpkg.com/@endo/lockdown/-/lockdown-1.0.6.tgz#b741f85f903e1657539221f09c189a5518db585b" - integrity sha512-yrWSWQd1eiRLGoU9P8S4Qf5SPX2QcO6qrf03AKKZ8YCQ/wStcB+d5c7C72zCEtERci0b/lcWHp30T45seGY+9Q== +"@endo/init@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@endo/init/-/init-1.1.2.tgz#7ce21a9823c95ebf5c42d1952f138f0d9b140f48" + integrity sha512-PW853bLeNOdsL3e/YrwTUIu3IG+bbnkaozjbIjGtQAd6UvCjNK9LxEAXsubzWWrPLz2XNXrHxrTHlYN1opxggQ== dependencies: - ses "^1.4.1" + "@endo/base64" "^1.0.5" + "@endo/eventual-send" "^1.2.2" + "@endo/lockdown" "^1.0.7" + "@endo/promise-kit" "^1.1.2" -"@endo/marshal@^1.4.1": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@endo/marshal/-/marshal-1.4.1.tgz#6d900b2a7107a087a943eb1b320937f07dc3ab8a" - integrity sha512-RtmpvuhfBBWE2l/IvT9TJ0JvhGAVYhVMB9PMgvfNWFqLZzp8ZjEUb4o29G3YBSRpzWEGOBWuncG2Qx/9aeYZ7Q== +"@endo/lockdown@^1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@endo/lockdown/-/lockdown-1.0.7.tgz#2dfea315d225bd1ac14c34cc4cf86dac4ab63d6e" + integrity sha512-MGnCxgJJvzQIa7oRoHXQ6mzaEPfFyYdg5bKnm3ZAaFf2nDmbqCoi+xyy8fBIAvZyqUbRgdd7jAveuLROTKd/aA== dependencies: - "@endo/common" "^1.2.1" - "@endo/errors" "^1.2.1" - "@endo/eventual-send" "^1.2.1" - "@endo/nat" "^5.0.6" - "@endo/pass-style" "^1.3.1" - "@endo/promise-kit" "^1.1.1" - -"@endo/nat@^5.0.6": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@endo/nat/-/nat-5.0.6.tgz#ead4640fd330089c4601743513898748b4320194" - integrity sha512-+sV/VzonZOoBGbTgaCik/po+JIueKcAwAKl5YG7YZp1e+qQ4yNCp2ToJ7ukH6CfUA+gr+7ISQ8481iepBrtFHw== + ses "^1.5.0" -"@endo/netstring@^1.0.6": - version "1.0.6" - resolved "https://registry.yarnpkg.com/@endo/netstring/-/netstring-1.0.6.tgz#c5005a34a1c9f84965dcac341778009e230149a7" - integrity sha512-5HXsYrIyET7ruiB8ri6pJWI1sLbTA11lIRHhqUrwGUM808BhDhU7cwllGWuPSK6C/594igCCE8kC/8QfnXYY/A== +"@endo/marshal@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@endo/marshal/-/marshal-1.5.0.tgz#c7f87da2fe83d9da07855bd14e7f6cd202781561" + integrity sha512-06pMvo4Z3zRsMxKXrarMFlR4jn/Vlit5XasTj84cww6Wqp7z9sIVGy8llPczKcp3af+xFhlHE2qqEGiD86mEqA== + dependencies: + "@endo/common" "^1.2.2" + "@endo/errors" "^1.2.2" + "@endo/eventual-send" "^1.2.2" + "@endo/nat" "^5.0.7" + "@endo/pass-style" "^1.4.0" + "@endo/promise-kit" "^1.1.2" + +"@endo/nat@^5.0.7": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@endo/nat/-/nat-5.0.7.tgz#cd504f14f595981a847555ceb1ea3ca9582f6400" + integrity sha512-yAuIktN8nMW8xYTrpteHNu0NZ/HAc+5FfSdEwvVnLCVwQXnE899qhtlzVhjMOmQQ/qb3kNifVW7e/6bInlCSYQ== + +"@endo/netstring@^1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@endo/netstring/-/netstring-1.0.7.tgz#7bdcfa2c956c2c83cb1a581f662323dd3802b3d7" + integrity sha512-tf8GmoUMkcRab9RCdFTfPwGBaUCvj+04mWzf3QvSpB7Wg8QAi/hgwwZJjQmZcHgPkQV3D2iy35GmiggNh2wVuw== dependencies: - "@endo/init" "^1.1.1" - "@endo/promise-kit" "^1.1.1" - "@endo/stream" "^1.2.1" - ses "^1.4.1" + "@endo/init" "^1.1.2" + "@endo/promise-kit" "^1.1.2" + "@endo/stream" "^1.2.2" + ses "^1.5.0" "@endo/pass-style@^1.3.1": version "1.3.1" @@ -1640,16 +1687,27 @@ "@endo/promise-kit" "^1.1.1" "@fast-check/ava" "^1.1.5" -"@endo/patterns@^1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@endo/patterns/-/patterns-1.3.1.tgz#45695d4680d89efc69ee1e4f58a3166f209d10ef" - integrity sha512-XgJ7F8J6nJQKs4Y9d6q9iwabAlwmHtwn8bbPqbgFUDkxNue0FCtzaeoQQszTGYemWf4IFqznU99rSPTe+DEEHg== +"@endo/pass-style@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@endo/pass-style/-/pass-style-1.4.0.tgz#30b36b18fdc2646c1efb0386cb488df628fc119c" + integrity sha512-DH4+x/idq/IGV1t8L80ZRZWGIvA8IBr2QXDMHBQzHaNDJV8pgBNb0yloopB0luSDaRqcyHcwS6mezOkY0+IgnA== dependencies: - "@endo/common" "^1.2.1" - "@endo/errors" "^1.2.1" - "@endo/eventual-send" "^1.2.1" - "@endo/marshal" "^1.4.1" - "@endo/promise-kit" "^1.1.1" + "@endo/env-options" "^1.1.4" + "@endo/errors" "^1.2.2" + "@endo/eventual-send" "^1.2.2" + "@endo/promise-kit" "^1.1.2" + "@fast-check/ava" "^1.1.5" + +"@endo/patterns@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@endo/patterns/-/patterns-1.4.0.tgz#56213b66af196684ddce23e32dc49d8353a34006" + integrity sha512-/HHfV3pskSAFhlEIPHCKK5FrpvM47opta01SgWBF63ZSbs0jobYdQJgtKrPgxPKNcG0kRTema8VGCdJT/XyluQ== + dependencies: + "@endo/common" "^1.2.2" + "@endo/errors" "^1.2.2" + "@endo/eventual-send" "^1.2.2" + "@endo/marshal" "^1.5.0" + "@endo/promise-kit" "^1.1.2" "@endo/promise-kit@^1.1.1": version "1.1.1" @@ -1658,54 +1716,61 @@ dependencies: ses "^1.4.1" -"@endo/ses-ava@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@endo/ses-ava/-/ses-ava-1.2.1.tgz#fb2f69e772254059e9bbc90d850c1e8b4490baa6" - integrity sha512-Gghzk4cV+cuUTDHODkszrtFqBlo6WdTK5NdFCVvjNdVA/8TdlaKMMhfnseAqMaWph+MGsi91rF3z7EJiZ+RPNA== +"@endo/promise-kit@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@endo/promise-kit/-/promise-kit-1.1.2.tgz#0c4866be4e300e50595a5beb4e97e20a091ea1d5" + integrity sha512-FPcwVyZYKhFqmPkTYPyVVleqB8mLBfAwhjiNIYEA4x+Qa66y+zVAXd1Muiwr0d8YU+afcB3+tg8mMsPXbZJwQg== dependencies: - "@endo/env-options" "^1.1.3" - "@endo/init" "^1.1.1" - ses "^1.4.1" + ses "^1.5.0" -"@endo/static-module-record@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@endo/static-module-record/-/static-module-record-1.1.1.tgz#8b7676db855c0c65cb3995ac483cb7b4946e0bca" - integrity sha512-6xOhynPxxuzaEzUzFpMH79ZOcaFbhtXKpYTFKKIuGld8eDUvE1U8J5SjQuLi9BjzmHzg2kKotM0PckQfSDwpfw== +"@endo/ses-ava@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@endo/ses-ava/-/ses-ava-1.2.2.tgz#4d819b8b64e24d476e57b171a5c845105e23112e" + integrity sha512-Ah9sOQwGys0NLjrMCsysQekDe3z64D3w4d6fG174u3J5hMuXhYCe+Z3fPy1uflQp+BhybgXB1vsYeOr9jTGpPA== + dependencies: + "@endo/env-options" "^1.1.4" + "@endo/init" "^1.1.2" + ses "^1.5.0" + +"@endo/static-module-record@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@endo/static-module-record/-/static-module-record-1.1.2.tgz#21f133cba7e44881a3b4f51a439b86fb48a7ef07" + integrity sha512-Rzw6r/tdN6vsqZJRUcItNpZXy4qTtSRy0nCm52p/4rz3MNIiMd/Jfth+Etm0q4klhEMWLnBxSY80hnESfBzkqw== dependencies: "@agoric/babel-generator" "^7.17.6" "@babel/parser" "^7.23.6" "@babel/traverse" "^7.23.6" - "@babel/types" "^7.23.6" - ses "^1.4.1" + "@babel/types" "^7.24.0" + ses "^1.5.0" -"@endo/stream-node@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@endo/stream-node/-/stream-node-1.1.1.tgz#df6474d52944b7ff3697bdff9733efd4af89ffe1" - integrity sha512-HS29gjf/CYl5LFkm5yjyGf411p/S7QZi5sTI6ZM3EHMk3Py/AyQn39FgBQJ6mCQcvtX6IQKR1753CqPkzu0Asw== +"@endo/stream-node@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@endo/stream-node/-/stream-node-1.1.2.tgz#34f16f1ef7b710f677b89f38db2026f46926daf1" + integrity sha512-BqRIJO/8Sll9hQBLe66adY34RE5E1m+Q/uDUI5AgsdFzBGirsnuvgr7ijst9IqYVCgpQXlMzi/M3nU9HP1t1tA== dependencies: - "@endo/errors" "^1.2.1" - "@endo/init" "^1.1.1" - "@endo/stream" "^1.2.1" - ses "^1.4.1" + "@endo/errors" "^1.2.2" + "@endo/init" "^1.1.2" + "@endo/stream" "^1.2.2" + ses "^1.5.0" -"@endo/stream@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@endo/stream/-/stream-1.2.1.tgz#2bb0dd64fb22d5b8f39386e3e2332fdf0be52091" - integrity sha512-OZOpxVg2A0zZm5ZKm2B1TM2BMnLNepqLjO946jxQf6/7rtMUsFs2dmaIr/x5rrGpXO5sxqzrUpW6/jMuZEjGvQ== +"@endo/stream@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@endo/stream/-/stream-1.2.2.tgz#d207d5b7bee43623de07037bad607169582d0d87" + integrity sha512-5BA5U6JTE2oPyeyyJ/OBULuEN+dQSynFJSXpAk2y5jgbrD0Iwj6GGnOa5Dn9GuJfsAyPWiN3Hv9Q1nuQqhuPGg== dependencies: - "@endo/eventual-send" "^1.2.1" - "@endo/promise-kit" "^1.1.1" - ses "^1.4.1" + "@endo/eventual-send" "^1.2.2" + "@endo/promise-kit" "^1.1.2" + ses "^1.5.0" -"@endo/where@^1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@endo/where/-/where-1.0.4.tgz#82c7651402dbc00d46cb7305fd0a534eccc071aa" - integrity sha512-W0uAHTyZER3Fds16N6SJpwdJzZvqvL472RFUMpvbFTi7Y+lqLSm9rapFqtDYiqAH7Hs1OlRV0ehr/aEAVq7EbA== +"@endo/where@^1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@endo/where/-/where-1.0.5.tgz#7b7f8d572a9dd071c71865d711c4c82240ed7d4f" + integrity sha512-E4OwISkbzxVayQ8mQW7y+27Jo8puHal8Wdg99l5oW7BdVUl02lNmC77V22EzyfP079jmBvhPb014xpkqBEcwMw== -"@endo/zip@^1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@endo/zip/-/zip-1.0.4.tgz#17ae48d99eed6a3f02480324b77471e308a7d294" - integrity sha512-Jjtouy1q0uiMtGNK6Hy+azQdJtlbs/2P4mbhsECYr6Z+OBkde8rJkZUZugSThHETDko+Z8/zvhaHGMCEWEyHPA== +"@endo/zip@^1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@endo/zip/-/zip-1.0.5.tgz#213f074da3b0bedc1cb388c26ae8ebc9931bfc43" + integrity sha512-YW+O6fsmKmoA5iqtmcsVqEfRXqG9shWKrRkZXDPqmO2obfA7B3Q56wSlHw+2pX1ly11GpFZCgr4yaullbJiH5A== "@es-joy/jsdoccomment@~0.42.0": version "0.42.0" @@ -10602,6 +10667,13 @@ ses@^1.4.1: dependencies: "@endo/env-options" "^1.1.3" +ses@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/ses/-/ses-1.5.0.tgz#c1b8491a77fb3ee8141bb9ffa6247fe5b45dfe45" + integrity sha512-mtbONkuHpOZbJn0ueOMpBzIdNual1Ou+Tg1LbStRNsWnRljzg9ZLnoF0PyuzPPQG7kiwv2V2tN3GSJMXHPrQWg== + dependencies: + "@endo/env-options" "^1.1.4" + set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" From 6fa7b1637891717358f5e1497a3f94ee9314b61d Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Tue, 7 May 2024 15:04:52 -0700 Subject: [PATCH 52/57] chore: Bump xsnap meter type --- MAINTAINERS.md | 2 -- packages/xsnap/api.js | 2 +- packages/xsnap/test/test-xs-perf.js | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 9b26082f89a9..1105a8919a4f 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -308,8 +308,6 @@ Increment the meter type in `packages/xsnap/api.js`: export const METER_TYPE = 'xs-meter-0'; ``` -Be sure to also update `test/test-xs-perf.js` with the new meter version. - ```sh cd packages/xsnap git add api.js diff --git a/packages/xsnap/api.js b/packages/xsnap/api.js index 1c0967ad4613..15af5cbac096 100644 --- a/packages/xsnap/api.js +++ b/packages/xsnap/api.js @@ -7,7 +7,7 @@ * Also, update golden master test/test-xs-perf.js to reflect new meter * version. */ -export const METER_TYPE = 'xs-meter-27'; +export const METER_TYPE = 'xs-meter-28'; export const ExitCode = { E_UNKNOWN_ERROR: -1, diff --git a/packages/xsnap/test/test-xs-perf.js b/packages/xsnap/test/test-xs-perf.js index e8eb8c4c2c0e..761316dacd94 100644 --- a/packages/xsnap/test/test-xs-perf.js +++ b/packages/xsnap/test/test-xs-perf.js @@ -8,6 +8,7 @@ import * as os from 'os'; import { tmpName } from 'tmp'; import { xsnap } from '../src/xsnap.js'; +import { METER_TYPE } from '../api.js'; import { options, decode, encode } from './message-tools.js'; @@ -61,7 +62,7 @@ test('meter details', async t => { }, 'evaluate returns meter details', ); - t.is(meterType, 'xs-meter-27'); + t.is(meterType, METER_TYPE); }); // test disabled until rewritten to tolerate fast CI hosts getting From f560ae8a0398e09383e7b06ac8d7881fbb273515 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Tue, 7 May 2024 15:07:00 -0700 Subject: [PATCH 53/57] chore(swingset-vat): Update xsnap store test snapshots --- .../test/snapshots/test-xsnap-store.js.md | 8 ++++---- .../test/snapshots/test-xsnap-store.js.snap | Bin 504 -> 503 bytes 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/SwingSet/test/snapshots/test-xsnap-store.js.md b/packages/SwingSet/test/snapshots/test-xsnap-store.js.md index 7c9118b44906..6d3196457daa 100644 --- a/packages/SwingSet/test/snapshots/test-xsnap-store.js.md +++ b/packages/SwingSet/test/snapshots/test-xsnap-store.js.md @@ -20,8 +20,8 @@ Generated by [AVA](https://avajs.dev). { compressSeconds: 0, dbSaveSeconds: 0, - hash: '7581ecfd2cc7baa1a4fe0d775c07426d465ffff63f658e7dbabdad18ff487153', - uncompressedSize: 816603, + hash: 'bd10d954d29157e1ab9a068b6bdeb8bb7157489e11dc71b2961f4cab9a7d135c', + uncompressedSize: 827051, } > after use of harden() - sensitive to SES-shim, XS, and supervisor @@ -29,6 +29,6 @@ Generated by [AVA](https://avajs.dev). { compressSeconds: 0, dbSaveSeconds: 0, - hash: '5aaf98d249c90b4c772c8c8616a4bd0890d9e5e9b063be3c8d8d2f6984482e22', - uncompressedSize: 816763, + hash: 'ba3a51da404ab14b6366df8966df683bc4f8ffd99f2dc12aabfa3b7728f39952', + uncompressedSize: 827211, } diff --git a/packages/SwingSet/test/snapshots/test-xsnap-store.js.snap b/packages/SwingSet/test/snapshots/test-xsnap-store.js.snap index 057cfbbb99eab11ff4320128be56d63cac2dcb55..1c7da1cef30459e48cf574ae8fd528cc684c0f08 100644 GIT binary patch literal 503 zcmVF8ne2Yc%@FKLfPA|Cm1CP>#8!>z9{} zcp;kCjYyqarA42Ua07|9@7~Wc4NHNvIbs)6jy~>FUv3axcJKIf#2&HD;*a^^Ib-aC zF%}qOUm0V67-OgWXv&Y?!Uyu1^Zj))nJ|9L_?Yn%cFGT)@)6^QQ-0$69#&*cT&d)jk}_MX2uJb7Q4p<5S3sGB0wbND_?4@0@w;P1u~{IMbPM#3l8iY6wRqJ z4zW^LgOUDD^U1o~4NBO=Pqdw3^!wWZwGOCV#V+RP+CA)p14B7STPZB8tTagn*3D}J zH6Vcj(6Z9XSdtRGmQdJQ2IV&?jk2un3-;^#lP%cwxeJ+w+s_DnpT$fh>Qc<{ibU== z^;ufP<(ar_&V=hwr1gr1tC;%X!P&afRT7<=D+f|RUDh=QV>f$kO7JR}5YXCCpqGVn t5L^jb7bcX}R>eJS-~8CwzS`QZ6Nx^Eg&UB%XV3qK_%C2qyz@H*002N)^y~lt literal 504 zcmVmsGQ*0AT+cRbj zd%LH#?-W6W=;(L^@+v$A55Q}n%jvF2fkGKK_Kg0rMnBC@Z@a;LieGOjh1Ai_>+6QU z;?3KJ$KI@BJEX|XNW2^R4~s9)eo(?De5TzDlV3lMs56$jRp>(sraQnsHZUc1PR?WDoU+E`MtI6lDd{pL ziV8&~z4yKuo@dc06$B@E?cpA3- zMQp?Jf?qcm-1NxfdPUCP}r;s?t*F uG-@n-Rcj%1K}GRE+b^5F?VFwLIuai|Z_S9*zj*mS#D4+H5&MEW1ONap#Q3TJ From b23a5978be08c9423e5ec41682d2ef8e7c34b74f Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 7 May 2024 16:16:53 -0700 Subject: [PATCH 54/57] chore(types): explicit export to solve TS9006 --- packages/internal/src/storage-test-utils.js | 27 ++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/packages/internal/src/storage-test-utils.js b/packages/internal/src/storage-test-utils.js index 3a344e556492..c8765fc3c606 100644 --- a/packages/internal/src/storage-test-utils.js +++ b/packages/internal/src/storage-test-utils.js @@ -6,6 +6,10 @@ import { makeTracer } from './debug.js'; import { isStreamCell, makeChainStorageRoot } from './lib-chainStorage.js'; import { bindAllMethods } from './method-tools.js'; +/** + * @import {Marshaller, StorageEntry, StorageMessage, StorageNode} from './lib-chainStorage.js'; + */ + const { Fail } = assert; const trace = makeTracer('StorTU', false); @@ -113,9 +117,9 @@ export const makeFakeStorageKit = (rootPath, rootOptions) => { } return childEntries; }; - /** @type {import('../src/lib-chainStorage.js').StorageMessage[]} */ + /** @type {StorageMessage[]} */ const messages = []; - /** @param {import('../src/lib-chainStorage.js').StorageMessage} message */ + /** @param {StorageMessage} message */ const toStorage = message => { messages.push(message); @@ -143,7 +147,7 @@ export const makeFakeStorageKit = (rootPath, rootOptions) => { case 'set': case 'setWithoutNotify': { trace('toStorage set', message); - /** @type {import('../src/lib-chainStorage.js').StorageEntry[]} */ + /** @type {StorageEntry[]} */ const newEntries = message.args; for (const [key, value] of newEntries) { if (value != null) { @@ -156,7 +160,7 @@ export const makeFakeStorageKit = (rootPath, rootOptions) => { } case 'append': { trace('toStorage append', message); - /** @type {import('../src/lib-chainStorage.js').StorageEntry[]} */ + /** @type {StorageEntry[]} */ const newEntries = message.args; for (const [key, value] of newEntries) { value != null || Fail`attempt to append with no value`; @@ -203,6 +207,18 @@ export const makeFakeStorageKit = (rootPath, rootOptions) => { harden(makeFakeStorageKit); /** @typedef {ReturnType< typeof makeFakeStorageKit>} FakeStorageKit */ +/** + * @typedef MockChainStorageRootMethods + * @property {(path: string, marshaller?: Marshaller, index?: number) => unknown} getBody + * Defaults to deserializing slot references into plain Remotable + * objects having the specified interface name (as from `Far(iface)`), + * but can accept a different marshaller for producing Remotables + * that e.g. embed the slot string in their iface name. + * @property {() => string[]} keys + */ +/** @typedef {StorageNode & MockChainStorageRootMethods} MockChainStorageRoot */ + +/** @returns {MockChainStorageRoot} */ export const makeMockChainStorageRoot = () => { const { rootNode, data } = makeFakeStorageKit('mockChainStorageRoot'); return Far('mockChainStorage', { @@ -214,7 +230,7 @@ export const makeMockChainStorageRoot = () => { * that e.g. embed the slot string in their iface name. * * @param {string} path - * @param {import('./lib-chainStorage.js').Marshaller} marshaller + * @param {Marshaller} marshaller * @param {number} [index] * @returns {unknown} */ @@ -228,4 +244,3 @@ export const makeMockChainStorageRoot = () => { keys: () => [...data.keys()], }); }; -/** @typedef {ReturnType} MockChainStorageRoot */ From ab0e4ffbf4da041e348199f2a5306a6ebc833fd2 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 7 May 2024 19:44:58 -0700 Subject: [PATCH 55/57] chore(types): temp workaround for TS9006 --- packages/vats/src/ibc.js | 6 +++++- packages/vats/test/test-clientBundle.js | 1 - packages/vats/test/test-vat-bank-integration.js | 2 -- packages/vats/tools/boot-test-utils.js | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/vats/src/ibc.js b/packages/vats/src/ibc.js index a1e0e1c94868..504104801c30 100644 --- a/packages/vats/src/ibc.js +++ b/packages/vats/src/ibc.js @@ -46,7 +46,11 @@ const DEFAULT_PACKET_TIMEOUT_NS = 60n * 60n * 1_000_000_000n; * }} Outbound */ -/** @param {Zone} zone */ +// FIXME(TS9006) remove 'any' +/** + * @param {Zone} zone + * @returns {any} + */ export const prepareIBCConnectionHandler = zone => { /** * @param {IBCChannelID} channelID diff --git a/packages/vats/test/test-clientBundle.js b/packages/vats/test/test-clientBundle.js index e44fb8a58780..fcc066c55c12 100644 --- a/packages/vats/test/test-clientBundle.js +++ b/packages/vats/test/test-clientBundle.js @@ -45,7 +45,6 @@ test('connectFaucet produces payments', async t => { const { zoe, feeMintAccessP, vatAdminSvc } = await setUpZoeForTest({ feeIssuerConfig, - // @ts-expect-error XXX vatAdminSvc: makePopulatedFakeVatAdmin().vatAdminService, }); produce.zoe.resolve(zoe); diff --git a/packages/vats/test/test-vat-bank-integration.js b/packages/vats/test/test-vat-bank-integration.js index d8f6fcce5848..1ef20aa8ef5d 100644 --- a/packages/vats/test/test-vat-bank-integration.js +++ b/packages/vats/test/test-vat-bank-integration.js @@ -34,11 +34,9 @@ test('mintInitialSupply, addBankAssets bootstrap actions', async t => { produce.agoricNamesAdmin.resolve(agoricNamesAdmin); const { vatAdminService } = makePopulatedFakeVatAdmin(); - // @ts-expect-error XXX const { zoeService, feeMintAccess: fma } = makeZoeKitForTest(vatAdminService); produce.zoe.resolve(zoeService); produce.feeMintAccess.resolve(fma); - // @ts-expect-error XXX produce.vatAdminSvc.resolve(vatAdminService); await installBootContracts({ consume, diff --git a/packages/vats/tools/boot-test-utils.js b/packages/vats/tools/boot-test-utils.js index 09afd1bae014..5730acabfa6a 100644 --- a/packages/vats/tools/boot-test-utils.js +++ b/packages/vats/tools/boot-test-utils.js @@ -132,6 +132,8 @@ export const makePopulatedFakeVatAdmin = () => { return createVat(fakeNameToCap.get(name) || Fail`unknown vat ${name}`); }; + // FIXME(TS9006) remove 'any' + /** @type {any} */ const vatAdminService = Far('vatAdminSvc', { ...fakeVatAdmin, createVat, From 319a312b1663d71330efdf1c061e218c796b57a7 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 8 May 2024 07:27:03 -0700 Subject: [PATCH 56/57] chore(deps): npx yarn-deduplicate --- yarn.lock | 191 ++++-------------------------------------------------- 1 file changed, 12 insertions(+), 179 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6081769807c7..b679527d6290 100644 --- a/yarn.lock +++ b/yarn.lock @@ -268,22 +268,12 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-string-parser@^7.18.10", "@babel/helper-string-parser@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" - integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== - -"@babel/helper-string-parser@^7.24.1": +"@babel/helper-string-parser@^7.18.10", "@babel/helper-string-parser@^7.23.4", "@babel/helper-string-parser@^7.24.1": version "7.24.1" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz#f99c36d3593db9540705d0739a1f10b5e20c696e" integrity sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ== -"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.22.20": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" - integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== - -"@babel/helper-validator-identifier@^7.24.5": +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.22.20", "@babel/helper-validator-identifier@^7.24.5": version "7.24.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.5.tgz#918b1a7fa23056603506370089bd990d8720db62" integrity sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA== @@ -1092,16 +1082,7 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" -"@babel/types@^7.17.0", "@babel/types@^7.18.10", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.23.9", "@babel/types@^7.4.4", "@babel/types@^7.7.0": - version "7.23.9" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.9.tgz#1dd7b59a9a2b5c87f8b41e52770b5ecbf492e002" - integrity sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q== - dependencies: - "@babel/helper-string-parser" "^7.23.4" - "@babel/helper-validator-identifier" "^7.22.20" - to-fast-properties "^2.0.0" - -"@babel/types@^7.24.0": +"@babel/types@^7.17.0", "@babel/types@^7.18.10", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.23.9", "@babel/types@^7.24.0", "@babel/types@^7.4.4", "@babel/types@^7.7.0": version "7.24.5" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.5.tgz#7661930afc638a5383eb0c4aee59b74f38db84d7" integrity sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ== @@ -1531,23 +1512,11 @@ "@endo/zip" "^1.0.5" ses "^1.5.0" -"@endo/env-options@^1.1.3": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@endo/env-options/-/env-options-1.1.3.tgz#fc6969a715c5dba61b42102d4e88c4c5ccb1455d" - integrity sha512-Em0Y7ZMc90qwCKzpBaFJQbaErDXyYMnVRtPTC1w0qtgYoNOvPe5lzDmXfiZYPyFIyh+9ZhFwDp8rzy+3erMvCw== - "@endo/env-options@^1.1.4": version "1.1.4" resolved "https://registry.yarnpkg.com/@endo/env-options/-/env-options-1.1.4.tgz#b40ce43a6b9fd9659ffe7b6533dd2cd277628bb1" integrity sha512-hBwS+uijkN+KDFcEM4FRMvkCeusqm/drC2WuUXZA2aqjzaWgNjneIks3m5VcFmGvEZSpjDmGtGydAS31vdk7Mw== -"@endo/errors@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@endo/errors/-/errors-1.2.1.tgz#3f76e443d94c932cbb47371177550df960137bb1" - integrity sha512-GlnuA9M2llCfKnLn0i3DdqCIia7O9JmQgMvRpjfy43G0F+HFQgYkYZOA8xkCQ8x/aEzBLYinPEvcqhqvcf7avw== - dependencies: - ses "^1.4.1" - "@endo/errors@^1.2.2": version "1.2.2" resolved "https://registry.yarnpkg.com/@endo/errors/-/errors-1.2.2.tgz#34d0f721df09c79744cd2cf89dddd3511bba64fa" @@ -1576,13 +1545,6 @@ "@babel/traverse" "^7.23.6" source-map "0.7.4" -"@endo/eventual-send@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@endo/eventual-send/-/eventual-send-1.2.1.tgz#d1b06deeb6c3eb21f7b733ba98e8fa6f050a6db1" - integrity sha512-sKj74NYl23apykZZ8zpjSPWdM0fxusyJ/52fyByIj+rJwlSMLYbuxW/6THwkmRpIkfG0UifPP/Kdt2tt1vllaw== - dependencies: - "@endo/env-options" "^1.1.3" - "@endo/eventual-send@^1.2.2": version "1.2.2" resolved "https://registry.yarnpkg.com/@endo/eventual-send/-/eventual-send-1.2.2.tgz#68cb93f104a9c5e28737be4358d6e58bfc624e1f" @@ -1603,16 +1565,7 @@ "@endo/pass-style" "^1.4.0" "@endo/patterns" "^1.4.0" -"@endo/far@^1.0.0": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@endo/far/-/far-1.1.1.tgz#c4df662e1fb3714d50606105bfe485ca01b1f2a5" - integrity sha512-ZTEngkTnqQ8Xee1alkuLCsnVNept6a9SwWyBd+BzLHwtDO87cO9dl2t6X1d8ntRzSDFQp7OFFInlXVhidCqqEw== - dependencies: - "@endo/errors" "^1.2.1" - "@endo/eventual-send" "^1.2.1" - "@endo/pass-style" "^1.3.1" - -"@endo/far@^1.1.2": +"@endo/far@^1.0.0", "@endo/far@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@endo/far/-/far-1.1.2.tgz#a120ce86f508ea06f0117861d16c6356f0f9d817" integrity sha512-cyq5ZbHwiLcvHal+uyhx5molas/SJhVvykmijxv0gT80RqclM7nU59fwnocmp42YljdpMsmPU/o2HP84uMchCg== @@ -1676,17 +1629,6 @@ "@endo/stream" "^1.2.2" ses "^1.5.0" -"@endo/pass-style@^1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@endo/pass-style/-/pass-style-1.3.1.tgz#12703d4ff1dd3ef926d397a4f25e132ed89a792d" - integrity sha512-aJuc22biDkd7F1LSdur7LQTd527d8+Afsg8TNl7sAEXei5ghy0oyloflRAMwF2Pp6VhlRLJFHCTVe9aktz9VhA== - dependencies: - "@endo/env-options" "^1.1.3" - "@endo/errors" "^1.2.1" - "@endo/eventual-send" "^1.2.1" - "@endo/promise-kit" "^1.1.1" - "@fast-check/ava" "^1.1.5" - "@endo/pass-style@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@endo/pass-style/-/pass-style-1.4.0.tgz#30b36b18fdc2646c1efb0386cb488df628fc119c" @@ -1709,13 +1651,6 @@ "@endo/marshal" "^1.5.0" "@endo/promise-kit" "^1.1.2" -"@endo/promise-kit@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@endo/promise-kit/-/promise-kit-1.1.1.tgz#1dbb70c7a0c51de788c6b81791885c5044ff33a1" - integrity sha512-Xpjx2b3jYOv3vgKclr+p6JDhz67SXgyshHTABU2wSR2gg5nk/aJNM73wZkJiijwZsGzNN8y3jeUChc8MSQs55g== - dependencies: - ses "^1.4.1" - "@endo/promise-kit@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@endo/promise-kit/-/promise-kit-1.1.2.tgz#0c4866be4e300e50595a5beb4e97e20a091ea1d5" @@ -1922,16 +1857,11 @@ dependencies: eslint-visitor-keys "^3.3.0" -"@eslint-community/regexpp@^4.10.0": +"@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.6.1": version "4.10.0" resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== -"@eslint-community/regexpp@^4.5.1", "@eslint-community/regexpp@^4.6.1": - version "4.6.2" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.6.2.tgz#1816b5f6948029c5eaacb0703b850ee0cb37d8f8" - integrity sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw== - "@eslint/eslintrc@^2.1.4": version "2.1.4" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad" @@ -3533,7 +3463,7 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/json-schema@*", "@types/json-schema@^7.0.11", "@types/json-schema@^7.0.12", "@types/json-schema@^7.0.15": +"@types/json-schema@*", "@types/json-schema@^7.0.11", "@types/json-schema@^7.0.15": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== @@ -3666,11 +3596,6 @@ resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.2.tgz#ed279a64fa438bb69f2480eda44937912bb7480a" integrity sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow== -"@types/semver@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" - integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== - "@types/semver@^7.5.8": version "7.5.8" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" @@ -3719,24 +3644,7 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@7.3.1", "@typescript-eslint/eslint-plugin@^7.0.1": - version "7.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.3.1.tgz#0d8f38a6c8a1802139e62184ee7a68ed024f30a1" - integrity sha512-STEDMVQGww5lhCuNXVSQfbfuNII5E08QWkvAw5Qwf+bj2WT+JkG1uc+5/vXA3AOYMDHVOSpL+9rcbEUiHIm2dw== - dependencies: - "@eslint-community/regexpp" "^4.5.1" - "@typescript-eslint/scope-manager" "7.3.1" - "@typescript-eslint/type-utils" "7.3.1" - "@typescript-eslint/utils" "7.3.1" - "@typescript-eslint/visitor-keys" "7.3.1" - debug "^4.3.4" - graphemer "^1.4.0" - ignore "^5.2.4" - natural-compare "^1.4.0" - semver "^7.5.4" - ts-api-utils "^1.0.1" - -"@typescript-eslint/eslint-plugin@7.7.1": +"@typescript-eslint/eslint-plugin@7.7.1", "@typescript-eslint/eslint-plugin@^7.0.1": version "7.7.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.7.1.tgz#50a9044e3e5fe76b22caf64fb7fc1f97614bdbfd" integrity sha512-KwfdWXJBOviaBVhxO3p5TJiLpNuh2iyXyjmWN0f1nU87pwyvfS0EmjC6ukQVYVFJd/K1+0NWGPDXiyEyQorn0Q== @@ -3753,18 +3661,7 @@ semver "^7.6.0" ts-api-utils "^1.3.0" -"@typescript-eslint/parser@7.3.1", "@typescript-eslint/parser@^7.0.1": - version "7.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.3.1.tgz#c4ba7dc2744318a5e4506596cbc3a0086255c526" - integrity sha512-Rq49+pq7viTRCH48XAbTA+wdLRrB/3sRq4Lpk0oGDm0VmnjBrAOVXH/Laalmwsv2VpekiEfVFwJYVk6/e8uvQw== - dependencies: - "@typescript-eslint/scope-manager" "7.3.1" - "@typescript-eslint/types" "7.3.1" - "@typescript-eslint/typescript-estree" "7.3.1" - "@typescript-eslint/visitor-keys" "7.3.1" - debug "^4.3.4" - -"@typescript-eslint/parser@7.7.1": +"@typescript-eslint/parser@7.7.1", "@typescript-eslint/parser@^7.0.1": version "7.7.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.7.1.tgz#f940e9f291cdca40c46cb75916217d3a42d6ceea" integrity sha512-vmPzBOOtz48F6JAGVS/kZYk4EkXao6iGrD838sp1w3NQQC0W8ry/q641KU4PrG7AKNAf56NOcR8GOpH8l9FPCw== @@ -3775,14 +3672,6 @@ "@typescript-eslint/visitor-keys" "7.7.1" debug "^4.3.4" -"@typescript-eslint/scope-manager@7.3.1": - version "7.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.3.1.tgz#73fd0cb4211a7be23e49e5b6efec8820caa6ec36" - integrity sha512-fVS6fPxldsKY2nFvyT7IP78UO1/I2huG+AYu5AMjCT9wtl6JFiDnsv4uad4jQ0GTFzcUV5HShVeN96/17bTBag== - dependencies: - "@typescript-eslint/types" "7.3.1" - "@typescript-eslint/visitor-keys" "7.3.1" - "@typescript-eslint/scope-manager@7.7.1": version "7.7.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.7.1.tgz#07fe59686ca843f66e3e2b5c151522bc38effab2" @@ -3791,16 +3680,6 @@ "@typescript-eslint/types" "7.7.1" "@typescript-eslint/visitor-keys" "7.7.1" -"@typescript-eslint/type-utils@7.3.1": - version "7.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.3.1.tgz#cbf90d3d7e788466aa8a5c0ab3f46103f098aa0d" - integrity sha512-iFhaysxFsMDQlzJn+vr3OrxN8NmdQkHks4WaqD4QBnt5hsq234wcYdyQ9uquzJJIDAj5W4wQne3yEsYA6OmXGw== - dependencies: - "@typescript-eslint/typescript-estree" "7.3.1" - "@typescript-eslint/utils" "7.3.1" - debug "^4.3.4" - ts-api-utils "^1.0.1" - "@typescript-eslint/type-utils@7.7.1": version "7.7.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.7.1.tgz#2f8094edca3bebdaad009008929df645ed9c8743" @@ -3811,17 +3690,12 @@ debug "^4.3.4" ts-api-utils "^1.3.0" -"@typescript-eslint/types@7.3.1": - version "7.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.3.1.tgz#ae104de8efa4227a462c0874d856602c5994413c" - integrity sha512-2tUf3uWggBDl4S4183nivWQ2HqceOZh1U4hhu4p1tPiIJoRRXrab7Y+Y0p+dozYwZVvLPRI6r5wKe9kToF9FIw== - "@typescript-eslint/types@7.7.1": version "7.7.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.7.1.tgz#f903a651fb004c75add08e4e9e207f169d4b98d7" integrity sha512-AmPmnGW1ZLTpWa+/2omPrPfR7BcbUU4oha5VIbSbS1a1Tv966bklvLNXxp3mrbc+P2j4MNOTfDffNsk4o0c6/w== -"@typescript-eslint/typescript-estree@7.3.1", "@typescript-eslint/typescript-estree@7.7.1", "@typescript-eslint/typescript-estree@^7.7.1": +"@typescript-eslint/typescript-estree@7.7.1", "@typescript-eslint/typescript-estree@^7.7.1": version "7.7.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.7.1.tgz#5cafde48fe390fe1c1b329b2ce0ba8a73c1e87b2" integrity sha512-CXe0JHCXru8Fa36dteXqmH2YxngKJjkQLjxzoj6LYwzZ7qZvgsLSc+eqItCrqIop8Vl2UKoAi0StVWu97FQZIQ== @@ -3835,19 +3709,6 @@ semver "^7.6.0" ts-api-utils "^1.3.0" -"@typescript-eslint/utils@7.3.1": - version "7.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.3.1.tgz#fc28fd508ccf89495012561b7c02a6fdad162460" - integrity sha512-jIERm/6bYQ9HkynYlNZvXpzmXWZGhMbrOvq3jJzOSOlKXsVjrrolzWBjDW6/TvT5Q3WqaN4EkmcfdQwi9tDjBQ== - dependencies: - "@eslint-community/eslint-utils" "^4.4.0" - "@types/json-schema" "^7.0.12" - "@types/semver" "^7.5.0" - "@typescript-eslint/scope-manager" "7.3.1" - "@typescript-eslint/types" "7.3.1" - "@typescript-eslint/typescript-estree" "7.3.1" - semver "^7.5.4" - "@typescript-eslint/utils@7.7.1": version "7.7.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.7.1.tgz#5d161f2b4a55e1bc38b634bebb921e4bd4e4a16e" @@ -3861,14 +3722,6 @@ "@typescript-eslint/typescript-estree" "7.7.1" semver "^7.6.0" -"@typescript-eslint/visitor-keys@7.3.1": - version "7.3.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.3.1.tgz#6ddef14a3ce2a79690f01176f5305c34d7b93d8c" - integrity sha512-9RMXwQF8knsZvfv9tdi+4D/j7dMG28X/wMJ8Jj6eOHyHWwDW4ngQJcqEczSsqIKKjFiLFr40Mnr7a5ulDD3vmw== - dependencies: - "@typescript-eslint/types" "7.3.1" - eslint-visitor-keys "^3.4.1" - "@typescript-eslint/visitor-keys@7.7.1": version "7.7.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.7.1.tgz#da2294796220bb0f3b4add5ecbb1b9c3f4f65798" @@ -7179,12 +7032,7 @@ ignore-walk@^5.0.1: dependencies: minimatch "^5.0.1" -ignore@^5.0.4, ignore@^5.0.5, ignore@^5.2.0, ignore@^5.2.4: - version "5.2.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" - integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== - -ignore@^5.3.1: +ignore@^5.0.4, ignore@^5.0.5, ignore@^5.2.0, ignore@^5.2.4, ignore@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== @@ -10660,13 +10508,6 @@ serve-static@1.15.0: parseurl "~1.3.3" send "0.18.0" -ses@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/ses/-/ses-1.4.1.tgz#ee60fa9f49bb898250aa8eb8bb3738c48fab438f" - integrity sha512-supQWVgHzf+JNHCwQh4Vx/IKL6hBuHo8HnXMTy3zypqZyT9VSzfRVH7MR+EIcXm6oeG5UpAfPlwG0HfQqM3/pQ== - dependencies: - "@endo/env-options" "^1.1.3" - ses@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/ses/-/ses-1.5.0.tgz#c1b8491a77fb3ee8141bb9ffa6247fe5b45dfe45" @@ -11431,7 +11272,7 @@ triple-beam@^1.3.0: resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.4.1.tgz#6fde70271dc6e5d73ca0c3b24e2d92afb7441984" integrity sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg== -ts-api-utils@^1.0.1, ts-api-utils@^1.3.0: +ts-api-utils@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== @@ -11670,15 +11511,7 @@ typedoc@^0.25.13: minimatch "^9.0.3" shiki "^0.14.7" -typescript-eslint@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-7.3.1.tgz#9f4808abea3b33c4dd3bb51dd801471e91d1bd58" - integrity sha512-psqcnHPRCdVIDbgj6RvfpwUKqMcNxIw7eizgxYi46X2BmXK6LxYqPD+SbDfPuA9JW+yPItY6aKJLRNbW7lZ4rA== - dependencies: - "@typescript-eslint/eslint-plugin" "7.3.1" - "@typescript-eslint/parser" "7.3.1" - -typescript-eslint@^7.7.1: +typescript-eslint@^7.3.1, typescript-eslint@^7.7.1: version "7.7.1" resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-7.7.1.tgz#16f82e83bb0955af02f258cb7a9de59e1bfb8706" integrity sha512-ykEBfa3xx3odjZy6GRED4SCPrjo0rgHwstLlEgLX4EMEuv7QeIDSmfV+S6Kk+XkbsYn4BDEcPvsci1X26lRpMQ== From f83c530c8d2d143e7261078f996be0c1733af245 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 8 May 2024 12:40:24 -0700 Subject: [PATCH 57/57] test: use vatsafe import for proposal --- packages/vats/src/proposals/localchain-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vats/src/proposals/localchain-test.js b/packages/vats/src/proposals/localchain-test.js index 8d91a3be57a0..41318e33bc9e 100644 --- a/packages/vats/src/proposals/localchain-test.js +++ b/packages/vats/src/proposals/localchain-test.js @@ -1,6 +1,6 @@ // @ts-check import { E } from '@endo/far'; -import { typedJson } from '@agoric/cosmic-proto'; +import { typedJson } from '@agoric/cosmic-proto/vatsafe'; /** * @param {BootstrapPowers & {