tests/index.jsView |
---|
9 | 9 | start: false |
10 | 10 | }) |
11 | 11 | |
12 | 12 | class BaseContainer extends AbstractContainer { |
13 | | - onInitialize (message) { |
| 13 | + onCreation (message) { |
14 | 14 | this.kernel.state.code = message.data.byteLength ? message.data : undefined |
15 | 15 | const port = message.ports[0] |
16 | 16 | if (port) { |
17 | 17 | this.kernel.ports.bind('root', port) |
61 | 61 | '/': 'zdpuAozDi6tKPbqmHJxo7aNES2xVt1MkaCLyxcioEKzz3M2WH' |
62 | 62 | } |
63 | 63 | |
64 | 64 | class testVMContainer extends BaseContainer { |
65 | | - onInitialize () {} |
| 65 | + onCreation () {} |
66 | 66 | } |
67 | 67 | |
68 | 68 | const hypervisor = new Hypervisor(node.dag) |
69 | 69 | hypervisor.registerContainer('test', testVMContainer) |
506 | 506 | } |
507 | 507 | } |
508 | 508 | |
509 | 509 | class Waiter extends BaseContainer { |
510 | | - onInitialize () { |
| 510 | + onCreation () { |
511 | 511 | return new Promise((resolve, reject) => { |
512 | 512 | setTimeout(() => { |
513 | 513 | resolve() |
514 | 514 | }, 200) |