Commit 2c04524fc8e9b757c060e0e2cf80d26d6d411e57
correctly initial the WASM module
wanderer committed on 7/13/2016, 3:18:25 PMParent: 69d908b662b364266978220167a30f9800f3102c
Files changed
README.md | changed |
index.js | changed |
README.md | ||
---|---|---|
@@ -1,5 +1,5 @@ | ||
1 | -# SYNOPSIS | |
1 | +# SYNOPSIS - WIP | |
2 | 2 | [![Gitter](https://img.shields.io/gitter/room/ethereum/ethereumjs-lib.svg?style=flat-square)](https://gitter.im/ethereum/ethereumjs-lib) or #ethereumjs on freenode |
3 | 3 | |
4 | 4 | [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) |
5 | 5 |
index.js | ||
---|---|---|
@@ -20,24 +20,27 @@ | ||
20 | 20 | |
21 | 21 | // handles running code. |
22 | 22 | static codeHandler (code, environment) { |
23 | 23 | const ethInterface = new Interface(environment) |
24 | - const instance = Wasm.instantiateModule(code, ethInterface) | |
24 | + const instance = Wasm.instantiateModule(code, { | |
25 | + 'ethereum': ethInterface | |
26 | + }) | |
25 | 27 | ethInterface.setModule(ethInterface) |
26 | 28 | return instance |
27 | 29 | } |
28 | 30 | |
29 | 31 | // loads code from the merkle trie and delegates the message |
30 | - static call (path, data, environment) { | |
32 | + // Detects if the code injection is needed | |
33 | + static callHandler (path, data, environment) { | |
31 | 34 | // const instance = Wasm.instantiateModule(code, interface) |
32 | 35 | // interface.setModule(instance) |
33 | 36 | // return instance |
34 | 37 | } |
35 | 38 | |
36 | 39 | // run tx |
37 | 40 | runTx (tx, environment) { |
38 | 41 | // verify tx then send to call Handler |
39 | - this.call(tx, environment) | |
42 | + this.callHandler(tx, environment) | |
40 | 43 | } |
41 | 44 | |
42 | 45 | // run block |
43 | 46 | runBlock (block, environment) { |
Built with git-ssb-web