From d03c157f751d710af2f3dddc62f108a42b341f81 Mon Sep 17 00:00:00 2001 From: Chris Hibbert Date: Wed, 1 May 2024 17:36:15 -0700 Subject: [PATCH] test: repair some tests --- .../bootstrapTests/test-vaults-upgrade.ts | 21 +++++++++++++++++-- .../contractGovernor/test-governor.js | 4 ++-- .../unitTests/test-puppetContractGovernor.js | 2 +- .../inter-protocol/src/vaultFactory/params.js | 6 +++--- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/packages/boot/test/bootstrapTests/test-vaults-upgrade.ts b/packages/boot/test/bootstrapTests/test-vaults-upgrade.ts index a580a039fbf..cb7cf1233b7 100644 --- a/packages/boot/test/bootstrapTests/test-vaults-upgrade.ts +++ b/packages/boot/test/bootstrapTests/test-vaults-upgrade.ts @@ -287,8 +287,25 @@ test.serial('restart vaultFactory', async t => { 'vaultFactoryKit', ) as EconomyBootstrapSpace['consume']['vaultFactoryKit']); - // @ts-expect-error cast XXX missing from type - const { privateArgs } = vaultFactoryKit; + const reserveKit = await (EV.vat('bootstrap').consumeItem( + 'reserveKit', + ) as EconomyBootstrapSpace['consume']['reserveKit']); + const bootstrapVat = EV.vat('bootstrap'); + const electorateCreatorFacet = await (bootstrapVat.consumeItem( + 'economicCommitteeCreatorFacet', + ) as EconomyBootstrapSpace['consume']['economicCommitteeCreatorFacet']); + + const poserInvitation = await EV(electorateCreatorFacet).getPoserInvitation(); + const creatorFacet1 = await EV.get(reserveKit).creatorFacet; + const shortfallInvitation = + await EV(creatorFacet1).makeShortfallReportingInvitation(); + + const privateArgs = { + // @ts-expect-error cast XXX missing from type + ...vaultFactoryKit.privateArgs, + initialPoserInvitation: poserInvitation, + initialShortfallInvitation: shortfallInvitation, + }; console.log('reused privateArgs', privateArgs, vaultFactoryKit); const vfAdminFacet = await EV( diff --git a/packages/governance/test/swingsetTests/contractGovernor/test-governor.js b/packages/governance/test/swingsetTests/contractGovernor/test-governor.js index 944f419e7f1..d1bb1317bc5 100644 --- a/packages/governance/test/swingsetTests/contractGovernor/test-governor.js +++ b/packages/governance/test/swingsetTests/contractGovernor/test-governor.js @@ -162,8 +162,8 @@ test.serial('brokenUpdateStart', async t => { // TODO: allow either message // 'vote rejected outcome: Error: (an object) was not a live payment for brand (an object). It could be a used-up payment, a payment for another brand, or it might not be a payment at all.', // 'update failed: Error: (an object) was not a live payment for brand (an object). It could be a used-up payment, a payment for another brand, or it might not be a payment at all.', - 'vote rejected outcome: Error: A Zoe invitation is required, not (an object)', - 'update failed: Error: A Zoe invitation is required, not (an object)', + 'vote rejected outcome: Error: (an object) was not a live payment for brand "[Alleged: Zoe Invitation brand]". It could be a used-up payment, a payment for another brand, or it might not be a payment at all.', + 'update failed: Error: (an object) was not a live payment for brand "[Alleged: Zoe Invitation brand]". It could be a used-up payment, a payment for another brand, or it might not be a payment at all.', ]); }); diff --git a/packages/governance/test/unitTests/test-puppetContractGovernor.js b/packages/governance/test/unitTests/test-puppetContractGovernor.js index 161cefe6a22..1664e28e867 100644 --- a/packages/governance/test/unitTests/test-puppetContractGovernor.js +++ b/packages/governance/test/unitTests/test-puppetContractGovernor.js @@ -59,7 +59,7 @@ test('multiple params bad change', async t => { () => E(governorFacets.creatorFacet).changeParams(paramChangesSpec), { message: - 'In "getInvitationDetails" method of (ZoeService): arg 0: "[13n]" - Must match one of ["[match:remotable]","[match:kind]"]', + 'In "getAmountOf" method of (Zoe Invitation issuer): arg 0: "[13n]" - Must be a remotable Payment, not bigint', }, ); }); diff --git a/packages/inter-protocol/src/vaultFactory/params.js b/packages/inter-protocol/src/vaultFactory/params.js index eb41132f475..5ede6100a1c 100644 --- a/packages/inter-protocol/src/vaultFactory/params.js +++ b/packages/inter-protocol/src/vaultFactory/params.js @@ -212,9 +212,9 @@ export const provideVaultParamManagers = ( // restore from baggage, unless `managerParamOverrides` overrides. for (const [brand, args] of managerArgs.entries()) { - const newInitial = Object.values(managerParamOverrides).find( - e => e.brand === brand, - ); + const newInitial = managerParamOverrides + ? Object.values(managerParamOverrides).find(e => e.brand === brand) + : undefined; if (newInitial) { trace(`reviving params, override`, brand, newInitial);