]> git.ardis.lu - block-hash-calculator/commitdiff
Add tests for Soneium
authorArdis Lu <ardisglu@gmail.com>
Sat, 17 May 2025 06:17:11 +0000 (23:17 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sat, 17 May 2025 06:17:11 +0000 (23:17 -0700)
calculate.test.js
index.html

index bf9288eecdac0c8c1f176777fc65710ec0f21811..9c4e939f50e07e00819e0b3aa59f3e8c46ceff25 100644 (file)
@@ -1243,4 +1243,66 @@ suite('World Chain', { concurrency: true }, () => {
     });
     deepStrictEqual(hash, '0x4a40e4350106d48231b475496346a8499be140d4e911758e83711fac543ee46d');
   });
+});
+
+suite('Soneium', { concurrency: true }, () => {
+  test('Block number 0', { concurrency: true }, () => {
+    const { hash } = calculate({
+      "baseFeePerGas": "0x3b9aca00",
+      "blobGasUsed": "0x0",
+      "difficulty": "0x0",
+      "excessBlobGas": "0x0",
+      "extraData": "0x",
+      "gasLimit": "0x3938700",
+      "gasUsed": "0x0",
+      "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+      "miner": "0x4200000000000000000000000000000000000011",
+      "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+      "nonce": "0x0000000000000000",
+      "number": "0x0",
+      "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
+      "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+      "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+      "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+      "size": "0x247",
+      "stateRoot": "0xc0c30db8b85abb4c6083e3b28b44fce19fba1754e3dbeb35abf2cda2afe61fc2",
+      "timestamp": "0x674d899f",
+      "transactions": [],
+      "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+      "uncles": [],
+      "withdrawals": [],
+      "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
+    });
+    deepStrictEqual(hash, '0x295d22d269634c7d0055b33b887519362d0b31899e97109d1789a8a168de1b21');
+  });
+
+  test('Block number 7163875', { concurrency: true }, () => {
+    const { hash } = calculate({
+      "baseFeePerGas": "0x6ed",
+      "blobGasUsed": "0x0",
+      "difficulty": "0x0",
+      "excessBlobGas": "0x0",
+      "extraData": "0x00000000fa00000007",
+      "gasLimit": "0x2625a00",
+      "gasUsed": "0x367c74",
+      "logsBloom": "0x00204000080000000800400080000210000000000080008000850110040000000800000000000000800000184004000000000000000000000000000000202000000800008000000020000008000000a0000000048000210010000144a00020000400100002100000200200000000081000000000040000000082001004400000000800000000000020100001000001004000005108600048024000400800000002000000000008200000200e00080000000200800000000000000000000001001210000600000400008001a048000080001000000208001001000000000021001010000000000000000800000040080040000000000001400100480000000000",
+      "miner": "0x4200000000000000000000000000000000000011",
+      "mixHash": "0x9d0e4b39275a098a9d8cc15e5fd3982a53a7ae4cfd7d4996908022a5c22f1c7e",
+      "nonce": "0x0000000000000000",
+      "number": "0x6d4fe3",
+      "parentBeaconBlockRoot": "0xf08417f21b73bb2471389fd1749b45be398834359b439ccc56ee62d07d5aff67",
+      "parentHash": "0xcb9a98ced1a7824440fb298a73daaa52c73f83988c731cc3bf9c0ebc1419d0b5",
+      "receiptsRoot": "0xccad1b327683131564b60b98da98b7a9bbc6268ea19cf7cfec65856fc2776a98",
+      "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+      "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+      "size": "0x2416",
+      "stateRoot": "0x8de85c00d4e42fe72979f67f796c20424062a247f725430d2d188b1a6611a7fe",
+      "timestamp": "0x68282965",
+      "transactionsRoot": "0x90cdc9e5fe87a8d7772570bb236e160632d037b7aa5fb8cdcbb06c0cae178ce0",
+      "uncles": [],
+      "withdrawals": [],
+      "withdrawalsRoot": "0x0933c155aa5b17c106d2dca8f22d60f6d8c73c8ec3c67cbe8ed742c73924cfea"
+    });
+    deepStrictEqual(hash, '0xd98e41f78d38a334568365a9107422b59f82ff78e015b4edfa1449360e3bbaab');
+  });
 });
\ No newline at end of file
index 4ef22e89ee13f4d7aa74a418b499075a482e7245..6f8b86d2b16556e5c0c1cc0f37dea2dd5fe70a4b 100644 (file)
@@ -25,7 +25,7 @@
   <main>
     <h1>Block Hash Calculator</h1>
     <a href="https://github.com/ardislu/block-hash-calculator/">GitHub</a>
-    <p>Enter a block number and a JSON-RPC provider below to recalculate the block's hash from its header fields. Known supported networks: Ethereum, Polygon PoS, BNB Chain, OP Mainnet, Base, Arbitrum One, Linea, Scroll, Blast, Mantle, Avalanche C-Chain, ZKsync Era, Ink Mainnet, Sonic Mainnet, Unichain, and World Chain.</p>
+    <p>Enter a block number and a JSON-RPC provider below to recalculate the block's hash from its header fields. Known supported networks: Ethereum, Polygon PoS, BNB Chain, OP Mainnet, Base, Arbitrum One, Linea, Scroll, Blast, Mantle, Avalanche C-Chain, ZKsync Era, Ink Mainnet, Sonic Mainnet, Unichain, World Chain, and Soneium.</p>
     <form>
       <label for="num">Block number</label>
       <input id="num" name="num" type="number" min="0" placeholder="12345678" required>
This page took 0.042638 seconds and 4 git commands to generate.