tests/index.jsView |
---|
55 | 55 | }) |
56 | 56 | hypervisor.send(message) |
57 | 57 | }) |
58 | 58 | |
| 59 | +tape('reintinalizing', async t => { |
| 60 | + t.plan(1) |
| 61 | + tester = t |
| 62 | + const tree = new RadixTree({db}) |
| 63 | + let wasm = fs.readFileSync(WASM_PATH + '/reinternalize.wasm') |
| 64 | + |
| 65 | + const hypervisor = new Hypervisor(tree) |
| 66 | + hypervisor.registerContainer(TestWasmContainer) |
| 67 | + |
| 68 | + const {module} = await hypervisor.createActor(TestWasmContainer.typeId, wasm) |
| 69 | + const funcRef = module.getFuncRef('main') |
| 70 | + funcRef.gas = 322000 |
| 71 | + |
| 72 | + const message = new Message({ |
| 73 | + funcRef |
| 74 | + }).on('execution:error', e => { |
| 75 | + console.log(e) |
| 76 | + }) |
| 77 | + hypervisor.send(message) |
| 78 | +}) |
| 79 | + |
59 | 80 | tape('basic', async t => { |
60 | 81 | t.plan(1) |
61 | 82 | tester = t |
62 | 83 | |
83 | 104 | |
84 | 105 | |
85 | 106 | }) |
86 | 107 | |
| 108 | + |
87 | 109 | tape('empty', async t => { |
88 | 110 | t.plan(1) |
89 | 111 | tester = t |
90 | 112 | const expectedState = Buffer.from('bb15867b26293aa36c774b8c82541dd64212ba9a', 'hex') |