Commit 149ab676e7bbe8b9f0100bacfa0aca71c6a1ca27
TestEnvironment: set balances properly
Alex Beregszaszi committed on 8/17/2016, 12:53:57 AMParent: 953c34e7f7eb6e1ff41fa8f1cd161a1f62909b34
Files changed
testEnvironment.js | changed |
testEnvironment.js | ||
---|---|---|
@@ -1,7 +1,8 @@ | ||
1 | 1 | const Environment = require('./environment.js') |
2 | 2 | const U256 = require('./u256.js') |
3 | 3 | const Address = require('./address.js') |
4 | +const BN = require('bn.js') | |
4 | 5 | |
5 | 6 | module.exports = class TestEnvironment extends Environment { |
6 | 7 | constructor (data) { |
7 | 8 | super() |
@@ -13,9 +14,12 @@ | ||
13 | 14 | let self = this |
14 | 15 | |
15 | 16 | if (data.accounts) { |
16 | 17 | data.accounts.forEach((account) => { |
17 | - self.state.set(new Address(new Uint8Array(account[0])).toString(), account[1]) | |
18 | + let tmp = account[1] | |
19 | + self.state.set(new Address(new Uint8Array(account[0])).toString(), { | |
20 | + balance: new U256(new BN(tmp.balance, 16, 'le')) | |
21 | + }) | |
18 | 22 | }) |
19 | 23 | } |
20 | 24 | |
21 | 25 | if (data.address) { |
Built with git-ssb-web