Skip to content

Commit

Permalink
Add comment for buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Aug 1, 2023
1 parent cd8791f commit d3cb3cc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/prover/src/utils/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export async function isValidStorageKeys({
sp.proof.map(hexToBuffer)
);

// buffer.equals is not compatible with Uint8Array for browser
// so we need to convert the output of RLP.encode to Buffer first
const isStorageValid =
(!expectedStorageRLP && sp.value === "0x0") ||
(!!expectedStorageRLP && expectedStorageRLP.equals(Buffer.from(RLP.encode(sp.value))));
Expand Down

0 comments on commit d3cb3cc

Please sign in to comment.