Skip to content

Commit

Permalink
chore(vats): don't treat connectVattpWithMailbox as bootstrap action
Browse files Browse the repository at this point in the history
Connecting vattp / mailbox is more part of the SwingSet API.
  • Loading branch information
dckc committed Jan 25, 2022
1 parent a9f2ccd commit 8c9413b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 32 deletions.
17 changes: 0 additions & 17 deletions packages/vats/src/core/basic-behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,6 @@ const { keys } = Object;
* since we may want/need them later.
*/

/**
* @param {{
* vatPowers: { D: DProxy }, // D type is approximate
* vats: { vattp: VattpVat },
* devices: { mailbox: MailboxDevice },
* }} powers
*/
export const connectVattpWithMailbox = ({
vatPowers: { D },
vats: { vattp },
devices: { mailbox },
}) => {
D(mailbox).registerInboundHandler(vattp);
return E(vattp).registerMailboxDevice(mailbox);
};
harden(connectVattpWithMailbox);

/**
* @param {{
* vats: { vatAdmin: VatAdminVat },
Expand Down
11 changes: 8 additions & 3 deletions packages/vats/src/core/boot.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check
import { Far } from '@agoric/far';
import { E, Far } from '@agoric/far';
import { makePromiseKit } from '@agoric/promise-kit';
import {
CHAIN_BOOTSTRAP_MANIFEST,
Expand Down Expand Up @@ -116,7 +116,7 @@ const extract = (template, specimen) => {
* Build root object of the bootstrap vat.
*
* @param {{
* D: EProxy // approximately
* D: DProxy
* }} vatPowers
* @param {{
* argv: { ROLE: string },
Expand All @@ -142,7 +142,12 @@ const buildRootObject = (vatPowers, vatParameters) => {
* @param {SwingsetVats} vats
* @param {SwingsetDevices} devices
*/
bootstrap: (vats, devices) => {
bootstrap: async (vats, devices) => {
// Complete SwingSet wiring.
const { D } = vatPowers;
D(devices.mailbox).registerInboundHandler(vats.vattp);
await E(vats.vattp).registerMailboxDevice(devices.mailbox);

/** @param { Record<string, Record<string, unknown>> } manifest */
const runBehaviors = manifest => {
const powers = {
Expand Down
13 changes: 1 addition & 12 deletions packages/vats/src/core/manifest.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// @ts-check
export const CHAIN_BOOTSTRAP_MANIFEST = harden({
connectVattpWithMailbox: {
vatPowers: {
D: true,
},
vats: {
vattp: true,
},
devices: {
mailbox: true,
},
},
makeVatsFromBundles: {
vats: {
vatAdmin: true,
Expand Down Expand Up @@ -152,7 +141,7 @@ export const GOVERNANCE_ACTIONS_MANIFEST = harden({
},
produce: {
priceAuthorityAdmin: true,
}
},
},
installEconomicGovernance: {
consume: {
Expand Down

0 comments on commit 8c9413b

Please sign in to comment.