Skip to content

Commit

Permalink
fix(zoe): have install accept a moduleFormat argument (#235)
Browse files Browse the repository at this point in the history
This is needed to be compatible with future bundle formats.
  • Loading branch information
michaelfig authored and katelynsills committed Nov 22, 2019
1 parent ae4131f commit 8621eca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions core/zoe/zoe/zoe.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,22 @@ const makeZoe = async (additionalEndowments = {}) => {
/**
* Create an installation by safely evaluating the code and
* registering it with Zoe.
*
* We have a moduleFormat to allow for different future formats
* without silent failures.
*/
install: code => {
const installation = evalContractCode(code, additionalEndowments);
install: (code, moduleFormat = 'getExport') => {
let installation;
switch (moduleFormat) {
case 'getExport': {
installation = evalContractCode(code, additionalEndowments);
break;
}
default: {
insist(false)`\
Unimplemented installation moduleFormat ${moduleFormat}`;
}
}
const installationHandle = adminState.addInstallation(installation);
return installationHandle;
},
Expand Down
2 changes: 1 addition & 1 deletion test/swingsetTests/zoe/test-zoe.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ test('zoe - coveredCall - valid inputs - with SES', async t => {
}
});

test.only('zoe - coveredCall - valid inputs - no SES', async t => {
test('zoe - coveredCall - valid inputs - no SES', async t => {
try {
const startingExtents = [[3, 0], [0, 7]];
const dump = await main(false, 'zoe', [
Expand Down

0 comments on commit 8621eca

Please sign in to comment.