]> git.ardis.lu - block-hash-calculator/commitdiff
Add Arbitrum One test cases
authorArdis Lu <ardisglu@gmail.com>
Tue, 21 May 2024 06:59:23 +0000 (23:59 -0700)
committerArdis Lu <ardisglu@gmail.com>
Tue, 21 May 2024 06:59:23 +0000 (23:59 -0700)
calculate.test.js
index.html

index 0bcbffef44a5ccc99c6b4a94d94fd8ed33c75c11..16c57d2cf3b18a1725783472a215667a88fd7486 100644 (file)
@@ -147,7 +147,6 @@ suite('Polygon PoS', { concurrency: true }, () => {
       "extraData": "0x",
       "gasLimit": "0x989680",
       "gasUsed": "0x0",
-      "hash": "",
       "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
       "miner": "0x0000000000000000000000000000000000000000",
       "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
@@ -380,4 +379,53 @@ suite('Avalanche C-Chain', { concurrency: true }, () => {
     });
     deepStrictEqual(hash, '0x7909846e3b1756942e59a49632122454c0748f9787eed03025f4a99efacffe92');
   });
+});
+
+suite('Arbitrum One', { concurrency: true }, () => {
+  test('Block number 0', { concurrency: true }, () => {
+    const { hash } = calculate({
+      "difficulty": "0x0",
+      "extraData": "0x",
+      "gasLimit": "0x112a8800",
+      "gasUsed": "0x0",
+      "l1BlockNumber": "0x0",
+      "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+      "miner": "0x0000000000000000000000000000000000000000",
+      "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+      "nonce": "0x0000000000000000",
+      "number": "0x0",
+      "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+      "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+      "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+      "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
+      "timestamp": "0x0",
+      "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
+    });
+    deepStrictEqual(hash, '0x7ee576b35482195fc49205cec9af72ce14f003b9ae69f6ba0faef4514be8b442');
+  });
+
+  test('Block number 213451496', { concurrency: true }, () => {
+    const { hash } = calculate({
+      "baseFeePerGas": "0x989680",
+      "difficulty": "0x1",
+      "extraData": "0xa21eb7b366864a6eb65bc07cbb611d39c14e668c86c7b40abea49ee634098d59",
+      "gasLimit": "0x4000000000000",
+      "gasUsed": "0x96adb",
+      "l1BlockNumber": "0x12fe752",
+      "logsBloom": "0x00000080000000000000000800000000000100000400004000000000000000020000000000000000000000010000000000240021000000000000000000200100006011000400000400008008000000000005000000000000012004000000000000000008020000000080008000000800000000000000100000000010000000000000040000000000004000000000000000901000008000000000000000000018020000020000a0000000000000000000000200000000000000040000000000000040a002000000008000200000000000000000000000000000000000000020000410000000000000000000400000200030000400040000000000800001800000",
+      "miner": "0xa4b000000000000000000073657175656e636572",
+      "mixHash": "0x000000000001d15500000000012fe75200000000000000140000000000000000",
+      "nonce": "0x0000000000173e7b",
+      "number": "0xcb902e8",
+      "parentHash": "0x06e67f93508a32acdb9a039c2964e69d3b4dc2d55f31219e7c394482a16ecb7e",
+      "receiptsRoot": "0xdce9c9a7108cd7def2839fe70d2e70bdf917b8a7d4bde7c4a559343559a0c0a6",
+      "sendCount": "0x1d155",
+      "sendRoot": "0xa21eb7b366864a6eb65bc07cbb611d39c14e668c86c7b40abea49ee634098d59",
+      "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+      "stateRoot": "0xcf3c50bda9496c16f4389f5f32f4d34ae2bf20d92c03c42a7d6456ac1cc97965",
+      "timestamp": "0x664c4537",
+      "transactionsRoot": "0x27c6f78f76b39c712bdae46a5c7b56b63a33f52431516730d60e94e26573098a"
+    });
+    deepStrictEqual(hash, '0x99bd65dac0a210326cfd76cebccddbbefd28f9ee71215aff018448ffb1b1ba21');
+  });
 });
\ No newline at end of file
index bf593913e0519dd68c5c8dd01494ed52b1ca15f6..4d8dac32b7c308fbc1e0af8b621565cb2e0bfb9f 100644 (file)
   <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, and Avalanche C-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, and Avalanche C-Chain.</p>
     <form>
       <label for="num">Block number</label>
       <input id="num" name="num" type="number" min="0" placeholder="12345678" required>
This page took 0.040325 seconds and 4 git commands to generate.