diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index bd1735f3c72..fd544d7836c 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -22,7 +22,7 @@ "lint": "exit 0" }, "files": [ - "eslint-config.json" + "eslint-config.*" ], "peerDependencies": { "@endo/eslint-plugin": "0.4.4", diff --git a/packages/governance/test/unitTests/test-puppetContractGovernor.js b/packages/governance/test/unitTests/test-puppetContractGovernor.js index 173523739f3..05574bf4854 100644 --- a/packages/governance/test/unitTests/test-puppetContractGovernor.js +++ b/packages/governance/test/unitTests/test-puppetContractGovernor.js @@ -6,6 +6,7 @@ import buildManualTimer from '@agoric/zoe/tools/manualTimer.js'; import bundleSource from '@endo/bundle-source'; import { E } from '@endo/eventual-send'; import { resolve as importMetaResolve } from 'import-meta-resolve'; +import { AssetKind, makeIssuerKit } from '@agoric/ertp'; import { CONTRACT_ELECTORATE, ParamTypes } from '../../src/index.js'; import { setUpGovernedContract } from '../../tools/puppetGovernance.js'; @@ -157,3 +158,20 @@ test('call API directly', async t => { 1, ); }); + +test('add issuerKeywordRecord', async t => { + const zoe = await makeZoeForTest(); + const issuerKit = makeIssuerKit('Food', AssetKind.COPY_BAG); + const timer = buildManualTimer(t.log); + const { governorFacets } = await setUpGovernedContract( + zoe, + E(zoe).install(governedBundleP), + timer, + governedTerms, + {}, + { Food: issuerKit.issuer }, + ); + + const instance = await E(governorFacets.creatorFacet).getInstance(); + t.deepEqual(await E(zoe).getIssuers(instance), { Food: issuerKit.issuer }); +}); diff --git a/packages/governance/tools/puppetGovernance.js b/packages/governance/tools/puppetGovernance.js index 4f41593befe..038864c2366 100644 --- a/packages/governance/tools/puppetGovernance.js +++ b/packages/governance/tools/puppetGovernance.js @@ -28,6 +28,7 @@ const autoRefundBundleP = makeBundle( * @param {import('@agoric/swingset-vat/src/vats/timer/vat-timer.js').TimerService} timer * @param {{ [k: string]: any, governedParams?: Record, governedApis?: string[] }} termsOfGoverned * @param {{}} privateArgsOfGoverned + * @param {IssuerKeywordRecord} [issuerKeywordRecord] */ export const setUpGovernedContract = async ( zoe, @@ -35,6 +36,7 @@ export const setUpGovernedContract = async ( timer, termsOfGoverned = {}, privateArgsOfGoverned = {}, + issuerKeywordRecord = {}, ) => { const [contractGovernorBundle, autoRefundBundle] = await Promise.all([ contractGovernorBundleP, @@ -87,7 +89,7 @@ export const setUpGovernedContract = async ( governedContractInstallation: governed, governed: { terms: governedTermsWithElectorate, - issuerKeywordRecord: {}, + issuerKeywordRecord, }, }; diff --git a/packages/internal/src/node/createBundles.js b/packages/internal/src/node/createBundles.js index e78078bd744..d17d1bb45ea 100644 --- a/packages/internal/src/node/createBundles.js +++ b/packages/internal/src/node/createBundles.js @@ -1,3 +1,4 @@ +/* global process */ // Use modules not prefixed with `node:` since some deploy scripts may // still be running in esm emulation import path from 'path'; @@ -29,7 +30,13 @@ export const createBundlesFromAbsolute = async sourceBundles => { for (const args of cacheToArgs.values()) { console.log(BUNDLE_SOURCE_PROGRAM, ...args); - const { status } = spawnSync(prog, args, { stdio: 'inherit' }); + const env = /** @type {NodeJS.ProcessEnv} */ ( + /** @type {unknown} */ ({ + __proto__: process.env, + LOCKDOWN_OVERRIDE_TAMING: 'severe', + }) + ); + const { status } = spawnSync(prog, args, { stdio: 'inherit', env }); status === 0 || Fail`${q(BUNDLE_SOURCE_PROGRAM)} failed with status ${q(status)}`; } diff --git a/packages/smart-wallet/src/walletFactory.js b/packages/smart-wallet/src/walletFactory.js index b7ad6709bd6..bc9cb0c8c48 100644 --- a/packages/smart-wallet/src/walletFactory.js +++ b/packages/smart-wallet/src/walletFactory.js @@ -142,6 +142,7 @@ export const makeAssetRegistry = assetPublisher => { * @param {import('@agoric/vat-data').Baggage} baggage */ export const prepare = async (zcf, privateArgs, baggage) => { + const upgrading = baggage.has('walletsByAddress'); const { agoricNames, board, assetPublisher } = zcf.getTerms(); const zoe = zcf.getZoeService(); @@ -292,7 +293,6 @@ export const prepare = async (zcf, privateArgs, baggage) => { if (walletBridgeManager) { // NB: may not be in service when creatorFacet is used, or ever // It can't be awaited because that fails vat restart - const upgrading = baggage.has('walletsByAddress'); if (upgrading) { void E(walletBridgeManager).setHandler(handleWalletAction); } else { diff --git a/packages/smart-wallet/test/supports.js b/packages/smart-wallet/test/supports.js index dd51dc9c75e..6c8e7a8d03c 100644 --- a/packages/smart-wallet/test/supports.js +++ b/packages/smart-wallet/test/supports.js @@ -76,9 +76,11 @@ const makeFakeBridgeManager = () => return E(handler).fromBridge(obj); }, initHandler(newHandler) { + !handler || Fail`Handler already set`; handler = newHandler; }, setHandler(newHandler) { + !!handler || Fail`Handler not set`; handler = newHandler; }, }); diff --git a/packages/solo/src/entrypoint.js b/packages/solo/src/entrypoint.js index bde40a0f0f1..4ca2f5601af 100755 --- a/packages/solo/src/entrypoint.js +++ b/packages/solo/src/entrypoint.js @@ -7,7 +7,7 @@ import 'esm'; // we need to enable Math.random as a workaround for 'brace-expansion' module // (dep chain: temp->glob->minimatch->brace-expansion) -import '@endo/init'; +import '@endo/init/legacy.js'; import process from 'process'; import path from 'path'; diff --git a/packages/solo/src/pipe-entrypoint.js b/packages/solo/src/pipe-entrypoint.js index e03c0b9ac55..5c6803fa8e5 100644 --- a/packages/solo/src/pipe-entrypoint.js +++ b/packages/solo/src/pipe-entrypoint.js @@ -1,7 +1,7 @@ /* global process */ // @ts-check import '@endo/init/pre-bundle-source.js'; -import '@endo/init'; +import '@endo/init/unsafe-fast.js'; import { parse, stringify } from '@endo/marshal'; import { makePromiseKit } from '@endo/promise-kit'; diff --git a/packages/solo/src/start.js b/packages/solo/src/start.js index e9c6684e5f1..443397ec1f7 100644 --- a/packages/solo/src/start.js +++ b/packages/solo/src/start.js @@ -483,8 +483,14 @@ const start = async (basedir, argv) => { const { 'agoric-wallet': { htmlBasedir = 'ui/build', deploy = [] } = {} } = JSON.parse(fs.readFileSync(pjs, 'utf-8')); + const htmlBasePath = String(htmlBasedir).replace( + /^\.\.\/\.\.\/node_modules\//, + '', + ); + const agWallet = path.dirname(pjs); - const agWalletHtml = path.resolve(agWallet, htmlBasedir); + const agWalletHtmlUrl = await importMetaResolve(htmlBasePath, packageUrl); + const agWalletHtml = new URL(agWalletHtmlUrl).pathname; let hostport; await Promise.all( diff --git a/packages/swingset-liveslots/package.json b/packages/swingset-liveslots/package.json index 6b015f09882..025c60b49fb 100644 --- a/packages/swingset-liveslots/package.json +++ b/packages/swingset-liveslots/package.json @@ -38,6 +38,7 @@ "src/**/*.js", "src/**/*.d.ts", "test/**/*.js", + "tools", "exported.js" ], "repository": { diff --git a/packages/wallet/package.json b/packages/wallet/package.json index e4f0214a620..a9891d9016f 100644 --- a/packages/wallet/package.json +++ b/packages/wallet/package.json @@ -6,7 +6,7 @@ "license": "Apache-2.0", "author": "Agoric", "agoric-wallet": { - "htmlBasedir": "../../node_modules/@agoric/wallet-ui/build", + "htmlBasedir": "@agoric/wallet-ui/build", "deploy": [ "./api/deploy.js" ]