tests/index.jsView |
---|
6 | 6 | const RadixTree = require('dfinity-radix-tree') |
7 | 7 | const db = level('./testdb') |
8 | 8 | |
9 | 9 | class BaseContainer { |
10 | | - static validate () {} |
11 | | - static get typeId () { |
12 | | - return 9 |
| 10 | + constructor (actor) { |
| 11 | + this.actor = actor |
13 | 12 | } |
14 | | - |
15 | | - static exports (m, id) { |
16 | | - return Object.keys(this.functions()).map(name => { |
17 | | - return { |
| 13 | + onStartup () {} |
| 14 | + static onCreation (code, id) { |
| 15 | + const exp = {} |
| 16 | + Object.getOwnPropertyNames(this.prototype).filter(name => name !== 'constructor').forEach(name => { |
| 17 | + exp[name] = { |
18 | 18 | name, |
19 | 19 | destId: id |
20 | 20 | } |
21 | 21 | }) |
| 22 | + return exp |
22 | 23 | } |
23 | | - static instance (actor) { |
| 24 | + getFuncRef (name) { |
24 | 25 | return { |
25 | | - exports: this.functions(actor) |
| 26 | + name, |
| 27 | + destId: this.id |
26 | 28 | } |
27 | 29 | } |
| 30 | + onMessage (message) { |
| 31 | + return this[message.funcRef.name](...message.funcArguments) |
| 32 | + } |
| 33 | + |
| 34 | + static get typeId () { |
| 35 | + return 9 |
| 36 | + } |
28 | 37 | } |
29 | 38 | |
30 | 39 | tape('basic', async t => { |
31 | 40 | t.plan(2) |
37 | 46 | db: db |
38 | 47 | }) |
39 | 48 | |
40 | 49 | class testVMContainer extends BaseContainer { |
41 | | - static functions () { |
42 | | - return { |
43 | | - onMessage: (m) => { |
44 | | - t.true(m === 1, 'should recive a message') |
45 | | - } |
46 | | - } |
| 50 | + main (m) { |
| 51 | + t.equals(m, 1, 'should recive a message') |
47 | 52 | } |
48 | 53 | } |
49 | 54 | |
50 | 55 | const hypervisor = new Hypervisor(tree) |
51 | 56 | hypervisor.registerContainer(testVMContainer) |
52 | 57 | |
53 | | - let {exports} = await hypervisor.createActor(testVMContainer.typeId) |
| 58 | + const {exports} = await hypervisor.createActor(testVMContainer.typeId) |
54 | 59 | |
55 | 60 | const message = new Message({ |
56 | | - funcRef: exports[0], |
| 61 | + funcRef: exports.main, |
57 | 62 | funcArguments: [1] |
58 | 63 | }) |
59 | 64 | hypervisor.send(message) |
60 | 65 | |
72 | 77 | db: db |
73 | 78 | }) |
74 | 79 | |
75 | 80 | class testVMContainerA extends BaseContainer { |
76 | | - static functions (actor) { |
77 | | - return { |
78 | | - onMessage: (funcRef) => { |
79 | | - const message = new Message({ |
80 | | - funcRef: funcRef, |
81 | | - funcArguments: [2] |
82 | | - }) |
83 | | - return actor.send(message) |
84 | | - } |
85 | | - } |
| 81 | + main (funcRef) { |
| 82 | + const message = new Message({ |
| 83 | + funcRef: funcRef, |
| 84 | + funcArguments: [2] |
| 85 | + }) |
| 86 | + return this.actor.send(message) |
86 | 87 | } |
87 | 88 | } |
88 | 89 | |
89 | 90 | class testVMContainerB extends BaseContainer { |
90 | | - static functions () { |
91 | | - return { |
92 | | - onMessage: (args) => { |
93 | | - t.equals(args, 2, 'should recive a message') |
94 | | - } |
95 | | - } |
| 91 | + main (args) { |
| 92 | + t.equals(args, 2, 'should recive a message') |
96 | 93 | } |
97 | 94 | |
98 | 95 | static get typeId () { |
99 | 96 | return 8 |
107 | 104 | const {exports: exportsB} = await hypervisor.createActor(testVMContainerB.typeId) |
108 | 105 | const {exports: exportsA} = await hypervisor.createActor(testVMContainerA.typeId) |
109 | 106 | |
110 | 107 | const message = new Message({ |
111 | | - funcRef: exportsA[0], |
112 | | - funcArguments: exportsB |
| 108 | + funcRef: exportsA.main, |
| 109 | + funcArguments: [exportsB.main] |
113 | 110 | }) |
114 | 111 | |
115 | 112 | hypervisor.send(message) |
116 | 113 | |
128 | 125 | db: db |
129 | 126 | }) |
130 | 127 | |
131 | 128 | class testVMContainerA extends BaseContainer { |
132 | | - static functions (actor) { |
133 | | - return { |
134 | | - onMessage: (funcRef) => { |
135 | | - const message = new Message({ |
136 | | - funcRef: funcRef, |
137 | | - funcArguments: [2] |
138 | | - }) |
139 | | - actor.send(message) |
140 | | - } |
141 | | - } |
| 129 | + main (funcRef) { |
| 130 | + const message = new Message({ |
| 131 | + funcRef: funcRef, |
| 132 | + funcArguments: [2] |
| 133 | + }) |
| 134 | + this.actor.send(message) |
142 | 135 | } |
143 | 136 | } |
144 | 137 | |
145 | 138 | class testVMContainerB extends BaseContainer { |
146 | | - static functions () { |
147 | | - return { |
148 | | - onMessage: (arg) => { |
149 | | - t.equals(arg, 2, 'should recive a message') |
150 | | - } |
151 | | - } |
| 139 | + main (arg) { |
| 140 | + t.equals(arg, 2, 'should recive a message') |
152 | 141 | } |
153 | 142 | |
154 | 143 | static get typeId () { |
155 | 144 | return 8 |
164 | 153 | let {exports: exportsA0} = await hypervisor.createActor(testVMContainerA.typeId) |
165 | 154 | let {exports: exportsA1} = await hypervisor.createActor(testVMContainerA.typeId) |
166 | 155 | |
167 | 156 | const message0 = new Message({ |
168 | | - funcRef: exportsA0[0], |
169 | | - funcArguments: [exportsB[0]] |
| 157 | + funcRef: exportsA0.main, |
| 158 | + funcArguments: [exportsB.main] |
170 | 159 | }) |
171 | 160 | |
172 | 161 | const message1 = new Message({ |
173 | | - funcRef: exportsA1[0], |
174 | | - funcArguments: [exportsB[0]] |
| 162 | + funcRef: exportsA1.main, |
| 163 | + funcArguments: [exportsB.main] |
175 | 164 | }) |
176 | 165 | |
177 | 166 | await hypervisor.send(message0) |
178 | 167 | await hypervisor.send(message1) |
191 | 180 | db: db |
192 | 181 | }) |
193 | 182 | |
194 | 183 | class testVMContainerA extends BaseContainer { |
195 | | - static functions (actor) { |
196 | | - return { |
197 | | - onMessage: funcRef => { |
198 | | - actor.incrementTicks(1) |
199 | | - const message = new Message({ |
200 | | - funcRef: funcRef, |
201 | | - funcArguments: [2] |
202 | | - }) |
203 | | - actor.send(message) |
204 | | - } |
205 | | - } |
| 184 | + main (funcRef) { |
| 185 | + this.actor.incrementTicks(1) |
| 186 | + const message = new Message({ |
| 187 | + funcRef: funcRef, |
| 188 | + funcArguments: [2] |
| 189 | + }) |
| 190 | + this.actor.send(message) |
206 | 191 | } |
207 | 192 | } |
208 | 193 | |
209 | 194 | class testVMContainerB extends BaseContainer { |
210 | | - static functions (actor) { |
211 | | - return { |
212 | | - onMessage: arg => { |
213 | | - t.equals(arg, 2, 'should recive a message') |
214 | | - } |
215 | | - } |
| 195 | + main (arg) { |
| 196 | + t.equals(arg, 2, 'should recive a message') |
216 | 197 | } |
217 | 198 | |
218 | 199 | static get typeId () { |
219 | 200 | return 8 |
228 | 209 | let actorA0 = await hypervisor.createActor(testVMContainerA.typeId) |
229 | 210 | let actorA1 = await hypervisor.createActor(testVMContainerA.typeId) |
230 | 211 | |
231 | 212 | const message0 = new Message({ |
232 | | - funcRef: actorA0.exports[0], |
233 | | - funcArguments: [actorB.exports[0]] |
| 213 | + funcRef: actorA0.exports.main, |
| 214 | + funcArguments: [actorB.exports.main] |
234 | 215 | }) |
235 | 216 | const message1 = new Message({ |
236 | | - funcRef: actorA1.exports[0], |
237 | | - funcArguments: actorB.exports |
| 217 | + funcRef: actorA1.exports.main, |
| 218 | + funcArguments: [actorB.exports.main] |
238 | 219 | }) |
239 | 220 | |
240 | 221 | hypervisor.send(message0) |
241 | 222 | hypervisor.send(message1) |
254 | 235 | db: db |
255 | 236 | }) |
256 | 237 | |
257 | 238 | class testVMContainerA extends BaseContainer { |
258 | | - static functions (actor) { |
259 | | - return { |
260 | | - onMessage: funcRef => { |
261 | | - const message = new Message({ |
262 | | - funcRef |
263 | | - }) |
264 | | - message.on('execution:error', () => { |
265 | | - t.pass('should recive a exeption') |
266 | | - }) |
267 | | - actor.send(message) |
268 | | - } |
269 | | - } |
| 239 | + main (funcRef) { |
| 240 | + const message = new Message({ |
| 241 | + funcRef |
| 242 | + }) |
| 243 | + message.on('execution:error', () => { |
| 244 | + t.pass('should recive a exeption') |
| 245 | + }) |
| 246 | + this.actor.send(message) |
270 | 247 | } |
271 | 248 | } |
272 | 249 | |
273 | 250 | class testVMContainerB extends BaseContainer { |
274 | | - static functions (actor) { |
275 | | - return { |
276 | | - onMessage: funcRef => { |
277 | | - t.true(true, 'should recive a message') |
278 | | - throw new Error('test error') |
279 | | - } |
280 | | - } |
| 251 | + main (funcRef) { |
| 252 | + t.true(true, 'should recive a message') |
| 253 | + throw new Error('test error') |
281 | 254 | } |
282 | 255 | |
283 | 256 | static get typeId () { |
284 | 257 | return 8 |
291 | 264 | |
292 | 265 | let {exports: exportsB} = await hypervisor.createActor(testVMContainerB.typeId) |
293 | 266 | let {exports: exportsA} = await hypervisor.createActor(testVMContainerA.typeId) |
294 | 267 | const message = new Message({ |
295 | | - funcRef: exportsA[0], |
296 | | - funcArguments: exportsB |
| 268 | + funcRef: exportsA.main, |
| 269 | + funcArguments: [exportsB.main] |
297 | 270 | }) |
298 | 271 | hypervisor.send(message) |
299 | 272 | const stateRoot = await hypervisor.createStateRoot() |
300 | 273 | t.deepEquals(stateRoot, expectedState, 'expected root!') |
310 | 283 | db: db |
311 | 284 | }) |
312 | 285 | |
313 | 286 | class testVMContainerA extends BaseContainer { |
314 | | - static functions (actor) { |
315 | | - return { |
316 | | - onCreation: async funcRef => { |
317 | | - const {exports} = await actor.createActor(testVMContainerB.typeId) |
318 | | - const message = new Message({ |
319 | | - funcRef: exports[0], |
320 | | - funcArguments: [actor.getFuncRef('onMessage')] |
321 | | - }) |
322 | | - actor.send(message) |
323 | | - }, |
324 | | - onMessage: data => { |
325 | | - t.equals(data, 'test', 'should recive a response message') |
326 | | - } |
327 | | - } |
| 287 | + async start (funcRef) { |
| 288 | + const {exports} = await this.actor.createActor(testVMContainerB.typeId) |
| 289 | + const message = new Message({ |
| 290 | + funcRef: exports.main, |
| 291 | + funcArguments: [this.actor.getFuncRef('main')] |
| 292 | + }) |
| 293 | + this.actor.send(message) |
328 | 294 | } |
| 295 | + main (data) { |
| 296 | + t.equals(data, 'test', 'should recive a response message') |
| 297 | + } |
329 | 298 | } |
330 | 299 | |
331 | 300 | class testVMContainerB extends BaseContainer { |
332 | | - static functions (actor) { |
333 | | - return { |
334 | | - onCreation: funcRef => { |
335 | | - actor.send(new Message({funcRef, funcArguments: ['test']})) |
336 | | - } |
337 | | - } |
| 301 | + main (funcRef) { |
| 302 | + this.actor.send(new Message({funcRef, funcArguments: ['test']})) |
338 | 303 | } |
339 | 304 | |
340 | 305 | static get typeId () { |
341 | 306 | return 8 |
346 | 311 | hypervisor.registerContainer(testVMContainerA) |
347 | 312 | hypervisor.registerContainer(testVMContainerB) |
348 | 313 | |
349 | 314 | const {exports} = await hypervisor.createActor(testVMContainerA.typeId) |
350 | | - await hypervisor.send(new Message({funcRef: exports[0]})) |
| 315 | + await hypervisor.send(new Message({funcRef: exports.start})) |
351 | 316 | |
352 | 317 | const stateRoot = await hypervisor.createStateRoot() |
353 | 318 | t.deepEquals(stateRoot, expectedState, 'expected root!') |
354 | 319 | }) |
363 | 328 | db: db |
364 | 329 | }) |
365 | 330 | |
366 | 331 | class testVMContainerA extends BaseContainer { |
367 | | - static functions (actor) { |
368 | | - return { |
369 | | - onCreation: funcRef => { |
370 | | - const message1 = new Message({ |
371 | | - funcArguments: ['first'], |
372 | | - funcRef |
373 | | - }) |
374 | | - const message2 = new Message({ |
375 | | - funcArguments: ['second'], |
376 | | - funcRef |
377 | | - }) |
378 | | - const message3 = new Message({ |
379 | | - funcArguments: ['third'], |
380 | | - funcRef |
381 | | - }) |
382 | | - actor.send(message1) |
383 | | - actor.incrementTicks(1) |
384 | | - actor.send(message2) |
385 | | - actor.incrementTicks(1) |
386 | | - actor.send(message3) |
387 | | - } |
388 | | - } |
| 332 | + main (funcRef) { |
| 333 | + const message1 = new Message({ |
| 334 | + funcArguments: ['first'], |
| 335 | + funcRef |
| 336 | + }) |
| 337 | + const message2 = new Message({ |
| 338 | + funcArguments: ['second'], |
| 339 | + funcRef |
| 340 | + }) |
| 341 | + const message3 = new Message({ |
| 342 | + funcArguments: ['third'], |
| 343 | + funcRef |
| 344 | + }) |
| 345 | + this.actor.send(message1) |
| 346 | + this.actor.incrementTicks(1) |
| 347 | + this.actor.send(message2) |
| 348 | + this.actor.incrementTicks(1) |
| 349 | + this.actor.send(message3) |
389 | 350 | } |
390 | 351 | } |
391 | 352 | |
392 | 353 | let recMsg = 0 |
393 | 354 | |
394 | 355 | class testVMContainerB extends BaseContainer { |
395 | | - static functions (actor) { |
396 | | - return { |
397 | | - onMessage: data => { |
398 | | - actor.incrementTicks(1) |
399 | | - if (recMsg === 0) { |
400 | | - t.equal(data, 'first', 'should recive fist message') |
401 | | - } else if (recMsg === 1) { |
402 | | - t.equal(data, 'second', 'should recive second message') |
403 | | - } else { |
404 | | - t.equal(data, 'third', 'should recive third message') |
405 | | - } |
406 | | - recMsg++ |
407 | | - } |
| 356 | + main (data) { |
| 357 | + this.actor.incrementTicks(1) |
| 358 | + if (recMsg === 0) { |
| 359 | + t.equal(data, 'first', 'should recive fist message') |
| 360 | + } else if (recMsg === 1) { |
| 361 | + t.equal(data, 'second', 'should recive second message') |
| 362 | + } else { |
| 363 | + t.equal(data, 'third', 'should recive third message') |
408 | 364 | } |
| 365 | + recMsg++ |
409 | 366 | } |
410 | 367 | |
411 | 368 | static get typeId () { |
412 | 369 | return 8 |
419 | 376 | |
420 | 377 | const {exports: exportsB} = await hypervisor.createActor(testVMContainerB.typeId) |
421 | 378 | const {exports: exportsA} = await hypervisor.createActor(testVMContainerA.typeId) |
422 | 379 | const message = new Message({ |
423 | | - funcRef: exportsA[0], |
424 | | - funcArguments: exportsB |
| 380 | + funcRef: exportsA.main, |
| 381 | + funcArguments: [exportsB.main] |
425 | 382 | }) |
426 | 383 | hypervisor.send(message) |
427 | 384 | |
428 | 385 | const stateRoot = await hypervisor.createStateRoot() |
440 | 397 | db: db |
441 | 398 | }) |
442 | 399 | |
443 | 400 | class testVMContainerA extends BaseContainer { |
444 | | - static functions (actor) { |
445 | | - return { |
446 | | - onCreation: (funcRef, funcArguments) => { |
447 | | - actor.incrementTicks(1) |
448 | | - message = new Message({ |
449 | | - funcRef, |
450 | | - funcArguments: [funcArguments] |
451 | | - }) |
452 | | - return actor.send(message) |
453 | | - } |
454 | | - } |
| 401 | + main (funcRef, funcArguments) { |
| 402 | + this.actor.incrementTicks(1) |
| 403 | + message = new Message({ |
| 404 | + funcRef, |
| 405 | + funcArguments: [funcArguments] |
| 406 | + }) |
| 407 | + this.actor.send(message) |
455 | 408 | } |
456 | 409 | } |
457 | 410 | |
458 | 411 | let recMsg = 0 |
459 | 412 | |
460 | 413 | class testVMContainerB extends BaseContainer { |
461 | | - static functions (actor) { |
462 | | - return { |
463 | | - onMessage: data => { |
464 | | - if (recMsg === 0) { |
465 | | - t.equal(data, 'first', 'should recive fist message') |
466 | | - } else if (recMsg === 1) { |
467 | | - t.equal(data, 'second', 'should recive second message') |
468 | | - } else { |
469 | | - t.equal(data, 'third', 'should recive third message') |
470 | | - } |
471 | | - recMsg++ |
472 | | - } |
| 414 | + main (data) { |
| 415 | + if (recMsg === 0) { |
| 416 | + t.equal(data, 'first', 'should recive fist message') |
| 417 | + } else if (recMsg === 1) { |
| 418 | + t.equal(data, 'second', 'should recive second message') |
| 419 | + } else { |
| 420 | + t.equal(data, 'third', 'should recive third message') |
473 | 421 | } |
| 422 | + recMsg++ |
474 | 423 | } |
475 | 424 | |
476 | 425 | static get typeId () { |
477 | 426 | return 8 |
483 | 432 | hypervisor.registerContainer(testVMContainerB) |
484 | 433 | |
485 | 434 | let {exports: exportsB} = await hypervisor.createActor(testVMContainerB.typeId) |
486 | 435 | hypervisor.send(new Message({ |
487 | | - funcRef: exportsB[0], |
| 436 | + funcRef: exportsB.main, |
488 | 437 | funcArguments: ['first'] |
489 | 438 | })) |
490 | 439 | |
491 | 440 | const {exports: exportsA0} = await hypervisor.createActor(testVMContainerA.typeId) |
492 | 441 | |
493 | 442 | hypervisor.send(new Message({ |
494 | | - funcRef: exportsA0[0], |
495 | | - funcArguments: [exportsB[0], 'second'] |
| 443 | + funcRef: exportsA0.main, |
| 444 | + funcArguments: [exportsB.main, 'second'] |
496 | 445 | })) |
497 | 446 | |
498 | 447 | const {exports: exportsA1} = await hypervisor.createActor(testVMContainerA.typeId) |
499 | 448 | hypervisor.send(new Message({ |
500 | | - funcRef: exportsA1[0], |
501 | | - funcArguments: [exportsB[0], 'third'] |
| 449 | + funcRef: exportsA1.main, |
| 450 | + funcArguments: [exportsB.main, 'third'] |
502 | 451 | })) |
503 | 452 | |
504 | 453 | const stateRoot = await hypervisor.createStateRoot() |
505 | 454 | t.deepEquals(stateRoot, expectedState, 'expected root!') |
515 | 464 | db: db |
516 | 465 | }) |
517 | 466 | |
518 | 467 | class testVMContainerA extends BaseContainer { |
519 | | - static functions (actor) { |
520 | | - return { |
521 | | - onMessage: (funcRef) => { |
522 | | - const message = new Message({ |
523 | | - funcRef: funcRef, |
524 | | - funcArguments: [2] |
525 | | - }) |
526 | | - actor.send(message) |
| 468 | + main (funcRef) { |
| 469 | + const message = new Message({ |
| 470 | + funcRef: funcRef, |
| 471 | + funcArguments: [2] |
| 472 | + }) |
| 473 | + this.actor.send(message) |
527 | 474 | |
528 | | - const message2 = new Message({ |
529 | | - funcRef: funcRef, |
530 | | - funcArguments: [2] |
531 | | - }) |
532 | | - actor.send(message2) |
533 | | - actor.incrementTicks(1) |
534 | | - return new Promise((resolve, reject) => { |
535 | | - setTimeout(() => { |
536 | | - resolve() |
537 | | - }, 10) |
538 | | - }) |
539 | | - } |
540 | | - } |
| 475 | + const message2 = new Message({ |
| 476 | + funcRef: funcRef, |
| 477 | + funcArguments: [2] |
| 478 | + }) |
| 479 | + this.actor.send(message2) |
| 480 | + this.actor.incrementTicks(1) |
| 481 | + return new Promise((resolve, reject) => { |
| 482 | + setTimeout(() => { |
| 483 | + resolve() |
| 484 | + }, 10) |
| 485 | + }) |
541 | 486 | } |
542 | 487 | } |
543 | 488 | |
544 | 489 | class testVMContainerB extends BaseContainer { |
545 | | - static functions (actor) { |
546 | | - return { |
547 | | - onMessage: (args) => { |
548 | | - actor.incrementTicks(1) |
549 | | - t.equals(args, 2, 'should recive a message') |
550 | | - } |
551 | | - } |
| 490 | + main (args) { |
| 491 | + this.actor.incrementTicks(1) |
| 492 | + t.equals(args, 2, 'should recive a message') |
552 | 493 | } |
553 | 494 | |
554 | 495 | static get typeId () { |
555 | 496 | return 8 |
563 | 504 | const {exports: exportsB} = await hypervisor.createActor(testVMContainerB.typeId) |
564 | 505 | const {exports: exportsA} = await hypervisor.createActor(testVMContainerA.typeId) |
565 | 506 | |
566 | 507 | const message = new Message({ |
567 | | - funcRef: exportsA[0], |
568 | | - funcArguments: exportsB |
| 508 | + funcRef: exportsA.main, |
| 509 | + funcArguments: [exportsB.main] |
569 | 510 | }) |
570 | 511 | |
571 | 512 | hypervisor.send(message) |
572 | 513 | |
583 | 524 | db: db |
584 | 525 | }) |
585 | 526 | |
586 | 527 | class BenchmarkContainer extends BaseContainer { |
587 | | - static functions (actor) { |
588 | | - return { |
589 | | - onMessage: function () { |
590 | | - const refs = [...arguments] |
591 | | - const ref = refs.pop() |
592 | | - const last = messageOrder[actor.id.toString('hex')] |
593 | | - const message = actor.currentMessage |
594 | | - if (last) { |
595 | | - t.ok(last <= message._fromTicks) |
596 | | - } |
597 | | - messageOrder[actor.id.toString('hex')] = message._fromTicks |
598 | | - numOfMsg++ |
599 | | - actor.incrementTicks(10) |
600 | | - if (ref) { |
601 | | - actor.send(new Message({ |
602 | | - funcRef: ref, |
603 | | - funcArguments: refs |
604 | | - })) |
605 | | - } |
606 | | - } |
| 528 | + main () { |
| 529 | + const refs = [...arguments] |
| 530 | + const ref = refs.pop() |
| 531 | + const last = messageOrder[this.actor.id.toString('hex')] |
| 532 | + const message = this.actor.currentMessage |
| 533 | + if (last) { |
| 534 | + t.ok(last <= message._fromTicks) |
607 | 535 | } |
| 536 | + messageOrder[this.actor.id.toString('hex')] = message._fromTicks |
| 537 | + numOfMsg++ |
| 538 | + this.actor.incrementTicks(10) |
| 539 | + if (ref) { |
| 540 | + this.actor.send(new Message({ |
| 541 | + funcRef: ref, |
| 542 | + funcArguments: refs |
| 543 | + })) |
| 544 | + } |
608 | 545 | } |
609 | 546 | } |
610 | 547 | |
611 | 548 | const hypervisor = new Hypervisor(tree) |
614 | 551 | const refernces = [] |
615 | 552 | let _numOfActors = numOfActors |
616 | 553 | while (_numOfActors--) { |
617 | 554 | const {exports} = await hypervisor.createActor(BenchmarkContainer.typeId) |
618 | | - refernces.push(exports[0]) |
| 555 | + refernces.push(exports.main) |
619 | 556 | } |
620 | 557 | _numOfActors = numOfActors |
621 | 558 | let msgs = [] |
622 | 559 | while (_numOfActors--) { |