Commit 6aeb55ff3e5698ae2b952fff5d15f7e7a6dfb378
testing!
wanderer committed on 9/13/2016, 8:47:11 PMParent: 4026b89455deff8f73612b2be7855c5bf6aaa296
Files changed
interface.js | changed |
interface.js | ||
---|---|---|
@@ -403,28 +403,35 @@ | ||
403 | 403 | * @return {integer} Returns 1 or 0 depending on if the VM trapped on the message or not |
404 | 404 | */ |
405 | 405 | _call (gasHigh, gasLow, addressOffset, valueOffset, dataOffset, dataLength, resultOffset, resultLength) { |
406 | 406 | const gas = from64bit(gasHigh, gasLow) |
407 | - this.takeGas(40 + gas) | |
408 | - | |
407 | + console.log(gas); | |
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 | - const data = this.getMemory(dataOffset, dataLength).slice(0) | |
413 | 411 | |
414 | - // Special case for calling into empty account | |
415 | - if (!this.environment.isAccountPresent(address)) { | |
412 | + this.takeGas(40) | |
413 | + | |
414 | + // const data = this.getMemory(dataOffset, dataLength).slice(0) | |
415 | + | |
416 | + // // Special case for calling into empty account | |
417 | + // if (!this.environment.isAccountPresent(address)) { | |
418 | + // this.takeGas(25000) | |
419 | + // } | |
420 | + if (address.lt(new U256(4))) { | |
416 | 421 | this.takeGas(25000) |
417 | 422 | } |
418 | - | |
419 | - // Special case for non-zero value | |
423 | + // // Special case for non-zero value | |
420 | 424 | if (!value.isZero()) { |
421 | - this.takeGas(9000) | |
425 | + this.takeGas(9000 - 2300 + gas) | |
426 | + this.takeGas(-gas) | |
422 | 427 | } |
423 | 428 | |
424 | - const [errorCode, result] = this.environment.call(gas, address, value, data) | |
425 | - this.setMemory(resultOffset, resultLength, result) | |
426 | - return errorCode | |
429 | + // const [errorCode, result] = this.environment.call(gas, address, value, data) | |
430 | + // this.setMemory(resultOffset, resultLength, result) | |
431 | + // return errorCode | |
432 | + // | |
433 | + return 1 | |
427 | 434 | } |
428 | 435 | |
429 | 436 | /** |
430 | 437 | * Message-call into this account with an alternative account’s code. |
Built with git-ssb-web