]> git.ardis.lu - block-hash-calculator/commitdiff
Add test for zero transaction block
authorArdis Lu <ardisglu@gmail.com>
Tue, 22 Apr 2025 04:40:26 +0000 (21:40 -0700)
committerArdis Lu <ardisglu@gmail.com>
Tue, 22 Apr 2025 04:40:26 +0000 (21:40 -0700)
calculate.test.js

index 7b5ec49af68025d13d83be180ff9aa248cbf5bc3..220c14ed52dbab59d2467e6216b0ac0f82a0afca 100644 (file)
@@ -924,6 +924,35 @@ suite('ZKsync Era', { concurrency: true }, () => {
     });
     deepStrictEqual(hash, '0x6db9bcfdef7c293cc31465cd1dfcae27c9bd01fb6e2d8f246a544ea02b5f1527');
   });
+
+  test('Block number 59453211 (non-legacy, 0 transactions)', { concurrency: true }, () => {
+    const { hash } = calculateZkSync({
+      "baseFeePerGas": "0x2b275d0",
+      "difficulty": "0x0",
+      "extraData": "0x",
+      "gasLimit": "0x4000000000000",
+      "gasUsed": "0x0",
+      "l1BatchNumber": "0x79c99",
+      "l1BatchTimestamp": "0x6806ff4b",
+      "logsBloom": "0x00000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000048000000000000020000000000000000000000080000000000000000000000000000000000000000000000000000000010000000000000000000000000000004000000000000000000000000000000000000000000000000000000100000008000000000000000000000000000000000000000000000000002008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+      "miner": "0x0000000000000000000000000000000000000000",
+      "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+      "nonce": "0x0000000000000000",
+      "number": "0x38b2f1b",
+      "parentHash": "0x8cc0222b689f6c829795e4d12ee24fc26523e61308be7b5d64f2fdfff7e96a0e",
+      "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
+      "sealFields": [],
+      "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+      "size": "0x0",
+      "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
+      "timestamp": "0x68070d5b",
+      "totalDifficulty": "0x0",
+      "transactions": [],
+      "transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
+      "uncles": []
+    });
+    deepStrictEqual(hash, '0x466bc3375717501ff25166b7ea76a87752db1c20899d8ebe00d5d84a75062561');
+  });
 });
 
 suite('Ink Mainnet', { concurrency: true }, () => {
This page took 0.042463 seconds and 4 git commands to generate.