git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit a9ce2e3d2d7449ca0005d46cb47468fcfaf15223

Merge pull request #34 from ewasm/parent

Fix parent environment handling
wanderer authored on 10/6/2016, 8:16:16 AM
GitHub committed on 10/6/2016, 8:16:16 AM
Parent: 80cc9ff203abb03e4eb39d18d2801f1e2f0e52dd
Parent: 89c0461616621d14c849ba592bac2c9ca85978d9

Files changed

environment.jschanged
environment.jsView
@@ -38,9 +38,9 @@
3838 account.set('nonce', trie.nonce || new U256(0))
3939 account.set('balance', trie.balance || new U256(0))
4040 account.set('code', trie.code || new Uint8Array())
4141 account.set('storage', trie.storage || new Map())
42- this.state.set(address.toString(), account)
42+ this.parent.state.set(address.toString(), account)
4343 }
4444
4545 isAccountPresent (address) {
4646 const account = this.state.get(address.toString())
@@ -51,18 +51,18 @@
5151 }
5252 }
5353
5454 getBalance (address) {
55- const account = this.state.get(address.toString())
55+ const account = this.parent.state.get(address.toString())
5656 if (account) {
5757 return account.get('balance')
5858 } else {
5959 return new U256()
6060 }
6161 }
6262
6363 getCode (address) {
64- const account = this.state.get(address.toString())
64+ const account = this.parent.state.get(address.toString())
6565 if (account) {
6666 return account.get('code')
6767 } else {
6868 return Uint8Array.from(new Buffer([]))

Built with git-ssb-web