Commit 6bd194b9cc65a9636ef49d5e3457cca94318c43a
Merge pull request #42 from ewasm/accounts_fix
this fixes the accounts by making them Mapswanderer authored on 8/26/2016, 3:42:50 PM
GitHub committed on 8/26/2016, 3:42:50 PM
Parent: 44c70314f4cb4bdce4bf22769116f514334368fd
Parent: 367c578a5d2ee433099674d1e53a194032ca3e14
Files changed
environment.js | changed |
testEnvironment.js | changed |
environment.js | ||
---|---|---|
@@ -43,18 +43,18 @@ | ||
43 | 43 | |
44 | 44 | getBalance (address) { |
45 | 45 | const account = this.state.get(address.toString()) |
46 | 46 | if (account) { |
47 | - return account['balance'] | |
47 | + return account.get('balance') | |
48 | 48 | } else { |
49 | 49 | return new U256() |
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | 53 | getCode (address) { |
54 | 54 | const account = this.state.get(address.toString()) |
55 | 55 | if (account) { |
56 | - return account['code'] | |
56 | + return account.get('code') | |
57 | 57 | } else { |
58 | 58 | return Uint8Array.from(new Buffer([])) |
59 | 59 | } |
60 | 60 | } |
testEnvironment.js | ||
---|---|---|
@@ -16,11 +16,11 @@ | ||
16 | 16 | |
17 | 17 | if (data.accounts) { |
18 | 18 | data.accounts.forEach((account) => { |
19 | 19 | let tmp = account[1] |
20 | - self.state.set(new Address(account[0]).toString(), { | |
21 | - balance: new U256(tmp.balance) | |
22 | - }) | |
20 | + self.state.set(new Address(account[0]).toString(), new Map( | |
21 | + [['balance', new U256(tmp.balance)]] | |
22 | + )) | |
23 | 23 | }) |
24 | 24 | } |
25 | 25 | |
26 | 26 | if (data.address) { |
Built with git-ssb-web