Skip to content

Commit

Permalink
feat: swingset-runner zoe demos to use pre-bundled zcf
Browse files Browse the repository at this point in the history
  • Loading branch information
FUDCo committed Aug 12, 2020
1 parent a9200b4 commit 3df964a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 7 deletions.
4 changes: 3 additions & 1 deletion packages/SwingSet/src/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ export function loadSwingsetConfigFile(configPath) {
if (!config.bootstrap) {
throw Error(`no designated bootstrap vat in ${configPath}`);
} else if (!config.vats[config.bootstrap]) {
throw Error(`bootstrap vat ${config.bootstrap} not found in ${configPath}`);
throw Error(
`bootstrap vat ${config.bootstrap} not found in ${configPath}`,
);
}
return config;
} catch (e) {
Expand Down
25 changes: 25 additions & 0 deletions packages/swingset-runner/demo/exchangeBenchmark/swingset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"bootstrap": "bootstrap",
"bundles": {
"zcf": {
"sourcePath": "../../../zoe/src/contractFacet.js"
}
},
"vats": {
"alice": {
"sourcePath": "vat-alice.js"
},
"bob": {
"sourcePath": "vat-bob.js"
},
"zoe": {
"sourcePath": "vat-zoe.js",
"parameters": {
"zcfBundleName": "zcf"
}
},
"bootstrap": {
"sourcePath": "bootstrap.js"
}
}
}
4 changes: 2 additions & 2 deletions packages/swingset-runner/demo/exchangeBenchmark/vat-zoe.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import { makeZoe } from '@agoric/zoe';

export function buildRootObject(_vatPowers) {
export function buildRootObject(_vatPowers, vatParameters) {
return harden({
buildZoe: vatAdminSvc => makeZoe(vatAdminSvc),
buildZoe: vatAdminSvc => makeZoe(vatAdminSvc, vatParameters.zcfBundleName),
});
}
10 changes: 9 additions & 1 deletion packages/swingset-runner/demo/zoeTests/swingset.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"bootstrap": "bootstrap",
"bundles": {
"zcf": {
"sourcePath": "../../../zoe/src/contractFacet.js"
}
},
"vats": {
"alice": {
"sourcePath": "vat-alice.js"
Expand All @@ -14,7 +19,10 @@
"sourcePath": "vat-dave.js"
},
"zoe": {
"sourcePath": "vat-zoe.js"
"sourcePath": "vat-zoe.js",
"parameters": {
"zcfBundleName": "zcf"
}
},
"bootstrap": {
"sourcePath": "bootstrap.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/swingset-runner/demo/zoeTests/vat-zoe.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import { makeZoe } from '@agoric/zoe';

export function buildRootObject(_vatPowers) {
export function buildRootObject(_vatPowers, vatParameters) {
return harden({
buildZoe: vatAdminSvc => makeZoe(vatAdminSvc),
buildZoe: vatAdminSvc => makeZoe(vatAdminSvc, vatParameters.zcfBundleName),
});
}
1 change: 0 additions & 1 deletion packages/swingset-runner/src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import path from 'path';
import fs from 'fs';
import process from 'process';
import repl from 'repl';
import util from 'util';
Expand Down

0 comments on commit 3df964a

Please sign in to comment.