From 5b2e20ce76608b610a3e612c5bca1fa569be14e3 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Tue, 19 Nov 2024 20:35:52 -0500 Subject: [PATCH] chore(a3p-integration): Type-check s:stake-bld --- .../proposals/s:stake-bld/package.json | 5 ++++- .../proposals/s:stake-bld/stakeBld.test.js | 9 ++++++--- .../proposals/s:stake-bld/test-lib/rpc.js | 2 +- .../proposals/s:stake-bld/test-lib/wallet.js | 1 + .../proposals/s:stake-bld/tsconfig.json | 16 ++++++++++++++++ a3p-integration/proposals/s:stake-bld/yarn.lock | 17 +++++++++++++++++ 6 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 a3p-integration/proposals/s:stake-bld/tsconfig.json diff --git a/a3p-integration/proposals/s:stake-bld/package.json b/a3p-integration/proposals/s:stake-bld/package.json index 477b95ba07a..7351caacb7c 100644 --- a/a3p-integration/proposals/s:stake-bld/package.json +++ b/a3p-integration/proposals/s:stake-bld/package.json @@ -23,5 +23,8 @@ "ava": { "concurrency": 1 }, - "packageManager": "yarn@4.5.1" + "packageManager": "yarn@4.5.1", + "devDependencies": { + "@types/node": "^22.0.0" + } } diff --git a/a3p-integration/proposals/s:stake-bld/stakeBld.test.js b/a3p-integration/proposals/s:stake-bld/stakeBld.test.js index 9333fb302eb..549e4562545 100644 --- a/a3p-integration/proposals/s:stake-bld/stakeBld.test.js +++ b/a3p-integration/proposals/s:stake-bld/stakeBld.test.js @@ -30,6 +30,9 @@ test('basic', async t => { t.is((await currentDelegation()).length, 1, 'just the initial delegation'); + /** @type {import('@agoric/ertp').Brand} */ + const BLDBrand = brand.BLD; + await walletUtils.broadcastBridgeAction(GOV1ADDR, { method: 'executeOffer', offer: { @@ -41,7 +44,7 @@ test('basic', async t => { }, proposal: { give: { - In: { brand: brand.BLD, value: 10n }, + In: { brand: BLDBrand, value: 10n }, }, }, }, @@ -55,11 +58,11 @@ test('basic', async t => { source: 'continuing', previousOffer: 'request-stake', invitationMakerName: 'Delegate', - invitationArgs: [VALIDATOR_ADDRESS, { brand: brand.BLD, value: 10n }], + invitationArgs: [VALIDATOR_ADDRESS, { brand: BLDBrand, value: 10n }], }, proposal: { give: { - In: { brand: brand.BLD, value: 10n }, + In: { brand: BLDBrand, value: 10n }, }, }, }, diff --git a/a3p-integration/proposals/s:stake-bld/test-lib/rpc.js b/a3p-integration/proposals/s:stake-bld/test-lib/rpc.js index 1d62aedf1be..a3ac266ee88 100644 --- a/a3p-integration/proposals/s:stake-bld/test-lib/rpc.js +++ b/a3p-integration/proposals/s:stake-bld/test-lib/rpc.js @@ -1,7 +1,7 @@ /** @file copied from packages/agoric-cli */ // TODO DRY in https://github.com/Agoric/agoric-sdk/issues/9109 // @ts-check -/* global Buffer */ +/* eslint-env node */ import { Fail } from '@endo/errors'; import { diff --git a/a3p-integration/proposals/s:stake-bld/test-lib/wallet.js b/a3p-integration/proposals/s:stake-bld/test-lib/wallet.js index 53d9634e278..e9461522e1d 100644 --- a/a3p-integration/proposals/s:stake-bld/test-lib/wallet.js +++ b/a3p-integration/proposals/s:stake-bld/test-lib/wallet.js @@ -29,6 +29,7 @@ import { makeVstorageKit } from './rpc.js'; */ export const sendAction = async (bridgeAction, opts) => { const { marshaller } = opts; + // @ts-expect-error BridgeAction has methods disallowed by Passable const offerBody = JSON.stringify(marshaller.toCapData(harden(bridgeAction))); // tryExit should not require --allow-spend diff --git a/a3p-integration/proposals/s:stake-bld/tsconfig.json b/a3p-integration/proposals/s:stake-bld/tsconfig.json new file mode 100644 index 00000000000..8672f62769d --- /dev/null +++ b/a3p-integration/proposals/s:stake-bld/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "noEmit": true, + "target": "esnext", + "module": "esnext", + "moduleResolution": "bundler", + "allowJs": true, + "checkJs": true, + "strict": false, + "strictNullChecks": true, + "noImplicitThis": true, + // XXX synthetic-chain has some errors + "skipLibCheck": true + }, + "exclude": ["submission"] +} diff --git a/a3p-integration/proposals/s:stake-bld/yarn.lock b/a3p-integration/proposals/s:stake-bld/yarn.lock index 513c7872fe3..1d13185abe2 100644 --- a/a3p-integration/proposals/s:stake-bld/yarn.lock +++ b/a3p-integration/proposals/s:stake-bld/yarn.lock @@ -1574,6 +1574,15 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:^22.0.0": + version: 22.9.1 + resolution: "@types/node@npm:22.9.1" + dependencies: + undici-types: "npm:~6.19.8" + checksum: 10c0/ea489ae603aa8874e4e88980aab6f2dad09c755da779c88dd142983bfe9609803c89415ca7781f723072934066f63daf2b3339ef084a8ad1a8079cf3958be243 + languageName: node + linkType: hard + "@types/resolve@npm:1.17.1": version: 1.17.1 resolution: "@types/resolve@npm:1.17.1" @@ -4689,6 +4698,7 @@ __metadata: "@endo/errors": "npm:^1.2.2" "@endo/far": "npm:^1.0.4" "@endo/init": "npm:^1.0.4" + "@types/node": "npm:^22.0.0" agoric: "npm:0.21.2-dev-5676146.0" ava: "npm:^5.3.1" execa: "npm:^8.0.1" @@ -5290,6 +5300,13 @@ __metadata: languageName: node linkType: hard +"undici-types@npm:~6.19.8": + version: 6.19.8 + resolution: "undici-types@npm:6.19.8" + checksum: 10c0/078afa5990fba110f6824823ace86073b4638f1d5112ee26e790155f481f2a868cc3e0615505b6f4282bdf74a3d8caad715fd809e870c2bb0704e3ea6082f344 + languageName: node + linkType: hard + "unicorn-magic@npm:^0.3.0": version: 0.3.0 resolution: "unicorn-magic@npm:0.3.0"