Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Dec 12, 2024
1 parent 0191501 commit 547fef3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/utils/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,6 @@ export function removeZeroBytesFromUserOp<T extends UserOperation>(
} 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(
[
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 547fef3

Please sign in to comment.