Commit 6c9a7f1801d055fef0ca11b55a4047a6360bccd6
TestEnvironment: use Address type
Alex Beregszaszi committed on 8/16/2016, 11:12:39 PMParent: d3a050a5491cb0c8f228c86cf23e8cf4725e2038
Files changed
testEnvironment.js | changed |
testEnvironment.js | ||
---|---|---|
@@ -1,6 +1,7 @@ | ||
1 | 1 | const Environment = require('./environment.js') |
2 | 2 | const U256 = require('./u256.js') |
3 | +const Address = require('./address.js') | |
3 | 4 | |
4 | 5 | module.exports = class TestEnvironment extends Environment { |
5 | 6 | constructor (data) { |
6 | 7 | super() |
@@ -12,22 +13,22 @@ | ||
12 | 13 | let self = this |
13 | 14 | |
14 | 15 | if (data.accounts) { |
15 | 16 | data.accounts.forEach((account) => { |
16 | - self.state.set(new Uint8Array(account[0]).toString(), account[1]) | |
17 | + self.state.set(new Address(new Uint8Array(account[0])).toString(), account[1]) | |
17 | 18 | }) |
18 | 19 | } |
19 | 20 | |
20 | 21 | if (data.address) { |
21 | - self.address = new Uint8Array(data.address) | |
22 | + self.address = new Address(new Uint8Array(data.address)) | |
22 | 23 | } |
23 | 24 | |
24 | 25 | if (data.origin) { |
25 | - self.origin = new Uint8Array(data.origin) | |
26 | + self.origin = new Address(new Uint8Array(data.origin)) | |
26 | 27 | } |
27 | 28 | |
28 | 29 | if (data.caller) { |
29 | - self.caller = new Uint8Array(data.caller) | |
30 | + self.caller = new Address(new Uint8Array(data.caller)) | |
30 | 31 | } |
31 | 32 | |
32 | 33 | if (data.coinbase) { |
33 | 34 | self.coinbase = new Uint8Array(data.coinbase) |
Built with git-ssb-web