Skip to content

Commit

Permalink
fix: make local.vattp and agoric.vattp symmetrical
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Aug 12, 2020
1 parent f4c6442 commit 9b366d0
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions packages/cosmic-swingset/lib/ag-solo/vats/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ function parseArgs(argv) {
// Used for coordinating on an index in comms for the provisioning service
const PROVISIONER_INDEX = 1;

function makeVattpFrom(vats) {
const { vattp, comms } = vats;
return harden({
makeNetworkHost(allegedName, console = undefined) {
return E(vattp).makeNetworkHost(allegedName, comms, console);
},
});
}

export function buildRootObject(vatPowers, vatParameters) {
const { D } = vatPowers;
async function setupCommandDevice(httpVat, cmdDevice, roles) {
Expand Down Expand Up @@ -103,14 +112,9 @@ export function buildRootObject(vatPowers, vatParameters) {
}

const additionalPowers = {};
const { vattp, comms } = vats;
if (powerFlags.includes('agoric.vattp')) {
// Give the authority to create a new host for vattp to share objects with.
additionalPowers.vattp = {
makeNetworkHost(allegedName, console = undefined) {
return E(vattp).makeNetworkHost(allegedName, comms, console);
},
};
additionalPowers.vattp = makeVattpFrom(vats);
}

const pursePetnames = {
Expand Down Expand Up @@ -267,12 +271,11 @@ export function buildRootObject(vatPowers, vatParameters) {

return allComparable(
harden({
comms: vats.comms,
uploads,
spawner,
network: vats.network,
http: httpRegCallback,
vattp: vats.vattp,
vattp: makeVattpFrom(vats),
}),
);
}
Expand Down

0 comments on commit 9b366d0

Please sign in to comment.