Commit 2552686760f62527d142c301b78cb108aa12d0a7
Lint fixes according to standard
Alex Beregszaszi committed on 8/23/2016, 12:39:12 AMParent: 3e30632034050031a6800119f8eebd8204b1bc98
Files changed
index.js | changed |
test.js | changed |
tests/interfaceRunner.js | changed |
utils.js | changed |
index.js | ||
---|---|---|
@@ -26,10 +26,10 @@ | ||
26 | 26 | const Utils = require('./utils.js') |
27 | 27 | const Transaction = require('./transaction.js') |
28 | 28 | const Precompile = require('./precompile.js') |
29 | 29 | |
30 | -const meteringContract = new Address("0x000000000000000000000000000000000000000A") | |
31 | -const transcompilerContract = new Address("0x000000000000000000000000000000000000000B") | |
30 | +const meteringContract = new Address('0x000000000000000000000000000000000000000A') | |
31 | +const transcompilerContract = new Address('0x000000000000000000000000000000000000000B') | |
32 | 32 | |
33 | 33 | module.exports = class Kernel { |
34 | 34 | // runs some code in the VM |
35 | 35 | constructor (environment = new Environment()) { |
@@ -81,9 +81,9 @@ | ||
81 | 81 | if (!account) { |
82 | 82 | throw new Error('Account not found: ' + call.to.toString()) |
83 | 83 | } |
84 | 84 | |
85 | - const code = Uint8Array.from(account.get('code')) | |
85 | + let code = Uint8Array.from(account.get('code')) | |
86 | 86 | if (code.length === 0) { |
87 | 87 | throw new Error('Contract not found') |
88 | 88 | } |
89 | 89 | |
@@ -107,15 +107,15 @@ | ||
107 | 107 | environment.callData = call.data |
108 | 108 | environment.callValue = call.value |
109 | 109 | environment.gasLeft = call.gasLimit |
110 | 110 | |
111 | - //environment.setCallHandler(callHandler) | |
111 | + // environment.setCallHandler(callHandler) | |
112 | 112 | |
113 | 113 | const kernel = new Kernel(this, environment) |
114 | 114 | kernel.codeHandler(code, new Interface(environment)) |
115 | 115 | |
116 | 116 | // generate new stateroot |
117 | - //this.environment.state.set(address, { stateRoot: stateRoot }) | |
117 | + // this.environment.state.set(address, { stateRoot: stateRoot }) | |
118 | 118 | |
119 | 119 | return { |
120 | 120 | executionOutcome: 1, // success |
121 | 121 | gasLeft: new U256(environment.gasLeft), |
test.js | ||
---|---|---|
@@ -9,9 +9,9 @@ | ||
9 | 9 | |
10 | 10 | const fs = require('fs') |
11 | 11 | |
12 | 12 | environment.addAccount(new Address('0x1234567890134561111123412341234123412341'), { balance: new U256('100000000000000000') }) |
13 | -//environment.addAccount(new Address('0x4123412341234123411234567890134561111123'), { code: Uint8Array.from(fs.readFileSync('identity.wasm')) }) | |
13 | +// environment.addAccount(new Address('0x4123412341234123411234567890134561111123'), { code: Uint8Array.from(fs.readFileSync('identity.wasm')) }) | |
14 | 14 | |
15 | 15 | environment.addAccount(new Address('0xbe862ad9abfe6f22bcb087716c7d89a26051f74c'), { balance: new U256('100000000000000000') }) |
16 | 16 | var tx = new Buffer('f8e380648203e88080b8977f4e616d65526567000000000000000000000000000000000000000000000000003057307f4e616d6552656700000000000000000000000000000000000000000000000000573360455760415160566000396000f20036602259604556330e0f600f5933ff33560f601e5960003356576000335700604158600035560f602b590033560f603659600033565733600035576000353357001ca0b8b9fedc076110cd002224a942e9d7099e4a626ebf66cd9301fc18e2c1181806a04e270be511d42189baf14599eb8d6eb5037ab105032dd3e0fa05b43dad4cb4c2', 'hex') |
17 | 17 | console.log(kernel.runTx(tx, environment)) |
@@ -30,9 +30,9 @@ | ||
30 | 30 | |
31 | 31 | ret = kernel.runTx({ |
32 | 32 | nonce: new U256(4), |
33 | 33 | from: new Address('0x1234567890134561111123412341234123412341'), |
34 | - to: ret.accountCreated, //new Address('0x4123412341234123411234567890134561111123'), | |
34 | + to: ret.accountCreated, // new Address('0x4123412341234123411234567890134561111123'), | |
35 | 35 | value: new U256('100'), |
36 | 36 | gasLimit: new U256('1000000000'), |
37 | 37 | gasPrice: new U256(1), |
38 | 38 | data: Uint8Array.from(new Buffer('spartaaaa')) |
tests/interfaceRunner.js | ||
---|---|---|
@@ -1,14 +1,16 @@ | ||
1 | 1 | |
2 | 2 | const tape = require('tape') |
3 | 3 | const fs = require('fs') |
4 | 4 | const cp = require('child_process') |
5 | +const path = require('path') | |
5 | 6 | |
6 | 7 | const Kernel = require('../index.js') |
7 | 8 | const TestEnvironment = require('../testEnvironment.js') |
8 | 9 | const Interface = require('../interface.js') |
9 | 10 | const DebugInterface = require('../debugInterface.js') |
10 | -const dir = __dirname + '/interface' | |
11 | + | |
12 | +const dir = path.join(__dirname, '/interface') | |
11 | 13 | // get the test names |
12 | 14 | let tests = fs.readdirSync(dir).filter((file) => file.endsWith('.wast')) |
13 | 15 | // tests = ['balance.wast'] |
14 | 16 | // run the tests |
Built with git-ssb-web