Commit d83a5cd97267441a2a6ef6f71fed4ace5483968a
Kernel: use state after accounts was removed
Alex Beregszaszi committed on 8/23/2016, 12:27:46 AMParent: af08dc3e0ce5be82ca5f4be87523656ed6ce5498
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -61,9 +61,9 @@ | ||
61 | 61 | // Detects if code is EVM or WASM |
62 | 62 | // Detects if the code injection is needed |
63 | 63 | // Detects if transcompilation is needed |
64 | 64 | 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()) | |
66 | 66 | if (!toAccount) { |
67 | 67 | throw new Error('Account not found') |
68 | 68 | } |
69 | 69 | |
@@ -121,9 +121,9 @@ | ||
121 | 121 | // { balance, codeHash, stateRoot } |
122 | 122 | // |
123 | 123 | |
124 | 124 | // 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()) | |
126 | 126 | |
127 | 127 | // deduct gasLimit * gasPrice from sender |
128 | 128 | if (fromAccount.balance < (tx.gasLimit * tx.gasPrice)) { |
129 | 129 | throw new Error('Insufficient account balance') |
Built with git-ssb-web