Commit 254f1dd5867137c7707537afbcff63ec3aee6563
Kernel: be consistent and always include every field for the callHandler
Alex Beregszaszi committed on 8/26/2016, 9:41:08 PMParent: 9b5545940cea05703845fc350781ee577ca2e326
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -88,9 +88,10 @@ | ||
88 | 88 | if (!Utils.isWASMCode(code)) { |
89 | 89 | // throw new Error('Not an eWASM contract') |
90 | 90 | |
91 | 91 | // Transcompile code |
92 | - code = this.callHandler({ to: transcompilerContract, data: code }).returnValue | |
92 | + // FIXME: decide if these are the right values here: from: 0, gasLimit: 0, value: 0 | |
93 | + code = this.callHandler({ from: Address.zero(), to: transcompilerContract, gasLimit: 0, value: new U256(0), data: code }).returnValue | |
93 | 94 | } |
94 | 95 | |
95 | 96 | // creats a new Kernel |
96 | 97 | const environment = new Environment() |
@@ -129,9 +130,10 @@ | ||
129 | 130 | let code = create.data |
130 | 131 | |
131 | 132 | // Inject metering |
132 | 133 | if (Utils.isWASMCode(code)) { |
133 | - code = this.callHandler({ to: meteringContract, data: code }).returnValue | |
134 | + // FIXME: decide if these are the right values here: from: 0, gasLimit: 0, value: 0 | |
135 | + code = this.callHandler({ from: Address.zero(), to: meteringContract, gasLimit: 0, value: new U256(0), data: code }).returnValue | |
134 | 136 | } |
135 | 137 | |
136 | 138 | let address = Utils.newAccountAddress(create.from, code) |
137 | 139 | |
@@ -140,9 +142,10 @@ | ||
140 | 142 | code: code |
141 | 143 | }) |
142 | 144 | |
143 | 145 | // Run code and take return value as contract code |
144 | - code = this.callHandler({ from: create.from, to: address, gasLimit: create.gasLimit }).returnValue | |
146 | + // FIXME: decide if these are the right values here: value: 0, data: '' | |
147 | + code = this.callHandler({ from: create.from, to: address, gasLimit: create.gasLimit, value: new U256(0), data: new Uint8Array() }).returnValue | |
145 | 148 | |
146 | 149 | this.environment.state.get(address.toString()).set('code', code) |
147 | 150 | |
148 | 151 | return { |
Built with git-ssb-web