git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 6aeb55ff3e5698ae2b952fff5d15f7e7a6dfb378

testing!

wanderer committed on 9/13/2016, 8:47:11 PM
Parent: 4026b89455deff8f73612b2be7855c5bf6aaa296

Files changed

interface.jschanged
interface.jsView
@@ -403,28 +403,35 @@
403403 * @return {integer} Returns 1 or 0 depending on if the VM trapped on the message or not
404404 */
405405 _call (gasHigh, gasLow, addressOffset, valueOffset, dataOffset, dataLength, resultOffset, resultLength) {
406406 const gas = from64bit(gasHigh, gasLow)
407- this.takeGas(40 + gas)
408-
407+ console.log(gas);
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))
412- const data = this.getMemory(dataOffset, dataLength).slice(0)
413411
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))) {
416421 this.takeGas(25000)
417422 }
418-
419- // Special case for non-zero value
423+ // // Special case for non-zero value
420424 if (!value.isZero()) {
421- this.takeGas(9000)
425+ this.takeGas(9000 - 2300 + gas)
426+ this.takeGas(-gas)
422427 }
423428
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
427434 }
428435
429436 /**
430437 * Message-call into this account with an alternative account’s code.

Built with git-ssb-web