VM gas cost:

+ fixed the memory usage, not to be charged by one more general step
This commit is contained in:
romanman 2014-06-10 21:47:10 +01:00
parent a47ecf6f90
commit 115d416e78
1 changed files with 3 additions and 6 deletions

View File

@ -81,12 +81,6 @@ public class VM {
case CALL:
program.spendGas(GasCost.CALL);
break;
case MSTORE8:
case MSTORE:
// TODO: [cpp impl] do this when [go impl] spend just the usage size
// TODO: https://github.com/ethereum/cpp-ethereum/blob/develop/libevm/VM.h#L183
program.spendGas(GasCost.STEP);
break;
default:
program.spendGas(GasCost.STEP);
break;
@ -572,6 +566,9 @@ public class VM {
this.step(program);
} catch (RuntimeException e) {
program.setRuntimeFailure(e);
} finally{
// todo: Here wrap the storage into result;
}
}
}