git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit d83a5cd97267441a2a6ef6f71fed4ace5483968a

Kernel: use state after accounts was removed

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

Files changed

index.jschanged
index.jsView
@@ -61,9 +61,9 @@
6161 // Detects if code is EVM or WASM
6262 // Detects if the code injection is needed
6363 // Detects if transcompilation is needed
6464 callHandler (address, gaslimit, gasprice, value, data) {
65- var toAccount = this.environment.accounts.get(new Uint8Array(address).toString())
65+ var toAccount = this.environment.state.get(new Uint8Array(address).toString())
6666 if (!toAccount) {
6767 throw new Error('Account not found')
6868 }
6969
@@ -121,9 +121,9 @@
121121 // { balance, codeHash, stateRoot }
122122 //
123123
124124 // look up sender
125- let fromAccount = this.environment.accounts.get(new Uint8Array(tx.form).toString())
125+ let fromAccount = this.environment.state.get(new Uint8Array(tx.form).toString())
126126
127127 // deduct gasLimit * gasPrice from sender
128128 if (fromAccount.balance < (tx.gasLimit * tx.gasPrice)) {
129129 throw new Error('Insufficient account balance')

Built with git-ssb-web