Skip to content

Commit

Permalink
chore(bootstrap-exports): revert vaults-upgrade.test.js
Browse files Browse the repository at this point in the history
Refs: #10425
  • Loading branch information
anilhelvaci committed Nov 20, 2024
1 parent ad90b6e commit ff167e4
Showing 1 changed file with 13 additions and 38 deletions.
51 changes: 13 additions & 38 deletions packages/boot/test/bootstrapTests/vaults-upgrade.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,15 @@ test.serial('re-bootstrap', async t => {
test.serial('audit bootstrap exports', async t => {
const expected = {
maxExports: 5,
maxNonDurable: 4,
maxNonDurable: 5,
ifaces: {
durable: {
// in bridgeProvisioner()
provisioningHandler: true,
},
nonDurable: {
// in bridgeCoreEval()
coreHandler: true,
'prioritySenders manager': true,
// TODO? move to provisioning vat?
clientCreator: true,
},
// in bridgeCoreEval()
coreHandler: true,
// in bridgeProvisioner()
provisioningHandler: true,
'prioritySenders manager': true,
// TODO? move to provisioning vat?
clientCreator: true,
},
};

Expand Down Expand Up @@ -225,45 +221,24 @@ test.serial('audit bootstrap exports', async t => {
const { methargs } = sc.s[2];
if (!methargs.slots.includes(oid)) continue;
m.fromCapData(methargs);
break;
return;
} else if (sc.s[0] === 'resolve') {
for (const res of sc.s[1]) {
const capdata = res[2];
if (!capdata.slots.includes(oid)) continue;
m.fromCapData(capdata);
break;
return;
}
}
}
}
}

const exportedInterfacesNonDurable = Object.fromEntries(
[...toIface.entries()]
.filter(([slot, _]) => !slot.startsWith('o+d'))
.map(([_, iface]) => [iface.replace(/^Alleged: /, ''), true]),
const exportedInterfaces = Object.fromEntries(
[...toIface.values()].map(iface => [iface.replace(/^Alleged: /, ''), true]),
);

const exportedInterfacesDurable = Object.fromEntries(
[...toIface.entries()]
.filter(([slot, _]) => slot.startsWith('o+d'))
.map(([_, iface]) => [iface.replace(/^Alleged: /, ''), true]),
);

t.deepEqual(
exportedInterfacesNonDurable,
expected.ifaces.nonDurable,
'expected non-durable interfaces',
);
t.deepEqual(
exportedInterfacesDurable,
expected.ifaces.durable,
'expected durable interfaces',
);
t.true(
oids.size - oidsDurable.length <= expected.maxNonDurable,
'too many non-durable',
);
t.deepEqual(exportedInterfaces, expected.ifaces, 'expected interfaces');
});

test.serial('open vault', async t => {
Expand Down

0 comments on commit ff167e4

Please sign in to comment.