From 7b15e26aac99ee72af46325b0560f25c55e115d2 Mon Sep 17 00:00:00 2001 From: Mikhail <16622558+mmv08@users.noreply.github.com> Date: Wed, 30 Oct 2024 18:42:05 +0100 Subject: [PATCH] remove unnecessary if statement and variable assignment in calcVerificationGasAndCallGasLimit (#257) --- src/utils/validation.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/utils/validation.ts b/src/utils/validation.ts index 797efe97..65ccd7a2 100644 --- a/src/utils/validation.ts +++ b/src/utils/validation.ts @@ -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