git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit c37a0e4f79312b8d2c82aea3bfeee95a6f812586

Kernel: use addAccount helper

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

Files changed

index.jschanged
index.jsView
@@ -129,18 +129,15 @@
129129 if (tx.to.isZero()) {
130130 if (tx.data.length !== 0) {
131131 console.log('This is a contract deployment transaction')
132132
133- let account = new Map()
134- account.set('nonce', new U256(0))
135- account.set('balance', tx.value)
136- account.set('code', tx.data)
137- account.set('storage', new Map())
133+ let address = Utils.newAccountAddress(tx.from, tx.data)
138134
139- let address = address = Utils.newAccountAddress(tx.from, tx.data)
135+ this.environment.addAccount(address.toString(), {
136+ balance: tx.value,
137+ code: tx.data
138+ })
140139
141- this.environment.state.set(address.toString(), account)
142-
143140 // FIXME: deduct fees
144141
145142 return {
146143 accountCreated: address

Built with git-ssb-web