1- import {
2- makeLiveSlots as localMakeLiveSlots ,
3- makeMarshaller ,
4- } from '@agoric/swingset-liveslots' ;
1+ import { makeLiveSlots as localMakeLiveSlots } from '@agoric/swingset-liveslots' ;
52import type {
63 VatDeliveryObject ,
74 VatSyscallResult ,
85} from '@agoric/swingset-liveslots' ;
9- import { Fail } from '@endo/errors' ;
106import { importBundle } from '@endo/import-bundle' ;
117import { makeMarshal } from '@endo/marshal' ;
128import type { CapData } from '@endo/marshal' ;
@@ -20,6 +16,7 @@ import { serializeError } from '@metamask/rpc-errors';
2016import type { DuplexStream } from '@metamask/streams' ;
2117import { isJsonRpcRequest , isJsonRpcResponse } from '@metamask/utils' ;
2218
19+ import { makeEndowments } from './endowments/index.ts' ;
2320import { vatSyscallMethodSpecs , vatHandlers } from './rpc/index.ts' ;
2421import { makeGCAndFinalize } from './services/gc-finalize.ts' ;
2522import { makeDummyMeterControl } from './services/meter-control.ts' ;
@@ -31,7 +28,6 @@ import type {
3128 VatDeliveryResult ,
3229 VatId ,
3330 VatSyscallObject ,
34- VRef ,
3531} from './types.ts' ;
3632import { isVatConfig , coerceVatSyscallObject } from './types.ts' ;
3733
@@ -260,21 +256,10 @@ export class VatSupervisor {
260256 meterControl : makeDummyMeterControl ( ) ,
261257 } ) ;
262258
263- const { m } = makeMarshaller ( syscall , gcTools , this . id ) ;
264- const toRef = ( object : unknown ) : VRef =>
265- m . toCapData ( object ) . slots [ 0 ] ?? Fail `cannot revoke object ${ object } ` ;
266- const makeRevoker = ( object : unknown ) : ( ( ) => void ) => {
267- const ref = toRef ( object ) ;
268- return harden ( ( ) => {
269- syscall . revoke ( [ ref ] ) ;
270- } ) ;
271- } ;
272- harden ( makeRevoker ) ;
273-
274259 const workerEndowments = {
275260 console : this . #logger. subLogger ( { tags : [ 'console' ] } ) ,
276261 assert : globalThis . assert ,
277- makeRevoker ,
262+ ... makeEndowments ( syscall , gcTools , this . id ) ,
278263 } ;
279264
280265 const { bundleSpec, parameters } = vatConfig ;
0 commit comments