From 74e76e523718afd5b7f56117edd401dc983dbf36 Mon Sep 17 00:00:00 2001 From: jangko Date: Tue, 27 Dec 2022 10:23:41 +0700 Subject: [PATCH] remove unused 'refundGas' from evm/state_transactions --- nimbus/evm/state_transactions.nim | 7 ------- nimbus/sync/snap/worker/pivot/heal_accounts.nim | 2 +- nimbus/sync/snap/worker/pivot/heal_storage_slots.nim | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/nimbus/evm/state_transactions.nim b/nimbus/evm/state_transactions.nim index 38a88d55b7..efa6c00d0b 100644 --- a/nimbus/evm/state_transactions.nim +++ b/nimbus/evm/state_transactions.nim @@ -36,13 +36,6 @@ proc setupTxContext*(vmState: BaseVMState, origin: EthAddress, gasPrice: GasInt, vmState.gasCosts = vmState.fork.forkToSchedule -proc refundGas*(c: Computation, tx: Transaction, sender: EthAddress) = - let maxRefund = (tx.gasLimit - c.gasMeter.gasRemaining) div 2 - c.gasMeter.returnGas min(c.getGasRefund(), maxRefund) - c.vmState.mutateStateDB: - db.addBalance(sender, c.gasMeter.gasRemaining.u256 * tx.gasPrice.u256) - - # FIXME-awkwardFactoring: the factoring out of the pre and # post parts feels awkward to me, but for now I'd really like # not to have too much duplicated code between sync and async. diff --git a/nimbus/sync/snap/worker/pivot/heal_accounts.nim b/nimbus/sync/snap/worker/pivot/heal_accounts.nim index 2735aa0d1e..31122b46ad 100644 --- a/nimbus/sync/snap/worker/pivot/heal_accounts.nim +++ b/nimbus/sync/snap/worker/pivot/heal_accounts.nim @@ -36,7 +36,7 @@ ## healing algorithm again. ## import - std/[math, sequtils], + std/[math, sequtils, tables], chronicles, chronos, eth/[common, p2p, trie/nibbles, trie/trie_defs, rlp], diff --git a/nimbus/sync/snap/worker/pivot/heal_storage_slots.nim b/nimbus/sync/snap/worker/pivot/heal_storage_slots.nim index 4835b295e1..9238a43f72 100644 --- a/nimbus/sync/snap/worker/pivot/heal_storage_slots.nim +++ b/nimbus/sync/snap/worker/pivot/heal_storage_slots.nim @@ -38,7 +38,7 @@ ## healing algorithm again. ## import - std/[math, sequtils], + std/[math, sequtils, tables], chronicles, chronos, eth/[common, p2p, trie/nibbles],