Skip to content

Commit

Permalink
fix(spawner): set 'metered: true' for dynamic vats
Browse files Browse the repository at this point in the history
since this will no longer be the default soon
  • Loading branch information
warner committed Jul 24, 2021
1 parent 32967ca commit 3a9cf0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/spawner/src/contractHost.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ function makeSpawner(vatAdminSvc) {
assert(!oldModuleFormat, 'oldModuleFormat not supported');
return Far('installer', {
async spawn(argsP) {
const { root } = await E(vatAdminSvc).createVat(spawnBundle);
const opts = { metered: true };
const { root } = await E(vatAdminSvc).createVat(spawnBundle, opts);
return E(E(root).loadBundle(bundle)).start(argsP);
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ test.before(async t => {
t.context.data = { kernelBundles, trivialBundle };
});

async function main(t, mode, defaultManagerType = 'local') {
async function main(t, mode) {
const config = await loadBasedir(__dirname);
config.defaultManagerType = defaultManagerType;
config.defaultManagerType = 'xs-worker';
const { kernelBundles, trivialBundle } = t.context.data;
const argv = [mode, trivialBundle];
const controller = await buildVatController(config, argv, { kernelBundles });
Expand All @@ -48,6 +48,6 @@ const contractExhaustedGolden = [
];

test('exhaustion', async t => {
const dump = await main(t, 'exhaust', 'xs-worker');
const dump = await main(t, 'exhaust');
t.deepEqual(dump.log, contractExhaustedGolden);
});

0 comments on commit 3a9cf0b

Please sign in to comment.