Commit 00d436ed0d3c6e425ef1955e0a39f2cf831fad69
Environment: use block/blockchain consistently
Alex Beregszaszi committed on 8/23/2016, 1:14:33 AMParent: ffc7e461609ab3a4b2c3a041acb1124e6fc1c311
Files changed
environment.js | changed |
environment.js | ||
---|---|---|
@@ -1,15 +1,14 @@ | ||
1 | 1 | const U256 = require('./u256.js') |
2 | 2 | const Address = require('./address.js') |
3 | 3 | const Block = require('./block.js') |
4 | -const blockChain = require('./fakeBlockChain.js') | |
4 | +const fakeBlockChain = require('./fakeBlockChain.js') | |
5 | 5 | |
6 | 6 | module.exports = class Environment { |
7 | 7 | constructor (data) { |
8 | - const block = new Block() | |
9 | - | |
10 | 8 | const defaults = { |
11 | - block: block, | |
9 | + block: new Block(), | |
10 | + blockchain: fakeBlockChain, | |
12 | 11 | // gas tank |
13 | 12 | gasPrice: 0, |
14 | 13 | gasLeft: 1000000, |
15 | 14 | gasRefund: 0, |
@@ -51,9 +50,9 @@ | ||
51 | 50 | return this.state.get(address.toString())['code'] |
52 | 51 | } |
53 | 52 | |
54 | 53 | getBlockHash (height) { |
55 | - return blockChain.getBlock(height).hash() | |
54 | + return this.blockchain.getBlock(height).hash() | |
56 | 55 | } |
57 | 56 | |
58 | 57 | // kernal |
59 | 58 | create (code, value) { |
Built with git-ssb-web