Skip to content

Commit

Permalink
fix: change all packages to call createVatAdminService the new way
Browse files Browse the repository at this point in the history
The swingset fix for #4521 requires all callers of `createVatAdminService()`
to provide it with `devices.bundle` in addition to the existing
`devices.vatAdmin`. This occurs in the `bootstrap()` function, in both the
production configuration (`packages/vats/src/bootstrap.js`) and in
swingset-based unit tests in all packages.

This commit updates all agoric-sdk packages to do this.

refs #4521
  • Loading branch information
warner committed Feb 13, 2022
1 parent 8de4838 commit 65d6858
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ const makeBootstrap = (argv, cb, vatPowers) => async (vats, devices) => {
const log = vatPowers.testLog;
const vatAdminSvc = await E(vats.vatAdmin).createVatAdminService(
devices.vatAdmin,
devices.bundle,
);
/** @type { ERef<ZoeService> } */
const zoe = E(vats.zoe).buildZoe(vatAdminSvc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ const makeBootstrap = (argv, cb, vatPowers) => async (vats, devices) => {
const log = vatPowers.testLog;
const vatAdminSvc = await E(vats.vatAdmin).createVatAdminService(
devices.vatAdmin,
devices.bundle,
);
/** @type { ERef<ZoeService> } */
const zoe = E(vats.zoe).buildZoe(vatAdminSvc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const makeBootstrap = (argv, cb, vatPowers) => async (vats, devices) => {
const log = vatPowers.testLog;
const vatAdminSvc = await E(vats.vatAdmin).createVatAdminService(
devices.vatAdmin,
devices.bundle,
);
const { zoe, feeMintAccess } = await E(vats.zoe).buildZoe(vatAdminSvc);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function makeBootstrap(argv, cb, vatPowers) {
return async (vats, devices) => {
const vatAdminSvc = await E(vats.vatAdmin).createVatAdminService(
devices.vatAdmin,
devices.bundle,
);
const { zoe, feeMintAccess } = await E(vats.zoe).buildZoe(vatAdminSvc);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export function buildRootObject(vatPowers, vatParameters) {
async bootstrap(vats, devices) {
const vatAdminSvc = await E(vats.vatAdmin).createVatAdminService(
devices.vatAdmin,
devices.bundle,
);
const spawner = await E(vats.spawner).buildSpawner(vatAdminSvc);
const [mode, trivialBundle] = vatParameters.argv;
Expand Down
5 changes: 4 additions & 1 deletion packages/swingset-runner/src/vat-launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export function buildRootObject(_vatPowers, vatParameters) {

return Far('root', {
async bootstrap(vats, devices) {
const vatMaker = E(vats.vatAdmin).createVatAdminService(devices.vatAdmin);
const vatMaker = E(vats.vatAdmin).createVatAdminService(
devices.vatAdmin,
devices.bundle,
);
const vatRoots = {};
for (const vatName of Object.keys(vatParameters.config.vats)) {
const vatDesc = vatParameters.config.vats[vatName];
Expand Down
1 change: 1 addition & 0 deletions packages/vats/src/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,7 @@ export function buildRootObject(vatPowers, vatParameters) {

const vatAdminSvc = await E(vats.vatAdmin).createVatAdminService(
devices.vatAdmin,
devices.bundle,
);

console.debug(`${ROLE} bootstrap starting`);
Expand Down
5 changes: 4 additions & 1 deletion packages/vats/src/core/basic-behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ export const makeVatsFromBundles = ({
devices,
produce: { vatAdminSvc, loadVat },
}) => {
const svc = E(vats.vatAdmin).createVatAdminService(devices.vatAdmin);
const svc = E(vats.vatAdmin).createVatAdminService(
devices.vatAdmin,
devices.bundle,
);
vatAdminSvc.resolve(svc);
// TODO: getVat? do we need to memoize this by name?
// TODO: rename loadVat to createVatByName?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export function buildRootObject(vatPowers, vatParameters) {
async bootstrap(vats, devices) {
const vatAdminSvc = await E(vats.vatAdmin).createVatAdminService(
devices.vatAdmin,
devices.bundle,
);
const zoe = await E(vats.zoe).buildZoe(vatAdminSvc);
const installations = {
Expand Down
1 change: 1 addition & 0 deletions packages/zoe/test/swingsetTests/makeKind/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export function buildRootObject(vatPowers, vatParameters) {
async bootstrap(vats, devices) {
const vatAdminSvc = await E(vats.vatAdmin).createVatAdminService(
devices.vatAdmin,
devices.bundle,
);
const zoe = await E(vats.zoe).buildZoe(vatAdminSvc);
const installations = {
Expand Down
1 change: 1 addition & 0 deletions packages/zoe/test/swingsetTests/offerArgs/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export function buildRootObject(vatPowers, vatParameters) {
async bootstrap(vats, devices) {
const vatAdminSvc = await E(vats.vatAdmin).createVatAdminService(
devices.vatAdmin,
devices.bundle,
);
const zoe = await E(vats.zoe).buildZoe(vatAdminSvc);
const installations = {
Expand Down
1 change: 1 addition & 0 deletions packages/zoe/test/swingsetTests/privateArgs/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export function buildRootObject(vatPowers, vatParameters) {
async bootstrap(vats, devices) {
const vatAdminSvc = await E(vats.vatAdmin).createVatAdminService(
devices.vatAdmin,
devices.bundle,
);
const zoe = await E(vats.zoe).buildZoe(vatAdminSvc);
const installations = {
Expand Down
1 change: 1 addition & 0 deletions packages/zoe/test/swingsetTests/runMint/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export function buildRootObject(vatPowers, vatParameters) {
async bootstrap(vats, devices) {
const vatAdminSvc = await E(vats.vatAdmin).createVatAdminService(
devices.vatAdmin,
devices.bundle,
);
const { zoe, feeMintAccess } = await E(vats.zoe).buildZoe(vatAdminSvc);
const installations = {
Expand Down
1 change: 1 addition & 0 deletions packages/zoe/test/swingsetTests/zoe/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export function buildRootObject(vatPowers, vatParameters) {
async bootstrap(vats, devices) {
const vatAdminSvc = await E(vats.vatAdmin).createVatAdminService(
devices.vatAdmin,
devices.bundle,
);
const zoe = await E(vats.zoe).buildZoe(vatAdminSvc);
const installations = {
Expand Down

0 comments on commit 65d6858

Please sign in to comment.