Skip to content

Commit

Permalink
fix: make verbose flag work from the very beginning
Browse files Browse the repository at this point in the history
  • Loading branch information
FUDCo committed Jul 13, 2021
1 parent 664f2c1 commit 7edfa24
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/SwingSet/src/initializeSwingset.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import bundleSource from '@agoric/bundle-source';
import './types.js';
import { insistStorageAPI } from './storageAPI.js';
import { initializeKernel } from './kernel/initializeKernel.js';
import { kdebugEnable } from './kernel/kdebug.js';

/**
* @param {X[]} xs
Expand Down Expand Up @@ -218,7 +219,7 @@ export function swingsetIsInitialized(hostStorage) {
* @param {SwingSetConfig} config
* @param {string[]} argv
* @param {HostStore} hostStorage
* @param {{ kernelBundles?: Record<string, string> }} initializationOptions
* @param {{ kernelBundles?: Record<string, string>, verbose?: boolean }} initializationOptions
* @param {{ env?: Record<string, string | undefined > }} runtimeOptions
*/
export async function initializeSwingset(
Expand Down Expand Up @@ -266,7 +267,10 @@ export async function initializeSwingset(
assert.fail(X`unknown manager type ${defaultManagerType}`);
}

const { kernelBundles = await buildKernelBundles() } = initializationOptions;
const {
kernelBundles = await buildKernelBundles(),
verbose,
} = initializationOptions;

kvStore.set('kernelBundle', JSON.stringify(kernelBundles.kernel));
kvStore.set('lockdownBundle', JSON.stringify(kernelBundles.lockdown));
Expand Down Expand Up @@ -386,5 +390,8 @@ export async function initializeSwingset(
await bundleBundles(config.vats, 'vats');
await bundleBundles(config.devices, 'devices');

if (verbose) {
kdebugEnable(true);
}
return initializeKernel(config, hostStorage);
}

0 comments on commit 7edfa24

Please sign in to comment.