git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 19b980f7bfa315ae01afacb96f1bb76873270b53

fix merge

Signed-off-by: wanderer <mjbecze@gmail.com>
wanderer committed on 3/6/2018, 4:59:05 AM
Parent: bbb47d3d45e91192536bed869cc4185e19cc74d0

Files changed

tests/wasmContainer.jschanged
wasmContainer.jschanged
tests/wasmContainer.jsView
@@ -66,9 +66,9 @@
6666 tape('empty', async t => {
6767 t.plan(1)
6868 tester = t
6969 const expectedState = {
70- '/': Buffer.from('a2440f97e233b183f5e66fb6d60765311be7a2b7', 'hex')
70+ '/': Buffer.from('bda5092c441e8d40c32eeeb69ce0e493f9d487cb', 'hex')
7171 }
7272
7373 const tree = new RadixTree({
7474 db
@@ -279,28 +279,4 @@
279279 })
280280 hypervisor.send(message)
281281 })
282282 })
283-
284-tape('ben', async t => {
285- // t.plan(1)
286- tester = t
287- const tree = new RadixTree({
288- db
289- })
290-
291- const wasm = fs.readFileSync(WASM_PATH + '.wasm')
292- const hypervisor = new Hypervisor(tree)
293- hypervisor.registerContainer(TestWasmContainer)
294-
295- const {module} = await hypervisor.createActor(TestWasmContainer.typeId, wasm)
296-
297- const funcRef = module.getFuncRef('#main')
298- funcRef.gas = 100000
299-
300- const message = new Message({
301- funcRef
302- }).on('done', () => {
303- t.end()
304- })
305- hypervisor.send(message)
306-})
wasmContainer.jsView
@@ -155,9 +155,9 @@
155155
156156 },
157157 export: (modRef, bufRef) => {
158158 const mod = this.refs.get(modRef, 'mod')
159- let name = this.get8Memory(offset, length)
159+ let name = this.refs.get(bufRef, 'buf')
160160 name = Buffer.from(name).toString()
161161 const funcRef = mod.getFuncRef(name)
162162 return this.refs.add(funcRef, 'func')
163163 },

Built with git-ssb-web