mirror of
https://github.com/status-im/ethereumj-personal.git
synced 2025-01-23 18:29:22 +00:00
tiny fix
This commit is contained in:
parent
6cfcb83476
commit
a216aba714
@ -14,6 +14,8 @@ public class GasCost {
|
||||
public static int BALANCE = 20;
|
||||
/** Cost 10 gas */
|
||||
public static int SHA3 = 10;
|
||||
/** Cost 10 gas */
|
||||
public static int SHA3_WORD = 10;
|
||||
/** Cost 20 gas */
|
||||
public static int SLOAD = 20;
|
||||
/** Cost 0 gas */
|
||||
|
@ -135,13 +135,9 @@ public class VM {
|
||||
case SHA3:
|
||||
gasCost = GasCost.SHA3;
|
||||
newMemSize = memNeeded(stack.peek(), stack.get(stack.size()-2));
|
||||
|
||||
DataWord size = stack.get(stack.size()-2);
|
||||
long chunkUsed = (size.longValue() + 31) / 32;
|
||||
gasCost += chunkUsed * GasCost.SHA3;
|
||||
|
||||
//todo: calc how much bytes for sha3(): sha3 / 32 * 10
|
||||
|
||||
gasCost += chunkUsed * GasCost.SHA3_WORD;
|
||||
break;
|
||||
case CALLDATACOPY:
|
||||
copySize = stack.get(stack.size()-3).longValue();
|
||||
|
Loading…
x
Reference in New Issue
Block a user