Skip to content

Commit f1c61f5

Browse files
refactor: use built-in min()
Co-authored-by: Stephen Buttolph <[email protected]> Signed-off-by: Arran Schlosberg <[email protected]>
1 parent e95e52f commit f1c61f5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

core/state_transition.libevm.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ func (st *StateTransition) canExecuteTransaction() error {
5555
func (st *StateTransition) consumeMinimumGas() {
5656
limit := st.msg.GasLimit
5757
minConsume := st.rulesHooks().MinimumGasConsumption(st.msg.GasLimit)
58-
if minConsume > limit {
59-
minConsume = limit // as documented in [params.RulesHooks]
60-
}
58+
minConsume = min(minConsume, limit) // as documented in [params.RulesHooks]
6159

6260
maxRemaining := limit - minConsume
6361
if st.gasRemaining < maxRemaining {

0 commit comments

Comments
 (0)