git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 1c2e46867f5b53672c2ec9beb976209e90ebc8db

Interface: swap the order of values from call*/create*

Alex Beregszaszi committed on 8/28/2016, 12:38:13 AM
Parent: 4b9fedd40734548f93c4ee00a7a7bd604f0fb029

Files changed

interface.jschanged
interface.jsView
@@ -360,9 +360,9 @@
360360 this.takeGas(32000)
361361
362362 const value = U256.fromMemory(this.getMemory(valueOffset, U128_SIZE_BYTES))
363363 const data = this.getMemory(dataOffset, length).slice(0)
364- const [address, errorCode] = this.environment.create(value, data)
364+ const [errorCode, address] = this.environment.create(value, data)
365365 this.setMemory(resultOffset, ADDRESS_SIZE_BYTES, address.toMemory())
366366 return errorCode
367367 }
368368
@@ -384,10 +384,9 @@
384384 // Load the params from mem
385385 const address = Address.fromMemory(this.getMemory(addressOffset, ADDRESS_SIZE_BYTES))
386386 const value = U256.fromMemory(this.getMemory(valueOffset, U128_SIZE_BYTES))
387387 const data = this.getMemory(dataOffset, dataLength).slice(0)
388- // Run the call
389- const [result, errorCode] = this.environment.call(gas, address, value, data)
388+ const [errorCode, result] = this.environment.call(gas, address, value, data)
390389 this.setMemory(resultOffset, resultLength, result)
391390 return errorCode
392391 }
393392
@@ -409,10 +408,9 @@
409408 // Load the params from mem
410409 const address = Address.fromMemory(this.getMemory(addressOffset, ADDRESS_SIZE_BYTES))
411410 const value = U256.fromMemory(this.getMemory(valueOffset, U128_SIZE_BYTES))
412411 const data = this.getMemory(dataOffset, dataLength).slice(0)
413- // Run the call
414- const [result, errorCode] = this.environment.callCode(gas, address, value, data)
412+ const [errorCode, result] = this.environment.callCode(gas, address, value, data)
415413 this.setMemory(resultOffset, resultLength, result)
416414 return errorCode
417415 }
418416
@@ -433,9 +431,9 @@
433431 this.takeGas(40)
434432
435433 const data = this.getMemory(dataOffset, dataLength).slice(0)
436434 const address = Address.fromMemory(this.getMemory(addressOffset, ADDRESS_SIZE_BYTES))
437- const [result, errorCode] = this.environment.callDelegate(gas, address, data)
435+ const [errorCode, result] = this.environment.callDelegate(gas, address, data)
438436 this.setMemory(resultOffset, resultLength, result)
439437 return errorCode
440438 }
441439

Built with git-ssb-web