From 547fef38256b8c90925bf2d9264e1969930ce329 Mon Sep 17 00:00:00 2001 From: mouseless <97399882+mouseless-eth@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:49:52 +0000 Subject: [PATCH] clean --- src/utils/validation.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/utils/validation.ts b/src/utils/validation.ts index 5e294050..5a359cd7 100644 --- a/src/utils/validation.ts +++ b/src/utils/validation.ts @@ -229,11 +229,6 @@ export function removeZeroBytesFromUserOp( } as T extends UserOperationV06 ? UserOperationV06 : PackedUserOperation } -// Return ranomized bytes of certain length. -export function randomizeBytes(length: number) { - return toHex(crypto.randomBytes(length).toString("hex")) -} - export function packUserOpV07(op: PackedUserOperation): `0x${string}` { return encodeAbiParameters( [ @@ -534,6 +529,10 @@ function getOpStackHandleOpsCallData( ) { // Only randomize signature during estimations. if (!verify) { + const randomizeBytes = (length: number) => { + return toHex(crypto.randomBytes(length).toString("hex")) + } + op = { ...op, signature: randomizeBytes(size(op.signature))