tests/index.jsView |
---|
6 | 6 … | const level = require('level') |
7 | 7 … | const RadixTree = require('dfinity-radix-tree') |
8 | 8 … | const db = level('./testdb') |
9 | 9 … | |
| 10 … | +class CreationMessage extends Message { |
| 11 … | + constructor (params) { |
| 12 … | + const buf = [Buffer.from([0x0]), Buffer.from([params.data.type])] |
| 13 … | + if (params.data.code) { |
| 14 … | + buf.push(params.data.code) |
| 15 … | + } |
| 16 … | + params.data = Buffer.concat(buf) |
| 17 … | + super(params) |
| 18 … | + } |
| 19 … | +} |
| 20 … | + |
10 | 21 … | class BaseContainer extends AbstractContainer { |
11 | 22 … | onCreation (message) { |
12 | 23 … | const port = message.ports[0] |
13 | 24 … | if (port) { |
40 | 51 … | hypervisor.registerContainer(testVMContainer) |
41 | 52 … | |
42 | 53 … | const port = hypervisor.creationService.getPort() |
43 | 54 … | |
44 | | - let rootContainer = await hypervisor.send(port, new Message({ |
| 55 … | + let rootContainer = await hypervisor.send(port, new CreationMessage({ |
45 | 56 … | data: { |
46 | 57 … | type: testVMContainer.typeId |
47 | 58 … | } |
48 | 59 … | })) |
51 | 62 … | |
52 | 63 … | hypervisor.pin(rootContainer) |
53 | 64 … | |
54 | 65 … | const [portRef1, portRef2] = rootContainer.ports.createChannel() |
55 | | - const initMessage = rootContainer.createMessage({ |
| 66 … | + const initMessage = new CreationMessage({ |
56 | 67 … | data: { |
57 | 68 … | code: Buffer.from('test code'), |
58 | 69 … | type: testVMContainer.typeId |
59 | 70 … | }, |
92 | 103 … | const hypervisor = new Hypervisor(tree) |
93 | 104 … | hypervisor.registerContainer(testVMContainer) |
94 | 105 … | |
95 | 106 … | const creationPort = hypervisor.creationService.getPort() |
96 | | - let root = await hypervisor.send(creationPort, new Message({ |
| 107 … | + let root = await hypervisor.send(creationPort, new CreationMessage({ |
97 | 108 … | data: { |
98 | 109 … | type: testVMContainer.typeId |
99 | 110 … | } |
100 | 111 … | })) |
106 | 117 … | const [portRef1, portRef2] = root.ports.createChannel() |
107 | 118 … | |
108 | 119 … | await Promise.all([ |
109 | 120 … | root.ports.bind('one', portRef1), |
110 | | - root.send(creationPort, root.createMessage({ |
| 121 … | + root.send(creationPort, new CreationMessage({ |
111 | 122 … | data: { |
112 | 123 … | type: testVMContainer.typeId |
113 | 124 … | }, |
114 | 125 … | ports: [portRef2] |
160 | 171 … | const [portRef1, portRef2] = this.kernel.ports.createChannel() |
161 | 172 … | const port = this.kernel.hypervisor.creationService.getPort() |
162 | 173 … | |
163 | 174 … | await Promise.all([ |
164 | | - this.kernel.send(port, this.kernel.createMessage({ |
| 175 … | + this.kernel.send(port, new CreationMessage({ |
165 | 176 … | data: { |
166 | 177 … | type: testVMContainer2.typeId |
167 | 178 … | }, |
168 | 179 … | ports: [portRef2] |
179 | 190 … | hypervisor.registerContainer(testVMContainer) |
180 | 191 … | hypervisor.registerContainer(testVMContainer2) |
181 | 192 … | |
182 | 193 … | let creationPort = hypervisor.creationService.getPort() |
183 | | - let root = await hypervisor.send(creationPort, new Message({ |
| 194 … | + let root = await hypervisor.send(creationPort, new CreationMessage({ |
184 | 195 … | data: { |
185 | 196 … | type: testVMContainer.typeId |
186 | 197 … | } |
187 | 198 … | })) |
193 | 204 … | const [portRef1, portRef2] = root.ports.createChannel() |
194 | 205 … | |
195 | 206 … | message = root.createMessage() |
196 | 207 … | await Promise.all([ |
197 | | - root.send(creationPort, root.createMessage({ |
| 208 … | + root.send(creationPort, new CreationMessage({ |
198 | 209 … | data: { |
199 | 210 … | type: testVMContainer.typeId |
200 | 211 … | }, |
201 | 212 … | ports: [portRef2] |
250 | 261 … | const hypervisor = new Hypervisor(tree) |
251 | 262 … | |
252 | 263 … | hypervisor.registerContainer(Root) |
253 | 264 … | const creationPort = hypervisor.creationService.getPort() |
254 | | - const root = await hypervisor.send(creationPort, new Message({ |
| 265 … | + const root = await hypervisor.send(creationPort, new CreationMessage({ |
255 | 266 … | data: { |
256 | 267 … | type: Root.typeId |
257 | 268 … | } |
258 | 269 … | })) |
283 | 294 … | runs++ |
284 | 295 … | const [portRef1, portRef2] = this.kernel.ports.createChannel() |
285 | 296 … | const [portRef3, portRef4] = this.kernel.ports.createChannel() |
286 | 297 … | |
287 | | - const message1 = this.kernel.createMessage({ |
| 298 … | + const message1 = new CreationMessage({ |
288 | 299 … | data: { |
289 | 300 … | type: First.typeId |
290 | 301 … | }, |
291 | 302 … | ports: [portRef2] |
292 | 303 … | }) |
293 | | - const message2 = this.kernel.createMessage({ |
| 304 … | + const message2 = new CreationMessage({ |
294 | 305 … | data: { |
295 | 306 … | type: Waiter.typeId |
296 | 307 … | }, |
297 | 308 … | ports: [portRef4] |
313 | 324 … | t.equals(m.data, 'second', 'should recive the second message') |
314 | 325 … | } |
315 | 326 … | } |
316 | 327 … | static get typeId () { |
317 | | - return 299 |
| 328 … | + return 211 |
318 | 329 … | } |
319 | 330 … | } |
320 | 331 … | |
321 | 332 … | class First extends BaseContainer { |
345 | 356 … | hypervisor.registerContainer(Root) |
346 | 357 … | hypervisor.registerContainer(First) |
347 | 358 … | hypervisor.registerContainer(Waiter) |
348 | 359 … | |
349 | | - let root = await hypervisor.send(creationPort, new Message({ |
| 360 … | + let root = await hypervisor.send(creationPort, new CreationMessage({ |
350 | 361 … | data: { |
351 | 362 … | type: Root.typeId |
352 | 363 … | } |
353 | 364 … | })) |
360 | 371 … | const message = root.createMessage() |
361 | 372 … | await Promise.all([ |
362 | 373 … | root.send(portRef1, message), |
363 | 374 … | root.ports.bind('first', portRef1), |
364 | | - root.send(creationPort, root.createMessage({ |
| 375 … | + root.send(creationPort, new CreationMessage({ |
365 | 376 … | data: { |
366 | 377 … | type: Root.typeId |
367 | 378 … | }, |
368 | 379 … | ports: [portRef2] |
389 | 400 … | runs++ |
390 | 401 … | const [portRef1, portRef2] = this.kernel.ports.createChannel() |
391 | 402 … | const [portRef3, portRef4] = this.kernel.ports.createChannel() |
392 | 403 … | |
393 | | - const message1 = this.kernel.createMessage({ |
| 404 … | + const message1 = new CreationMessage({ |
394 | 405 … | data: { |
395 | 406 … | type: First.typeId |
396 | 407 … | }, |
397 | 408 … | ports: [portRef2] |
398 | 409 … | }) |
399 | 410 … | |
400 | | - const message2 = this.kernel.createMessage({ |
| 411 … | + const message2 = new CreationMessage({ |
401 | 412 … | data: { |
402 | 413 … | type: Second.typeId |
403 | 414 … | }, |
404 | 415 … | ports: [portRef4] |
424 | 435 … | t.equals(m.data, 'third', 'should recived the third message') |
425 | 436 … | } |
426 | 437 … | } |
427 | 438 … | static get typeId () { |
428 | | - return 299 |
| 439 … | + return 112 |
429 | 440 … | } |
|
430 | 441 … | } |
431 | 442 … | |
432 | 443 … | class First extends BaseContainer { |
469 | 480 … | hypervisor.registerContainer(First) |
470 | 481 … | hypervisor.registerContainer(Second) |
471 | 482 … | hypervisor.registerContainer(Waiter) |
472 | 483 … | |
473 | | - let root = await hypervisor.send(creationPort, new Message({ |
| 484 … | + let root = await hypervisor.send(creationPort, new CreationMessage({ |
474 | 485 … | data: { |
475 | 486 … | type: Root.typeId |
476 | 487 … | } |
477 | 488 … | })) |
485 | 496 … | const message = root.createMessage() |
486 | 497 … | await Promise.all([ |
487 | 498 … | root.send(portRef1, message), |
488 | 499 … | root.ports.bind('first', portRef1), |
489 | | - root.send(creationPort, root.createMessage({ |
| 500 … | + root.send(creationPort, new CreationMessage({ |
490 | 501 … | data: { |
491 | 502 … | type: Root.typeId |
492 | 503 … | }, |
493 | 504 … | ports: [portRef2] |
494 | 505 … | })), |
495 | 506 … | root.ports.bind('sencond', portRef3), |
496 | | - root.send(creationPort, root.createMessage({ |
| 507 … | + root.send(creationPort, new CreationMessage({ |
497 | 508 … | data: { |
498 | 509 … | type: Waiter.typeId |
499 | 510 … | }, |
500 | 511 … | ports: [portRef4] |
524 | 535 … | async onMessage (m) { |
525 | 536 … | let one = this.kernel.ports.get('one') |
526 | 537 … | if (!one) { |
527 | 538 … | const [portRef1, portRef2] = this.kernel.ports.createChannel() |
528 | | - const message1 = this.kernel.createMessage({ |
| 539 … | + const message1 = new CreationMessage({ |
529 | 540 … | data: { |
530 | 541 … | type: First.typeId |
531 | 542 … | }, |
532 | 543 … | ports: [portRef2] |
540 | 551 … | ]) |
541 | 552 … | } |
542 | 553 … | } |
543 | 554 … | static get typeId () { |
544 | | - return 299 |
| 555 … | + return 111 |
545 | 556 … | } |
546 | 557 … | } |
547 | 558 … | |
548 | 559 … | class First extends BaseContainer { |
558 | 569 … | |
559 | 570 … | hypervisor.registerContainer(Root) |
560 | 571 … | hypervisor.registerContainer(First) |
561 | 572 … | |
562 | | - let root = await hypervisor.send(creationPort, new Message({ |
| 573 … | + let root = await hypervisor.send(creationPort, new CreationMessage({ |
563 | 574 … | data: { |
564 | 575 … | type: Root.typeId |
565 | 576 … | } |
566 | 577 … | })) |
570 | 581 … | |
571 | 582 … | const [portRef1, portRef2] = root.ports.createChannel() |
572 | 583 … | await Promise.all([ |
573 | 584 … | root.ports.bind('first', portRef1), |
574 | | - root.send(creationPort, root.createMessage({ |
| 585 … | + root.send(creationPort, new CreationMessage({ |
575 | 586 … | data: { |
576 | 587 … | type: Root.typeId |
577 | 588 … | }, |
578 | 589 … | ports: [portRef2] |
598 | 609 … | const hypervisor = new Hypervisor(tree) |
599 | 610 … | const creationPort = hypervisor.creationService.getPort() |
600 | 611 … | hypervisor.registerContainer(BaseContainer) |
601 | 612 … | |
602 | | - let root = await hypervisor.send(creationPort, new Message({ |
| 613 … | + let root = await hypervisor.send(creationPort, new CreationMessage({ |
603 | 614 … | data: { |
604 | 615 … | type: BaseContainer.typeId |
605 | 616 … | } |
606 | 617 … | })) |
608 | 619 … | hypervisor.pin(root) |
609 | 620 … | root = await hypervisor.getInstance(root.id) |
610 | 621 … | |
611 | 622 … | const [portRef1, portRef2] = root.ports.createChannel() |
612 | | - root.send(creationPort, root.createMessage({ |
| 623 … | + root.send(creationPort, new CreationMessage({ |
613 | 624 … | data: { |
614 | 625 … | type: BaseContainer.typeId |
615 | 626 … | }, |
616 | 627 … | ports: [portRef2] |
658 | 669 … | |
659 | 670 … | class Root extends BaseContainer { |
660 | 671 … | async onMessage (m) { |
661 | 672 … | const [portRef1, portRef2] = this.kernel.ports.createChannel() |
662 | | - const message1 = this.kernel.createMessage({ |
| 673 … | + const message1 = new CreationMessage({ |
663 | 674 … | data: { |
664 | 675 … | type: First.typeId |
665 | 676 … | }, |
666 | 677 … | ports: [portRef2] |
680 | 691 … | this.kernel.incrementTicks(2) |
681 | 692 … | return this.kernel.ports.delete('root') |
682 | 693 … | } |
683 | 694 … | static get typeId () { |
684 | | - return 299 |
| 695 … | + return 111 |
685 | 696 … | } |
686 | 697 … | } |
687 | 698 … | |
688 | 699 … | hypervisor.registerContainer(Root) |
689 | 700 … | hypervisor.registerContainer(First) |
690 | 701 … | |
691 | | - let root = await hypervisor.send(creationPort, new Message({ |
| 702 … | + let root = await hypervisor.send(creationPort, new CreationMessage({ |
692 | 703 … | data: { |
693 | 704 … | type: Root.typeId |
694 | 705 … | } |
695 | 706 … | })) |
698 | 709 … | root = await hypervisor.getInstance(root.id) |
699 | 710 … | |
700 | 711 … | const [portRef1, portRef2] = root.ports.createChannel() |
701 | 712 … | await root.ports.bind('first', portRef1) |
702 | | - await root.send(creationPort, root.createMessage({ |
| 713 … | + await root.send(creationPort, new CreationMessage({ |
703 | 714 … | data: { |
704 | 715 … | type: Root.typeId |
705 | 716 … | }, |
706 | 717 … | ports: [portRef2] |
729 | 740 … | const creationPort = hypervisor.creationService.getPort() |
730 | 741 … | |
731 | 742 … | class Root extends BaseContainer { |
732 | 743 … | onMessage (m) { |
733 | | - return this.kernel.send(creationPort, new Message({ |
| 744 … | + return this.kernel.send(creationPort, new CreationMessage({ |
734 | 745 … | data: { |
735 | 746 … | type: Root.typeId |
736 | 747 … | } |
737 | 748 … | })) |
739 | 750 … | } |
740 | 751 … | |
741 | 752 … | hypervisor.registerContainer(Root) |
742 | 753 … | |
743 | | - let root = await hypervisor.send(creationPort, new Message({ |
| 754 … | + let root = await hypervisor.send(creationPort, new CreationMessage({ |
744 | 755 … | data: { |
745 | 756 … | type: Root.typeId |
746 | 757 … | } |
747 | 758 … | })) |
750 | 761 … | hypervisor.pin(root) |
751 | 762 … | |
752 | 763 … | const [portRef1, portRef2] = root.ports.createChannel() |
753 | 764 … | await root.ports.bind('first', portRef1) |
754 | | - await root.send(creationPort, root.createMessage({ |
| 765 … | + await root.send(creationPort, new CreationMessage({ |
755 | 766 … | data: { |
756 | 767 … | type: Root.typeId |
757 | 768 … | }, |
758 | 769 … | ports: [portRef2] |
780 | 791 … | |
781 | 792 … | class Root extends BaseContainer { |
782 | 793 … | onMessage (m) { |
783 | 794 … | const [, portRef2] = this.kernel.ports.createChannel() |
784 | | - return this.kernel.send(creationPort, this.kernel.createMessage({ |
| 795 … | + return this.kernel.send(creationPort, new CreationMessage({ |
785 | 796 … | data: { |
786 | 797 … | type: Sub.typeId |
787 | 798 … | }, |
788 | 799 … | ports: [portRef2] |
798 | 809 … | |
799 | 810 … | hypervisor.registerContainer(Root) |
800 | 811 … | hypervisor.registerContainer(Sub) |
801 | 812 … | |
802 | | - let root = await hypervisor.send(creationPort, new Message({ |
| 813 … | + let root = await hypervisor.send(creationPort, new CreationMessage({ |
803 | 814 … | data: { |
804 | 815 … | type: Root.typeId |
805 | 816 … | } |
806 | 817 … | })) |
810 | 821 … | hypervisor.pin(root) |
811 | 822 … | |
812 | 823 … | const [portRef1, portRef2] = root.ports.createChannel() |
813 | 824 … | await root.ports.bind('first', portRef1) |
814 | | - await root.send(creationPort, root.createMessage({ |
| 825 … | + await root.send(creationPort, new CreationMessage({ |
815 | 826 … | data: { |
816 | 827 … | type: Root.typeId |
817 | 828 … | }, |
818 | 829 … | ports: [portRef2] |
829 | 840 … | tape('should not remove connected nodes', async t => { |
830 | 841 … | const tree = new RadixTree({ |
831 | 842 … | db: db |
832 | 843 … | }) |
| 844 … | + |
833 | 845 … | const expectedSr = { |
834 | | - '/': Buffer.from('76711d128d0be5fe86833af5ab8f48afeec3410e', 'hex') |
| 846 … | + '/': Buffer.from('9aeb0ce35c0ab845e7b273afe0329f826297124e', 'hex') |
835 | 847 … | } |
836 | 848 … | |
837 | 849 … | const hypervisor = new Hypervisor(tree) |
838 | 850 … | const creationPort = hypervisor.creationService.getPort() |
844 | 856 … | await this.kernel.send(port, m) |
845 | 857 … | return this.kernel.ports.unbind('test1') |
846 | 858 … | } else { |
847 | 859 … | const [portRef1, portRef2] = this.kernel.ports.createChannel() |
848 | | - await this.kernel.send(creationPort, this.kernel.createMessage({ |
| 860 … | + await this.kernel.send(creationPort, new CreationMessage({ |
849 | 861 … | data: { |
850 | 862 … | type: Sub.typeId |
851 | 863 … | }, |
852 | 864 … | ports: [portRef2] |
853 | 865 … | })) |
854 | 866 … | await this.kernel.ports.bind('test1', portRef1) |
855 | 867 … | |
856 | 868 … | const [portRef3, portRef4] = this.kernel.ports.createChannel() |
857 | | - await this.kernel.send(creationPort, this.kernel.createMessage({ |
| 869 … | + await this.kernel.send(creationPort, new CreationMessage({ |
858 | 870 … | data: { |
859 | 871 … | type: Sub.typeId |
860 | 872 … | }, |
861 | 873 … | ports: [portRef4] |
881 | 893 … | return this.kernel.ports.bind('channel', message.ports[0]) |
882 | 894 … | } |
883 | 895 … | } |
884 | 896 … | static get typeId () { |
885 | | - return 299 |
| 897 … | + return 111 |
886 | 898 … | } |
887 | 899 … | } |
888 | 900 … | |
889 | 901 … | hypervisor.registerContainer(Root) |
890 | 902 … | hypervisor.registerContainer(Sub) |
891 | 903 … | |
892 | | - let root = await hypervisor.send(creationPort, new Message({ |
| 904 … | + let root = await hypervisor.send(creationPort, new CreationMessage({ |
893 | 905 … | data: { |
894 | 906 … | type: Root.typeId |
895 | 907 … | } |
896 | 908 … | })) |
899 | 911 … | hypervisor.pin(root) |
900 | 912 … | |
901 | 913 … | const [portRef1, portRef2] = root.ports.createChannel() |
902 | 914 … | await root.ports.bind('first', portRef1) |
903 | | - await root.send(creationPort, root.createMessage({ |
| 915 … | + await root.send(creationPort, new CreationMessage({ |
904 | 916 … | data: { |
905 | 917 … | type: Root.typeId |
906 | 918 … | }, |
907 | 919 … | ports: [portRef2] |
938 | 950 … | } else { |
939 | 951 … | const [portRef1, portRef2] = this.kernel.ports.createChannel() |
940 | 952 … | const [portRef3, portRef4] = this.kernel.ports.createChannel() |
941 | 953 … | return Promise.all([ |
942 | | - this.kernel.send(creationPort, this.kernel.createMessage({ |
| 954 … | + this.kernel.send(creationPort, new CreationMessage({ |
943 | 955 … | data: { |
944 | 956 … | type: Sub.typeId |
945 | 957 … | }, |
946 | 958 … | ports: [portRef2] |
947 | 959 … | })), |
948 | 960 … | this.kernel.ports.bind('test1', portRef1), |
949 | | - this.kernel.send(creationPort, this.kernel.createMessage({ |
| 961 … | + this.kernel.send(creationPort, new CreationMessage({ |
950 | 962 … | data: { |
951 | 963 … | type: Sub.typeId |
952 | 964 … | }, |
953 | 965 … | ports: [portRef4] |
974 | 986 … | return this.kernel.ports.bind('channel', message.ports[0]) |
975 | 987 … | } |
976 | 988 … | } |
977 | 989 … | static get typeId () { |
978 | | - return 299 |
| 990 … | + return 111 |
979 | 991 … | } |
980 | 992 … | } |
981 | 993 … | |
982 | 994 … | hypervisor.registerContainer(Root) |
983 | 995 … | hypervisor.registerContainer(Sub) |
984 | 996 … | |
985 | | - let root = await hypervisor.send(creationPort, new Message({ |
| 997 … | + let root = await hypervisor.send(creationPort, new CreationMessage({ |
986 | 998 … | data: { |
987 | 999 … | type: Root.typeId |
988 | 1000 … | } |
989 | 1001 … | })) |
993 | 1005 … | |
994 | 1006 … | const [portRef1, portRef2] = root.ports.createChannel() |
995 | 1007 … | await Promise.all([ |
996 | 1008 … | root.ports.bind('first', portRef1), |
997 | | - root.send(creationPort, root.createMessage({ |
| 1009 … | + root.send(creationPort, new CreationMessage({ |
998 | 1010 … | data: { |
999 | 1011 … | type: Root.typeId |
1000 | 1012 … | }, |
1001 | 1013 … | ports: [portRef2] |
1034 | 1046 … | } |
1035 | 1047 … | |
1036 | 1048 … | hypervisor.registerContainer(testVMContainer) |
1037 | 1049 … | |
1038 | | - let rootContainer = await hypervisor.send(creationPort, new Message({ |
| 1050 … | + let rootContainer = await hypervisor.send(creationPort, new CreationMessage({ |
1039 | 1051 … | data: { |
1040 | 1052 … | type: testVMContainer.typeId |
1041 | 1053 … | } |
1042 | 1054 … | })) |
1045 | 1057 … | |
1046 | 1058 … | hypervisor.pin(rootContainer) |
1047 | 1059 … | |
1048 | 1060 … | const [portRef1, portRef2] = rootContainer.ports.createChannel() |
1049 | | - const initMessage = rootContainer.createMessage({ |
| 1061 … | + const initMessage = new CreationMessage({ |
1050 | 1062 … | data: { |
1051 | 1063 … | type: testVMContainer.typeId |
1052 | 1064 … | }, |
1053 | 1065 … | ports: [portRef2] |
1081 | 1093 … | |
1082 | 1094 … | const hypervisor = new Hypervisor(tree) |
1083 | 1095 … | const creationPort = hypervisor.creationService.getPort() |
1084 | 1096 … | hypervisor.registerContainer(testVMContainer) |
1085 | | - const instance = await hypervisor.send(creationPort, new Message({ |
| 1097 … | + const instance = await hypervisor.send(creationPort, new CreationMessage({ |
1086 | 1098 … | data: { |
1087 | 1099 … | type: testVMContainer.typeId |
1088 | 1100 … | } |
1089 | 1101 … | })) |
1100 | 1112 … | |
1101 | 1113 … | const hypervisor = new Hypervisor(tree) |
1102 | 1114 … | const creationPort = hypervisor.creationService.getPort() |
1103 | 1115 … | hypervisor.registerContainer(testVMContainer) |
1104 | | - const oldInst = await hypervisor.send(creationPort, new Message({ |
| 1116 … | + const oldInst = await hypervisor.send(creationPort, new CreationMessage({ |
1105 | 1117 … | data: { |
1106 | 1118 … | type: testVMContainer.typeId, |
1107 | 1119 … | code: content |
1108 | 1120 … | } |
1123 | 1135 … | const creationPort = m.ports[0] |
1124 | 1136 … | const [port1, port2] = this.kernel.ports.createChannel() |
1125 | 1137 … | await this.kernel.ports.bind('child', port1) |
1126 | 1138 … | |
1127 | | - const message = this.kernel.createMessage({ |
| 1139 … | + const message = new CreationMessage({ |
1128 | 1140 … | data: { |
1129 | 1141 … | type: TestVMContainer2.typeId |
1130 | 1142 … | }, |
1131 | 1143 … | ports: [port2] |
1146 | 1158 … | |
1147 | 1159 … | const port = hypervisor.creationService.getPort() |
1148 | 1160 … | const port2 = hypervisor.creationService.getPort() |
1149 | 1161 … | |
1150 | | - const root = await hypervisor.send(port2, new Message({ |
| 1162 … | + const root = await hypervisor.send(port2, new CreationMessage({ |
1151 | 1163 … | data: { |
1152 | 1164 … | type: TestVMContainer.typeId |
1153 | 1165 … | }, |
1154 | 1166 … | ports: [port] |
1193 | 1205 … | hypervisor.registerContainer(TestVMContainer) |
1194 | 1206 … | |
1195 | 1207 … | const port = hypervisor.creationService.getPort() |
1196 | 1208 … | |
1197 | | - const root = await hypervisor.send(port, new Message({ |
| 1209 … | + const root = await hypervisor.send(port, new CreationMessage({ |
1198 | 1210 … | data: { |
1199 | 1211 … | type: TestVMContainer.typeId |
1200 | 1212 … | }, |
1201 | 1213 … | ports: [port] |
1227 | 1239 … | hypervisor.registerContainer(TestVMContainer) |
1228 | 1240 … | |
1229 | 1241 … | const port = hypervisor.creationService.getPort() |
1230 | 1242 … | |
1231 | | - await hypervisor.send(port, new Message({ |
| 1243 … | + await hypervisor.send(port, new CreationMessage({ |
1232 | 1244 … | data: { |
1233 | 1245 … | type: TestVMContainer.typeId |
1234 | 1246 … | }, |
1235 | 1247 … | ports: [port] |