git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit dbb9b6eacbc6786a69bbe76a01aa4fb1d930ff18

Environment: include addAcount

Alex Beregszaszi committed on 8/23/2016, 12:27:46 AM
Parent: f324186087b016b58970772948aea63c250cbdb5

Files changed

environment.jschanged
environment.jsView
@@ -32,8 +32,18 @@
3232
3333 Object.assign(this, defaults, data || {})
3434 }
3535
36+ addAccount (address, trie) {
37+ let account = new Map()
38+ account.set('nonce', trie.nonce || new U256(0))
39+ account.set('balance', trie.balance || new U256(0))
40+ account.set('code', trie.code || new Uint8Array())
41+ account.set('storage', trie.storage || new Map())
42+
43+ this.state.set(address.toString(), account)
44+ }
45+
3646 getBalance (address) {
3747 return this.state.get(address.toString()).balance
3848 }
3949

Built with git-ssb-web