Commit 89c0461616621d14c849ba592bac2c9ca85978d9
Environment: call to the parent environment where needed
Alex Beregszaszi committed on 8/26/2016, 11:46:57 PMParent: 3cb8a54180de3ba70e81bfebcd2e944557d99715
Files changed
environment.js | changed |
environment.js | ||
---|---|---|
@@ -37,22 +37,22 @@ | ||
37 | 37 | account.set('nonce', trie.nonce || new U256(0)) |
38 | 38 | account.set('balance', trie.balance || new U256(0)) |
39 | 39 | account.set('code', trie.code || new Uint8Array()) |
40 | 40 | account.set('storage', trie.storage || new Map()) |
41 | - this.state.set(address.toString(), account) | |
41 | + this.parent.state.set(address.toString(), account) | |
42 | 42 | } |
43 | 43 | |
44 | 44 | getBalance (address) { |
45 | - const account = this.state.get(address.toString()) | |
45 | + const account = this.parent.state.get(address.toString()) | |
46 | 46 | if (account) { |
47 | 47 | return account.get('balance') |
48 | 48 | } else { |
49 | 49 | return new U256() |
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | 53 | getCode (address) { |
54 | - const account = this.state.get(address.toString()) | |
54 | + const account = this.parent.state.get(address.toString()) | |
55 | 55 | if (account) { |
56 | 56 | return account.get('code') |
57 | 57 | } else { |
58 | 58 | return Uint8Array.from(new Buffer([])) |
Built with git-ssb-web