@@ -79,7 +79,7 @@ vi.mock('@metamask/ocap-kernel', async (importOriginal) => {
7979 const actual = await importOriginal < typeof import ( '@metamask/ocap-kernel' ) > ( ) ;
8080 return {
8181 ...actual ,
82- initNetwork : vi . fn ( async ( ) => ( {
82+ initTransport : vi . fn ( async ( ) => ( {
8383 sendRemoteMessage : mockSendRemoteMessage ,
8484 stop : mockStop ,
8585 closeConnection : mockCloseConnection ,
@@ -245,8 +245,8 @@ describe('NodejsPlatformServices', () => {
245245
246246 await service . initializeRemoteComms ( keySeed , { relays } , remoteHandler ) ;
247247
248- const { initNetwork } = await import ( '@metamask/ocap-kernel' ) ;
249- expect ( initNetwork ) . toHaveBeenCalledWith (
248+ const { initTransport } = await import ( '@metamask/ocap-kernel' ) ;
249+ expect ( initTransport ) . toHaveBeenCalledWith (
250250 keySeed ,
251251 { relays } ,
252252 expect . any ( Function ) ,
@@ -266,8 +266,8 @@ describe('NodejsPlatformServices', () => {
266266
267267 await service . initializeRemoteComms ( keySeed , options , remoteHandler ) ;
268268
269- const { initNetwork } = await import ( '@metamask/ocap-kernel' ) ;
270- expect ( initNetwork ) . toHaveBeenCalledWith (
269+ const { initTransport } = await import ( '@metamask/ocap-kernel' ) ;
270+ expect ( initTransport ) . toHaveBeenCalledWith (
271271 keySeed ,
272272 options ,
273273 expect . any ( Function ) ,
@@ -289,8 +289,8 @@ describe('NodejsPlatformServices', () => {
289289 giveUpHandler ,
290290 ) ;
291291
292- const { initNetwork } = await import ( '@metamask/ocap-kernel' ) ;
293- expect ( initNetwork ) . toHaveBeenCalledWith (
292+ const { initTransport } = await import ( '@metamask/ocap-kernel' ) ;
293+ expect ( initTransport ) . toHaveBeenCalledWith (
294294 keySeed ,
295295 { relays } ,
296296 expect . any ( Function ) ,
@@ -332,17 +332,17 @@ describe('NodejsPlatformServices', () => {
332332
333333 await service . initializeRemoteComms ( '0xtest' , { } , remoteHandler ) ;
334334
335- // Simulate handleRemoteMessage being called (via initNetwork callback)
335+ // Simulate handleRemoteMessage being called (via initTransport callback)
336336 // The handler should call sendRemoteMessage if reply is non-empty
337337 mockSendRemoteMessage . mockClear ( ) ;
338338
339- // Call the handler that was passed to initNetwork
340- const { initNetwork } = await import ( '@metamask/ocap-kernel' ) ;
341- const initNetworkMock = initNetwork as unknown as ReturnType <
339+ // Call the handler that was passed to initTransport
340+ const { initTransport } = await import ( '@metamask/ocap-kernel' ) ;
341+ const initTransportMock = initTransport as unknown as ReturnType <
342342 typeof vi . fn
343343 > ;
344344 const lastCall =
345- initNetworkMock . mock . calls [ initNetworkMock . mock . calls . length - 1 ] ;
345+ initTransportMock . mock . calls [ initTransportMock . mock . calls . length - 1 ] ;
346346 const handleRemoteMessage = lastCall ?. [ 2 ] as (
347347 from : string ,
348348 message : string ,
@@ -365,13 +365,13 @@ describe('NodejsPlatformServices', () => {
365365
366366 mockSendRemoteMessage . mockClear ( ) ;
367367
368- // Call the handler that was passed to initNetwork
369- const { initNetwork } = await import ( '@metamask/ocap-kernel' ) ;
370- const initNetworkMock = initNetwork as unknown as ReturnType <
368+ // Call the handler that was passed to initTransport
369+ const { initTransport } = await import ( '@metamask/ocap-kernel' ) ;
370+ const initTransportMock = initTransport as unknown as ReturnType <
371371 typeof vi . fn
372372 > ;
373373 const lastCall =
374- initNetworkMock . mock . calls [ initNetworkMock . mock . calls . length - 1 ] ;
374+ initTransportMock . mock . calls [ initTransportMock . mock . calls . length - 1 ] ;
375375 const handleRemoteMessage = lastCall ?. [ 2 ] as (
376376 from : string ,
377377 message : string ,
@@ -440,11 +440,11 @@ describe('NodejsPlatformServices', () => {
440440 // Initialize
441441 await service . initializeRemoteComms ( keySeed , { relays } , remoteHandler ) ;
442442
443- const { initNetwork } = await import ( '@metamask/ocap-kernel' ) ;
444- const initNetworkMock = initNetwork as unknown as ReturnType <
443+ const { initTransport } = await import ( '@metamask/ocap-kernel' ) ;
444+ const initTransportMock = initTransport as unknown as ReturnType <
445445 typeof vi . fn
446446 > ;
447- const firstCallCount = initNetworkMock . mock . calls . length ;
447+ const firstCallCount = initTransportMock . mock . calls . length ;
448448
449449 // Stop
450450 await service . stopRemoteComms ( ) ;
@@ -453,8 +453,8 @@ describe('NodejsPlatformServices', () => {
453453 // Re-initialize should work
454454 await service . initializeRemoteComms ( keySeed , { relays } , remoteHandler ) ;
455455
456- // Should have called initNetwork again
457- expect ( initNetworkMock . mock . calls ) . toHaveLength ( firstCallCount + 1 ) ;
456+ // Should have called initTransport again
457+ expect ( initTransportMock . mock . calls ) . toHaveLength ( firstCallCount + 1 ) ;
458458 } ) ;
459459
460460 it ( 'clears internal state after stop' , async ( ) => {
0 commit comments