Files: 798d22f70346b2550010f853c9c3582ae86e1f35 / index.js
837 bytesRaw
1 | const Environment = require('./testEnvironment.js') |
2 | const Interface = require('./interface.js') |
3 | |
4 | module.exports = class BaseStateTranitions { |
5 | // runs some code in the VM |
6 | constructor (state) { |
7 | this.state = state |
8 | } |
9 | |
10 | // handles running code |
11 | static codeHandler (code, environment) { |
12 | const ethInterface = new Interface(environment) |
13 | const instance = Wasm.instantiateModule(code, ethInterface) |
14 | ethInterface.setModule(ethInterface) |
15 | return instance |
16 | } |
17 | |
18 | // loads code from the merkle trie and run it |
19 | // callHandler (msg, code) { |
20 | // const instance = Wasm.instantiateModule(code, interface) |
21 | // interface.setModule(instance) |
22 | // return instance |
23 | // } |
24 | |
25 | // Builtin contracts |
26 | // run code |
27 | |
28 | // run tx |
29 | // runTx () {} |
30 | |
31 | // run block |
32 | // runBlock () {} |
33 | |
34 | // run blockchain |
35 | // runBlockchain () {} |
36 | } |
37 |
Built with git-ssb-web