Skip to content

Commit

Permalink
remove unused 'refundGas' from evm/state_transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
jangko committed Dec 27, 2022
1 parent 2bce04a commit 74e76e5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions nimbus/evm/state_transactions.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion nimbus/sync/snap/worker/pivot/heal_accounts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion nimbus/sync/snap/worker/pivot/heal_storage_slots.nim
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
## healing algorithm again.
##
import
std/[math, sequtils],
std/[math, sequtils, tables],
chronicles,
chronos,
eth/[common, p2p, trie/nibbles],
Expand Down

0 comments on commit 74e76e5

Please sign in to comment.