git ssb

0+

wanderer🌟 / js-primea-wasm-container



Commit 9b3329dc5651b7a48095840de3e6ff68d7c7d978

updated hypervisor

wanderer committed on 12/19/2017, 10:40:57 PM
Parent: 062257092daee02e573038655da5eacf19c69511

Files changed

package-lock.jsonchanged
package.jsonchanged
tests/index.jschanged
package-lock.jsonView
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.jsonView
@@ -25,9 +25,9 @@
2525 "coveralls": "^3.0.0",
2626 "dfinity-radix-tree": "0.0.9",
2727 "level-browserify": "^1.1.1",
2828 "nyc": "^11.3.0",
29- "primea-hypervisor": "^0.4.3",
29+ "primea-hypervisor": "^0.4.5",
3030 "primea-message": "^0.6.0",
3131 "standard": "^10.0.0",
3232 "tape": "^4.6.3",
3333 "wast2wasm": "0.0.1"
tests/index.jsView
@@ -82,25 +82,27 @@
8282
8383 tape('write mem', async t => {
8484 const hypervisor = new Hypervisor(tree)
8585 const readMem = fs.readFileSync(`${__dirname}/wasm/writeMem.wasm`)
86+ let cap
8687
8788 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+ }
8995 }
9096
9197 hypervisor.registerContainer(WasmContainerNoIdle, {
9298 env: ContainerTestInterface,
9399 test: testInterface(t)
94100 })
95101
96- const cap = await hypervisor.createActor(WasmContainerNoIdle.typeId, new Message({
102+ cap = await hypervisor.createActor(WasmContainerNoIdle.typeId, new Message({
97103 data: readMem
98104 }))
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()
103105 })
104106
105107 tape('wasm container - callbacks', async t => {
106108 t.plan(1)

Built with git-ssb-web