Skip to content

Commit

Permalink
chore: complete #1194 Problem 2b
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Aug 16, 2020
1 parent ae8c91e commit 9fc1fc7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
18 changes: 17 additions & 1 deletion packages/swingset-runner/demo/zoeTests/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,23 @@ export function buildRootObject(vatPowers, vatParameters) {
mintAndSellNFT: await E(zoe).install(mintAndSellNFTBundle.bundle),
};

const [testName, startingValues] = vatParameters.argv;
const testName = vatParameters.argv[0] || 'simpleExchangeOk';
const startingValuesStr = vatParameters.argv[1];
let startingValues;
if (startingValuesStr) {
startingValues = JSON.parse(startingValuesStr);
} else if (
vatParameters.startingValues &&
vatParameters.startingValues[testName]
) {
startingValues = vatParameters.startingValues[testName];
} else {
throw Error(
`Cannot find startingValues for ${testName} in ${JSON.stringify(
vatParameters,
)} or ${JSON.stringify(vatPowers)}`,
);
}

const { aliceP, bobP, carolP, daveP } = makeVats(
vatPowers.testLog,
Expand Down
18 changes: 17 additions & 1 deletion packages/zoe/test/swingsetTests/zoe/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,23 @@ export function buildRootObject(vatPowers, vatParameters) {
mintAndSellNFT: await E(zoe).install(mintAndSellNFTBundle.bundle),
};

const [testName, startingValues] = vatParameters.argv;
const testName = vatParameters.argv[0] || 'simpleExchangeOk';
const startingValuesStr = vatParameters.argv[1];
let startingValues;
if (startingValuesStr) {
startingValues = JSON.parse(startingValuesStr);
} else if (
vatParameters.startingValues &&
vatParameters.startingValues[testName]
) {
startingValues = vatParameters.startingValues[testName];
} else {
throw Error(
`Cannot find startingValues for ${testName} in ${JSON.stringify(
vatParameters,
)} or ${JSON.stringify(vatPowers)}`,
);
}

const { aliceP, bobP, carolP, daveP } = makeVats(
vatPowers.testLog,
Expand Down

0 comments on commit 9fc1fc7

Please sign in to comment.