Commit 1c2e46867f5b53672c2ec9beb976209e90ebc8db
Interface: swap the order of values from call*/create*
Alex Beregszaszi committed on 8/28/2016, 12:38:13 AMParent: 4b9fedd40734548f93c4ee00a7a7bd604f0fb029
Files changed
interface.js | changed |
interface.js | ||
---|---|---|
@@ -360,9 +360,9 @@ | ||
360 | 360 | this.takeGas(32000) |
361 | 361 | |
362 | 362 | const value = U256.fromMemory(this.getMemory(valueOffset, U128_SIZE_BYTES)) |
363 | 363 | 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) | |
365 | 365 | this.setMemory(resultOffset, ADDRESS_SIZE_BYTES, address.toMemory()) |
366 | 366 | return errorCode |
367 | 367 | } |
368 | 368 | |
@@ -384,10 +384,9 @@ | ||
384 | 384 | // Load the params from mem |
385 | 385 | const address = Address.fromMemory(this.getMemory(addressOffset, ADDRESS_SIZE_BYTES)) |
386 | 386 | const value = U256.fromMemory(this.getMemory(valueOffset, U128_SIZE_BYTES)) |
387 | 387 | 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) | |
390 | 389 | this.setMemory(resultOffset, resultLength, result) |
391 | 390 | return errorCode |
392 | 391 | } |
393 | 392 | |
@@ -409,10 +408,9 @@ | ||
409 | 408 | // Load the params from mem |
410 | 409 | const address = Address.fromMemory(this.getMemory(addressOffset, ADDRESS_SIZE_BYTES)) |
411 | 410 | const value = U256.fromMemory(this.getMemory(valueOffset, U128_SIZE_BYTES)) |
412 | 411 | 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) | |
415 | 413 | this.setMemory(resultOffset, resultLength, result) |
416 | 414 | return errorCode |
417 | 415 | } |
418 | 416 | |
@@ -433,9 +431,9 @@ | ||
433 | 431 | this.takeGas(40) |
434 | 432 | |
435 | 433 | const data = this.getMemory(dataOffset, dataLength).slice(0) |
436 | 434 | 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) | |
438 | 436 | this.setMemory(resultOffset, resultLength, result) |
439 | 437 | return errorCode |
440 | 438 | } |
441 | 439 |
Built with git-ssb-web