git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 254f1dd5867137c7707537afbcff63ec3aee6563

Kernel: be consistent and always include every field for the callHandler

Alex Beregszaszi committed on 8/26/2016, 9:41:08 PM
Parent: 9b5545940cea05703845fc350781ee577ca2e326

Files changed

index.jschanged
index.jsView
@@ -88,9 +88,10 @@
8888 if (!Utils.isWASMCode(code)) {
8989 // throw new Error('Not an eWASM contract')
9090
9191 // 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
9394 }
9495
9596 // creats a new Kernel
9697 const environment = new Environment()
@@ -129,9 +130,10 @@
129130 let code = create.data
130131
131132 // Inject metering
132133 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
134136 }
135137
136138 let address = Utils.newAccountAddress(create.from, code)
137139
@@ -140,9 +142,10 @@
140142 code: code
141143 })
142144
143145 // 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
145148
146149 this.environment.state.get(address.toString()).set('code', code)
147150
148151 return {

Built with git-ssb-web