From: Ardis Lu Date: Tue, 22 Apr 2025 04:39:47 +0000 (-0700) Subject: Show placeholder for zero length transaction array X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=47994d1939396b79c9ef0d6e7994cee5d1e00f7c;p=block-hash-calculator Show placeholder for zero length transaction array --- diff --git a/calculate.js b/calculate.js index 6b5ee47..69b64fa 100644 --- a/calculate.js +++ b/calculate.js @@ -129,7 +129,7 @@ function calculateZkSync(block) { Number(block.number), Number(block.timestamp), block.parentHash, - block.transactions + block.transactions.length === 0 ? `0x${'0'.repeat(64)}` : block.transactions ]; // Since each value is equal to or less than 32 bytes, abi.encode just gives each value a 32-byte slot (big-endian)