remove unused 'refundGas' from evm/state_transactions

This commit is contained in:
jangko 2022-12-27 10:23:41 +07:00
parent 2bce04afc7
commit 74e76e5237
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
3 changed files with 2 additions and 9 deletions

View File

@ -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.

View File

@ -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],

View File

@ -38,7 +38,7 @@
## healing algorithm again.
##
import
std/[math, sequtils],
std/[math, sequtils, tables],
chronicles,
chronos,
eth/[common, p2p, trie/nibbles],