Skip to content

Commit

Permalink
remove unnecessary if statement and variable assignment in calcVerifi…
Browse files Browse the repository at this point in the history
…cationGasAndCallGasLimit (#257)
  • Loading branch information
mmv08 authored Oct 30, 2024
1 parent b260064 commit 7b15e26
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/utils/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,17 +377,9 @@ export function calcVerificationGasAndCallGasLimit(
150
)

let gasPrice: bigint

if (userOperation.maxPriorityFeePerGas === userOperation.maxFeePerGas) {
gasPrice = userOperation.maxFeePerGas
} else {
gasPrice = userOperation.maxFeePerGas
}

const calculatedCallGasLimit =
callDataResult?.gasUsed ??
executionResult.paid / gasPrice - executionResult.preOpGas
executionResult.paid / userOperation.maxFeePerGas - executionResult.preOpGas

let callGasLimit =
maxBigInt(calculatedCallGasLimit, 9000n) + 21_000n + 50_000n
Expand Down

0 comments on commit 7b15e26

Please sign in to comment.