Skip to content

Commit

Permalink
test: repair some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Hibbert committed May 6, 2024
1 parent cda41ee commit cadd1b2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
21 changes: 19 additions & 2 deletions packages/boot/test/bootstrapTests/test-vaults-upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
]);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
);
});
Expand Down
6 changes: 3 additions & 3 deletions packages/inter-protocol/src/vaultFactory/params.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cadd1b2

Please sign in to comment.