Skip to content

Commit

Permalink
generate predective bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
plusminushalf committed Nov 22, 2023
1 parent ff93aae commit 752334e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/utils/src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,14 @@ const getL1FeeAbi = [

// Assuming you have a function to generate random bytes
function randomBytes(length: number): Uint8Array {
const bytes = new Uint8Array(length)
window.crypto.getRandomValues(bytes)
return bytes
const pattern = "10101010101"
const repeatedPattern = pattern.repeat(Math.ceil(length / pattern.length))

const byteArray = repeatedPattern.split("").map(Number)

const bytes = new Uint8Array(byteArray)

return bytes.slice(0, length)
}

export async function calcOptimismPreVerificationGas(
Expand Down

0 comments on commit 752334e

Please sign in to comment.