diff --git a/nimbus/p2p/executor.nim b/nimbus/p2p/executor.nim index d2bea1102..e3296d476 100644 --- a/nimbus/p2p/executor.nim +++ b/nimbus/p2p/executor.nim @@ -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 diff --git a/tests/test_generalstate_json.nim b/tests/test_generalstate_json.nim index f74978ce9..17d3f443f 100644 --- a/tests/test_generalstate_json.nim +++ b/tests/test_generalstate_json.nim @@ -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