Commit 9b3329dc5651b7a48095840de3e6ff68d7c7d978
updated hypervisor
wanderer committed on 12/19/2017, 10:40:57 PMParent: 062257092daee02e573038655da5eacf19c69511
Files changed
package-lock.json | changed |
package.json | changed |
tests/index.js | changed |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 158775 bytes New file size: 160586 bytes |
package.json | ||
---|---|---|
@@ -25,9 +25,9 @@ | ||
25 | 25 | "coveralls": "^3.0.0", |
26 | 26 | "dfinity-radix-tree": "0.0.9", |
27 | 27 | "level-browserify": "^1.1.1", |
28 | 28 | "nyc": "^11.3.0", |
29 | - "primea-hypervisor": "^0.4.3", | |
29 | + "primea-hypervisor": "^0.4.5", | |
30 | 30 | "primea-message": "^0.6.0", |
31 | 31 | "standard": "^10.0.0", |
32 | 32 | "tape": "^4.6.3", |
33 | 33 | "wast2wasm": "0.0.1" |
tests/index.js | ||
---|---|---|
@@ -82,25 +82,27 @@ | ||
82 | 82 | |
83 | 83 | tape('write mem', async t => { |
84 | 84 | const hypervisor = new Hypervisor(tree) |
85 | 85 | const readMem = fs.readFileSync(`${__dirname}/wasm/writeMem.wasm`) |
86 | + let cap | |
86 | 87 | |
87 | 88 | class WasmContainerNoIdle extends WasmContainer { |
88 | - onIdle () {} | |
89 | + async onIdle () { | |
90 | + const actor = await hypervisor.getActor(cap.destId) | |
91 | + const mem = actor.container.getMemory(0, 1) | |
92 | + t.equals(mem[0], 9) | |
93 | + t.end() | |
94 | + } | |
89 | 95 | } |
90 | 96 | |
91 | 97 | hypervisor.registerContainer(WasmContainerNoIdle, { |
92 | 98 | env: ContainerTestInterface, |
93 | 99 | test: testInterface(t) |
94 | 100 | }) |
95 | 101 | |
96 | - const cap = await hypervisor.createActor(WasmContainerNoIdle.typeId, new Message({ | |
102 | + cap = await hypervisor.createActor(WasmContainerNoIdle.typeId, new Message({ | |
97 | 103 | data: readMem |
98 | 104 | })) |
99 | - const actor = await hypervisor.getActor(cap.destId) | |
100 | - const mem = actor.container.getMemory(0, 1) | |
101 | - t.equals(mem[0], 9) | |
102 | - t.end() | |
103 | 105 | }) |
104 | 106 | |
105 | 107 | tape('wasm container - callbacks', async t => { |
106 | 108 | t.plan(1) |
Built with git-ssb-web