Commit 92bdd565f07820a196efab77f374ae697b1f1f6f
InterfaceRunner: use TestEnvironment
Alex Beregszaszi committed on 8/16/2016, 10:26:03 PMParent: 7b74d04925fc2be0babc02e191f66a3653f83dd4
Files changed
tests/interfaceRunner.js | changed |
tests/interfaceRunner.js | ||
---|---|---|
@@ -3,9 +3,9 @@ | ||
3 | 3 | const fs = require('fs') |
4 | 4 | const cp = require('child_process') |
5 | 5 | |
6 | 6 | const Kernel = require('../index.js') |
7 | -const Environment = require('../environment.js') | |
7 | +const TestEnvironment = require('../testEnvironment.js') | |
8 | 8 | const Interface = require('../interface.js') |
9 | 9 | const DebugInterface = require('../debugInterface.js') |
10 | 10 | const dir = __dirname + '/interface' |
11 | 11 | // get the test names |
@@ -17,13 +17,13 @@ | ||
17 | 17 | tape(testName, (t) => { |
18 | 18 | // Compile Command |
19 | 19 | cp.execSync(`${__dirname}/../tools/sexpr-wasm-prototype/out/sexpr-wasm ${dir}/${testName}.wast -o ${dir}/${testName}.wasm`) |
20 | 20 | const buffer = fs.readFileSync(`${dir}/${testName}.wasm`) |
21 | - const envData = fs.readFileSync(`${dir}/${testName}.json`) | |
22 | - const ethereum = new Kernel(new Environment(envData)) | |
21 | + const envData = fs.readFileSync(`${dir}/${testName}.json`).toString() | |
22 | + const ethereum = new Kernel(new TestEnvironment(envData)) | |
23 | 23 | |
24 | 24 | // manually `callHander` |
25 | - const environment = new Environment(envData) | |
25 | + const environment = new TestEnvironment(envData) | |
26 | 26 | environment.parent = ethereum |
27 | 27 | const testContract = new Kernel(environment) |
28 | 28 | const ethInterface = new Interface(environment, testContract) |
29 | 29 | const debugInterface = new DebugInterface() |
Built with git-ssb-web