fix contract call in gst and executor.nim

This commit is contained in:
andri lim 2019-02-19 17:02:59 +07:00 committed by zah
parent 8b3b1f4c57
commit 5ba44083f0
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ proc contractCall(t: Transaction, vmState: BaseVMState, sender: EthAddress, fork
if execComputation(computation):
let
gasRemaining = computation.gasMeter.gasRemaining.u256
gasRefunded = computation.gasMeter.gasRefunded.u256
gasRefunded = computation.getGasRefund().u256
gasUsed = t.gasLimit.u256 - gasRemaining
gasRefund = min(gasRefunded, gasUsed div 2)
gasRefundAmount = (gasRefund + gasRemaining) * t.gasPrice.u256

View File

@ -73,7 +73,7 @@ proc testFixtureIndexes(prevStateRoot: Hash256, header: BlockHeader, pre: JsonNo
if execComputation(computation):
let
gasRemaining = computation.gasMeter.gasRemaining.u256
gasRefunded = computation.gasMeter.gasRefunded.u256
gasRefunded = computation.getGasRefund().u256
gasUsed = transaction.gasLimit.u256 - gasRemaining
gasRefund = min(gasRefunded, gasUsed div 2)
gasRefundAmount = (gasRefund + gasRemaining) * transaction.gasPrice.u256