From f2155bc4a76360a95d08f2293e3c8c8f9ffc2e5c Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Mon, 21 Apr 2025 21:40:26 -0700 Subject: [PATCH] Add test for zero transaction block --- calculate.test.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/calculate.test.js b/calculate.test.js index 7b5ec49..220c14e 100644 --- a/calculate.test.js +++ b/calculate.test.js @@ -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 }, () => { -- 2.47.3