Skip to content

Commit

Permalink
feat: require that buildRootObject always returns a Far reference
Browse files Browse the repository at this point in the history
  • Loading branch information
FUDCo committed Jul 29, 2021
1 parent 317959d commit 0cda623
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/SwingSet/src/kernel/liveSlots.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/* global HandledPromise */

import { Remotable, passStyleOf, makeMarshal } from '@agoric/marshal';
import {
Remotable,
passStyleOf,
getInterfaceOf,
makeMarshal,
} from '@agoric/marshal';
import { assert, details as X } from '@agoric/assert';
import { isPromise } from '@agoric/promise-kit';
import { insistVatType, makeVatSlot, parseVatSlot } from '../parseVatSlots.js';
Expand Down Expand Up @@ -973,7 +978,11 @@ function build(
assert.equal(
passStyleOf(rootObject),
'remotable',
`buildRootObject() (${buildRootObject}) returned ${rootObject}, which is not Far`,
X`buildRootObject() for vat ${forVatID} returned ${rootObject}, which is not Far`,
);
assert(
getInterfaceOf(rootObject) !== undefined,
X`buildRootObject() for vat ${forVatID} returned ${rootObject} with no interface`,
);

const rootSlot = makeVatSlot('object', true, BigInt(0));
Expand Down

0 comments on commit 0cda623

Please sign in to comment.