--- /dev/null
+import { suite, test } from 'node:test';
+import { deepStrictEqual } from 'node:assert/strict';
+
+import { calculate } from './calculate.js';
+
+suite('Ethereum', { concurrency: true }, () => {
+ test('Block number 0', { skip: true, concurrency: true }, () => {
+ const { hash } = calculate({
+ "difficulty": "0x400000000",
+ "extraData": "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",
+ "gasLimit": "0x1388",
+ "gasUsed": "0x0",
+ "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "miner": "0x0000000000000000000000000000000000000000",
+ "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "nonce": "0x0000000000000042",
+ "number": "0x0",
+ "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544",
+ "timestamp": "0x0",
+ "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
+ });
+ deepStrictEqual(hash, '0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3');
+ });
+
+ test('Block number 100 (Genesis)', { concurrency: true }, () => {
+ const { hash } = calculate({
+ "difficulty": "0x42be722b6",
+ "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32",
+ "gasLimit": "0x1388",
+ "gasUsed": "0x0",
+ "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171",
+ "mixHash": "0x5bb43c0772e58084b221c8e0c859a45950c103c712c5b8f11d9566ee078a4501",
+ "nonce": "0x37129c7f29a9364b",
+ "number": "0x64",
+ "parentHash": "0xdb10afd3efa45327eb284c83cc925bd9bd7966aea53067c1eebe0724d124ec1e",
+ "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0x90c25f6d7fddeb31a6cc5668a6bba77adbadec705eb7aa5a51265c2d1e3bb7ac",
+ "timestamp": "0x55ba43eb",
+ "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ });
+ deepStrictEqual(hash, '0xdfe2e70d6c116a541101cecbb256d7402d62125f6ddc9b607d49edc989825c64');
+ });
+
+ test('Block number 12966000 (London)', { concurrency: true }, () => {
+ const { hash } = calculate({
+ "baseFeePerGas": "0x1033386ae9",
+ "difficulty": "0x1ad03c8e7a6728",
+ "extraData": "0x65746865726d696e652d617369612d6561737432",
+ "gasLimit": "0x1aa0fdb",
+ "gasUsed": "0xda8646",
+ "logsBloom": "0x106448e205a1081b814148869910df855086b231ce06c9ac199101749ce2860044cc1bc130008e94d088597603054950a2a88042494b3073a7305cf042f32a42d00910c04270536aec94125a11185ab96e9a5886646118c42444ccf18ec569fc8a0480064a3ae87053e0d51a9aaa89e057400555249d0cc896a4441a3808726a68088370d735e50e80fd21c4a9064365cd09fc8b01b9205842141248c4b18020c3a48a0a0386e5a449c547c6bd83c800081688c2955c2633a3313e36d81d886b635524ea410240e2680b920e041a439c8d95b1053932121fa7a500ab105a20a92650311b380bc084a866351103b4e7bc866aebcd3805c44157461e0b0c2b682b",
+ "miner": "0xea674fdde714fd979de3edf0f56aa9716b898ec8",
+ "mixHash": "0x39bc78e44b8a5cc22ff7a7b248daa2bcc3ca58972e795a0128fbc6e62bc4ef85",
+ "nonce": "0xf5d52de0d689e3b9",
+ "number": "0xc5d870",
+ "parentHash": "0xf53f6f4678a079ac5ad64d00ee8d66654ff47d79538a6e8d15cc9a8f78b7a02e",
+ "receiptsRoot": "0x49bd552279398f0e524e404d47314aa928b1e8ced8acd523bacd5d90ec464fdf",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0x0c51cb746bbbf75449eaf045f2295071e3062564b5d4a6c35613c18931d92c1a",
+ "timestamp": "0x610c1049",
+ "transactionsRoot": "0xe68d976116953aecb0acbba129acad7dc36533d2f34a8240001a1c9e4dc1963b"
+ });
+ deepStrictEqual(hash, '0x9d4c3bef68e119841281105da96beb1c7252f357340d7a3355236b3332b197b0');
+ });
+
+ test('Block number 15538394 (Paris)', { concurrency: true }, () => {
+ const { hash } = calculate({
+ "baseFeePerGas": "0x28437bbfe",
+ "difficulty": "0x0",
+ "extraData": "0x",
+ "gasLimit": "0x1c9c380",
+ "gasUsed": "0xede793",
+ "logsBloom": "0x37301546392b390b5da061e8b86df67d782e363b4f1d9120b7b934735f5179a3e1471b775f6a982c00e81901c3448bbd7a26b0187f7ffb05a0c0d8d109247a43d937e4370c4737aef84b115d977c60647a0b341849de416dfba7bdf98aa6656d1f290b51768e962209bd7981c2603e40460fc51c6cfb2ea0b227b4f32a49de4033819d8c5926118555fd6c280a57a4e264839cf99d339c9e263fce66885df02d9bea014790a162b14b4a4a878d8a2340c3fe1ffcfaf73cea6bff16e70f0982f76f6356b774e351d73440202bd99e5577255e22ed142ec05f2260d9becbe27d01707ee50aa83720f8300eb51217c3dcea7c70f01ed96cadf34628fc9017667577",
+ "miner": "0x5be9b269a83018e3192d6139dc6431de5656ea8a",
+ "mixHash": "0x066c34a5d7b1cb350c35a751405ab7b9b00b5ee5197b011c1c3d2123496c5849",
+ "nonce": "0x0000000000000000",
+ "number": "0xed18da",
+ "parentHash": "0xb8d1274e0be55bc22c2da3ae8b71ab24261054bac2c2c8ccf51f2d74ee4ef3ff",
+ "receiptsRoot": "0xefcdb772baf8dcb17fc44ca406cf8bb3360dadf3c1eb5e143e42740b297afbff",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0x59c48632145bb0c69ea44683d94f7fefc75836246521ea821ede2251127d05c5",
+ "timestamp": "0x6322f8ef",
+ "transactionsRoot": "0x2780598d9ca9344a5659131583d99ce511721f4b88389211957043d2dbc22af6"
+ });
+ deepStrictEqual(hash, '0x5fcf71c933c6a57f9961b82b8354dbe60c29c3447daaceed2454e6f52d017a1b');
+ });
+
+ test('Block number 17035870 (Shapella)', { concurrency: true }, () => {
+ const { hash } = calculate({
+ "baseFeePerGas": "0x7bcb36e62",
+ "difficulty": "0x0",
+ "extraData": "0x68747470733a2f2f6574682d6275696c6465722e636f6d",
+ "gasLimit": "0x1c9c380",
+ "gasUsed": "0x7ee5d6",
+ "logsBloom": "0x00210402190445b210410e11e70216a7500339d141e528e04001330894f62000518823c80080d9804580da80432b159203818bc9db0329040308408011286400c104ccd0419810ecef16428872b931b8882440804040497468284450a824a402de54090c4ac70a94040410ba29400bd1a266081489100e00c2062870c35c509502c80652021830098ac209615050310368860081d114200a44e10c4a28376004ab18a1401a39e4178e98ecc508a0414864004201208687334160104610c80408e4c042a26389401084834910942110804853c220509880f0402404264872a00e3970b26802340c23892712c04461501424702530030986d4181c0e40a00314b5",
+ "miner": "0xfeebabe6b0418ec13b30aadf129f5dcdd4f70cea",
+ "mixHash": "0x9a313a7a061b1584f53285f3f5223afbcc7df27b25eb0850c1efe1a0f4bf05b4",
+ "nonce": "0x0000000000000000",
+ "number": "0x103f25e",
+ "parentHash": "0xeed2d943735e485ed709614e0ae1f76a335dd7281a26fadc607baedce2d9bf6b",
+ "receiptsRoot": "0x859420afd7204de935aee70ec8ee9e58f1eff4cb2e50505c96e832f6e0bd13d2",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0xa45280b28eef549a66b817beecbbe382c8f4d37d49b029b504905df6914eabb7",
+ "timestamp": "0x6437678f",
+ "transactionsRoot": "0x18e5af1d96621269cf00d63c616a002f2fb4d4fcb647c9e7e164bae7c8b234c2",
+ "withdrawalsRoot": "0x977b173eda239988c3576bacf150999b67b2331900701dde7b8ee101ecb66d5d"
+ });
+ deepStrictEqual(hash, '0xde1bf7eba7e212b506cc19987f6d482531344d7837a897d084d3deae685f7800');
+ });
+
+ test('Block number 19426597 (Dencun)', { concurrency: true }, () => {
+ const { hash } = calculate({
+ "baseFeePerGas": "0xdeaf7d42a",
+ "blobGasUsed": "0x60000",
+ "difficulty": "0x0",
+ "excessBlobGas": "0x0",
+ "extraData": "0x6265617665726275696c642e6f7267",
+ "gasLimit": "0x1c9c380",
+ "gasUsed": "0x11ae68b",
+ "logsBloom": "0xd97b7e2ae750318f2220cca0bca2d98d78c9febe45dab0750463e328f3af11160154729bc2d9aa21df10ca701b828fe70fb9b95a9de776d69313a07835ea5885c1977a2d437eb4affe1e5b6f8e2ef3f6806708c827f57e9c77045353bbf03c176f53ff8833668d1a18d971f8e8bdae550a6b6a776a08e6af6c4e2dbdc60fa8df2e4cba781a43e65c26f60a45024290267e7184b1774ab2b97e636cf667319adcfb60356b5080efe25e174add798c80ea0f11e7b1e4a2b80d29696de93cac69523b8b18fe146826f69d48222d0a7f34dd286645ee1d4014f7628151ab7156ebc82cfee169471be91c6c6dd78a621cc6d78de2f10f63adaedeb89de9d1e9cb672c",
+ "miner": "0x95222290dd7278aa3ddd389cc1e1d165cc4bafe5",
+ "mixHash": "0x7a020322eb1753c1e11aab7bcd93c1380e3e14c6ecb7cfd7f3261fad841360d6",
+ "nonce": "0x0000000000000000",
+ "number": "0x1286d25",
+ "parentBeaconBlockRoot": "0x96878d8bab212646f7f433a451711762802200baa2dc2da4f599da0521cbf7aa",
+ "parentHash": "0x5d1500f836f0a7fd66cb85ddd7476663611ea06b94e7387ffc763352e7fc8860",
+ "receiptsRoot": "0x5b825c302377a64c7695cb11f7886ba89a7204c8387fc6cfd2b8fd0b6ffdbc77",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0x1f4f3a254a415f6cc989da77cc12b41680cd8b149d78032800faf50a5e2024a0",
+ "timestamp": "0x65f1b0cf",
+ "transactionsRoot": "0x7d5cb97ab1719896017f78dc9e51f73b646408d0df4f87b6bdf35eff8c9cde8d",
+ "withdrawalsRoot": "0x06af818b74ae947c082a52dd17e4293a1d88abc9f8637795b320c88726de8f20"
+ });
+ deepStrictEqual(hash, '0x736664ff636e9c72f5c1d71ef2626146b4a4289d3c9cc9154e683f6870c3436e');
+ });
+});
+
+suite('Polygon PoS', { concurrency: true }, () => {
+ test('Block number 0', { concurrency: true }, () => {
+ const { hash } = calculate({
+ "difficulty": "0x1",
+ "extraData": "0x",
+ "gasLimit": "0x989680",
+ "gasUsed": "0x0",
+ "hash": "",
+ "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "miner": "0x0000000000000000000000000000000000000000",
+ "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "nonce": "0x0000000000000000",
+ "number": "0x0",
+ "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0x654f28d19b44239d1012f27038f1f71b3d4465dc415a382fb2b7009cba1527c8",
+ "timestamp": "0x5ed20f84",
+ "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
+ });
+ deepStrictEqual(hash, '0xa9c28ce2141b56c474f1dc504bee9b01eb1bd7d1a507580d5519d4437a97de1b');
+ });
+
+ test('Block number 57206020', { concurrency: true }, () => {
+ const { hash } = calculate({
+ "baseFeePerGas": "0x922ac0cc",
+ "difficulty": "0x14",
+ "extraData": "0xd78301030283626f7288676f312e32322e32856c696e75780000000000000000f8d180f8cec0c0c101c0c0c0c105c0c0c0c102c20a01c0c0c0c2090ac0c0c0c0c0c111c111c10ec117c10fc10fc11ac0c0c11dc118c0c0c0c0c11cc113c125c126c127c128c129c11fc0c0c0c12bc12fc130c131c132c133c119c12ec0c12ac138c139c0c13ac13cc13dc13ec124c0c141c142c13fc144c145c146c147c0c149c0c14bc148c14dc14ec14fc150c151c152c153c154c155c156c157c158c159c15ac15bc15cc15dc15ec15fc160c161c162c163c164c165c166c0c0c169c0c0c168c16ac16ec167c170c16fc171c172c173c1743159a4c956b1bde22e21284a381528bc3b8c7499de4eaea57baf5240da1ce45a1b9d0f67817c75b2859a1e1c5ed022c07aa5f290ff01e9ee46d06cb205dbd5de00",
+ "gasLimit": "0x1c9c380",
+ "gasUsed": "0x782a6a",
+ "logsBloom": "0x951baddbf0349a20a0c2105264f820504d3926e2d8618d911a9086601abbac4123611e020000220580e46b1820a0713f0f42861e3082213869911bf79aa4a153ed18507b56377be9469d080bf83749e0703020e5c9a1e240e28b8c18e83688edc94e772142464228c13af6520894d901600cb102209ac4d7f0b36c38407a2422a6734a6d1cb8c81e4ce0b8d89c400160879394dd18c2304988c2e86244e0a0156b98b883132ac274c364fdfdadc25393fa212701068ee905868a808052de44e3298cb51f168260444001bc951e7aec1a695d551cc3188c0386b6870d8c6b23de121c67c8c1035f0322f086183567057ce48c8423775b00038f395c1ca2571c08",
+ "miner": "0x0000000000000000000000000000000000000000",
+ "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "nonce": "0x0000000000000000",
+ "number": "0x368e504",
+ "parentHash": "0x40ccd230368dc13eff3c206cec1d0cf3d9ccecd7b433973f431ba0b69d0d0cc6",
+ "receiptsRoot": "0x6dcf1b43af638c17867466b591e1c43e8417cca2767ac8f5cad85747919377eb",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0xf22c1d0edd1b09fa05c285d72f6489bad9e1b1baa3a7c47ef8e6a422ff676f30",
+ "timestamp": "0x664c0582",
+ "transactionsRoot": "0x1c8150dbe84c436c0983825b11bb2e719ff05658e14dcb6f29d8f6ac2c05ff39"
+ });
+ deepStrictEqual(hash, '0xb28698935763480009dd535fbaa7ab7b4e3896b74abe5deb962e3fe90a82320d');
+ });
+});
+
+suite('BNB Chain', { concurrency: true }, () => {
+ test('Block number 0', { concurrency: true }, () => {
+ const { hash } = calculate({
+ "difficulty": "0x1",
+ "extraData": "0x00000000000000000000000000000000000000000000000000000000000000002a7cdd959bfe8d9487b2a43b33565295a698f7e26488aa4d1955ee33403f8ccb1d4de5fb97c7ade29ef9f4360c606c7ab4db26b016007d3ad0ab86a0ee01c3b1283aa067c58eab4709f85e99d46de5fe685b1ded8013785d6623cc18d214320b6bb6475978f3adfc719c99674c072166708589033e2d9afec2be4ec20253b8642161bc3f444f53679c1f3d472f7be8361c80a4c1e7e9aaf001d0877f1cfde218ce2fd7544e0b2cc94692d4a704debef7bcb61328b8f7166496996a7da21cf1f1b04d9b3e26a3d0772d4c407bbe49438ed859fe965b140dcf1aab71a96bbad7cf34b5fa511d8e963dbba288b1960e75d64430b3230294d12c6ab2aac5c2cd68e80b16b581ea0a6e3c511bbd10f4519ece37dc24887e11b55d7ae2f5b9e386cd1b50a4550696d957cb4900f03a82012708dafc9e1b880fd083b32182b869be8e0922b81f8e175ffde54d797fe11eb03f9e3bf75f1d68bf0b8b6fb4e317a0f9d6f03eaf8ce6675bc60d8c4d90829ce8f72d0163c1d5cf348a862d55063035e7a025f4da968de7e4d7e4004197917f4070f1d6caa02bbebaebb5d7e581e4b66559e635f805ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "gasLimit": "0x2625a00",
+ "gasUsed": "0x0",
+ "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "miner": "0xfffffffffffffffffffffffffffffffffffffffe",
+ "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "nonce": "0x0000000000000000",
+ "number": "0x0",
+ "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0x919fcc7ad870b53db0aa76eb588da06bacb6d230195100699fc928511003b422",
+ "timestamp": "0x5e9da7ce",
+ "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ });
+ deepStrictEqual(hash, '0x0d21840abff46b96c84b2ac9e10e4f5cdaeb5693cb665db62a2f3b02d2d57b5b');
+ });
+
+ test('Block number 38904131', { concurrency: true }, () => {
+ const { hash } = calculate({
+ "baseFeePerGas": "0x0",
+ "difficulty": "0x2",
+ "extraData": "0xd883010406846765746888676f312e32312e39856c696e75780000007b6ff50bf8b5831fffffb860ab1fb4bc166b0c503738e0345587848c747675f675847b78e7b62dd1c8a87ec11b7c558c773ba2da903d68549c3c9e8c174421890e10d1b08231a0df82b178e1b000ce1835cad56504fa581b7efc789de7d31bbe96a00fac464f5cbc51d5c64cf84c840251a141a05b0ad052a76c71de6f4bd934424ab9bb01a6ad09121e0c6b3e55b667d016f4df840251a142a00f59021113772a4c8a7943c1e60237a31908342d181ccba95780ab672510bc5180a1cc89704d92303b6942e364ad2e6fcb724a0fab0d4a79bbe85dfd462508004f3224b17d6553412a58c9f67a4e612c94a932baaddd8f3e98941fb396481f656800",
+ "gasLimit": "0x8583b00",
+ "gasUsed": "0x9cafdc",
+ "logsBloom": "0x22b2b259208014ecc1693bcdd0542180c185108b4261550032313aa1b26a94ac8a41f200402014014c347ea9c5b60292218202a908aa080a502211e24a370d028e67841120608a005198c119447ac1e43230001111569863b0a702128ecc45652e9841300ac68b6408190c74340c891c1d2018191065844302418410c81803439a15b1a3504e40a3c39824d0414385011ba486a10130fc29214840443c2f93300208192450f409692c049c9302631c9080b591461043043d04600041d06228e54cc854469060500032b0dca1f0229740a9604ba08311aa1153d3c442008cf06840501ecf111005aa0178981608c083000024a0184071a742e8060914083402ab",
+ "miner": "0xbdcc079bbb23c1d9a6f36aa31309676c258abac7",
+ "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "nonce": "0x0000000000000000",
+ "number": "0x251a143",
+ "parentHash": "0x0f59021113772a4c8a7943c1e60237a31908342d181ccba95780ab672510bc51",
+ "receiptsRoot": "0x4c719028834d925ff55ab6ce1a97d4df686736ca085fd58f744758e2e7672c37",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0x333befaea4eb9c6018877acd79e806e11c8f3008a1ecc77321a87364c986f023",
+ "timestamp": "0x664c06eb",
+ "transactionsRoot": "0x35eede1a4ed8af835fba30f9acf0d1cbdad74548d9b4696d97137a526e0e6667"
+ });
+ deepStrictEqual(hash, '0xe32e2d8bcfa88273a7a42635412fcd047a17c455facaf6368c2632d5f42fee89');
+ });
+});
+
+suite('OP Mainnet', { concurrency: true }, () => {
+ test('Block number 0', { concurrency: true }, () => {
+ const { hash } = calculate({
+ "difficulty": "0x1",
+ "extraData": "0x000000000000000000000000000000000000000000000000000000000000000000000398232e2064f896018496b4b44b3d62751f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "gasLimit": "0xe4e1c0",
+ "gasUsed": "0x0",
+ "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "miner": "0x0000000000000000000000000000000000000000",
+ "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "nonce": "0x0000000000000000",
+ "number": "0x0",
+ "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0xeddb4c1786789419153a27c4c80ff44a2226b6eda04f7e22ce5bae892ea568eb",
+ "timestamp": "0x0",
+ "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
+ });
+ deepStrictEqual(hash, '0x7ca38a1916c42007829c55e69d3e9a73265554b586a499015373241b8a3fa48b');
+ });
+
+ test('Block number 120329931', { concurrency: true }, () => {
+ const { hash } = calculate({
+ "baseFeePerGas": "0x399117f",
+ "blobGasUsed": "0x0",
+ "difficulty": "0x0",
+ "excessBlobGas": "0x0",
+ "extraData": "0x",
+ "gasLimit": "0x1c9c380",
+ "gasUsed": "0x198c3d",
+ "logsBloom": "0x060420024002010000098080090000040201200800040000004a184404014000000830a0840000044000908000080000000000418002200250002048002000000080401000000008009800394a220000008002400101000000020080100000040000000006104000000018288000084102410008000020a6900008920408000000100004000000800080040000010000004c0c80820000000803000002000a00120100021a0000000008000090c00c000000812000200000008200000000818054000102000000000008000280100410044004201000800000002000008020000050200800000000400000600084004110220911000088000000000408010050",
+ "miner": "0x4200000000000000000000000000000000000011",
+ "mixHash": "0x116b44c233ca80c73848dc406c89b3b8fb1a870f25fa69b76e6d4e3458e544d1",
+ "nonce": "0x0000000000000000",
+ "number": "0x72c16cb",
+ "parentBeaconBlockRoot": "0x5b6d738a603bc81c8d560813353d774fc4cdb3c7c49a831c1b8d75c71bf1c696",
+ "parentHash": "0xe14477dc10f26a2beedb435be4854d37216c055f3ef139d3a7d18a479fa9b0c1",
+ "receiptsRoot": "0x39dba00a7cb41b315fe5a21ae94b23876d46d7e0952d73371f890a817b1e8957",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0xcfb8b1081df963ea34b3ecc8dcaea6156d43b69487c56ef645af66180e52df8f",
+ "timestamp": "0x664c074f",
+ "transactionsRoot": "0x0b158b75f9fe411ba7972d8e2d924bcf66728d5a8ae402ce122e4cd9beec7cbe",
+ "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
+ });
+ deepStrictEqual(hash, '0x4a9f89f697d81e954aba3cc314b6dfaba40f080e9d4478006a3711ec61b5dfee');
+ });
+});
+
+suite('Base', { concurrency: true }, () => {
+ test('Block number 0', { concurrency: true }, () => {
+ const { hash } = calculate({
+ "baseFeePerGas": "0x3b9aca00",
+ "difficulty": "0x0",
+ "extraData": "0x616c6c20796f75722062617365206172652062656c6f6e6720746f20796f752e",
+ "gasLimit": "0x1c9c380",
+ "gasUsed": "0x0",
+ "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "miner": "0x4200000000000000000000000000000000000011",
+ "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "nonce": "0x0000000000000000",
+ "number": "0x0",
+ "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0xb2afcb88cd1d0ab228f0415d99b0fb90a18e8515daf5eb31f55b5c4697e18328",
+ "timestamp": "0x648a5ce3",
+ "totalDifficulty": "0x0",
+ "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
+ });
+ deepStrictEqual(hash, '0xf712aa9241cc24369b143cf6dce85f0902a9731e70d66818a3a5845b296c73dd');
+ });
+
+ test('Block number 14734726', { concurrency: true }, () => {
+ const { hash } = calculate({
+ "baseFeePerGas": "0x47a70a5",
+ "blobGasUsed": "0x0",
+ "difficulty": "0x0",
+ "excessBlobGas": "0x0",
+ "extraData": "0x",
+ "gasLimit": "0x3938700",
+ "gasUsed": "0x8418e9",
+ "logsBloom": "0x067312be21043aad82881074a6232248040814247648251304850250cca58970059b1382d90266968682239bc256745a94178010e0263242636302a44a2c20810f1c44788ada0f5d0600600c8101003f109dc504095c9889104d3094d0699c003592c94a9a07140819602c2c3257186f8128194a085d06006308a11000080a4a53715b53c00644a6c112833015a56002a4c1950379b1402924c7adfb805080ae8734acc2832ca18110cc994268e588002454106181c0109e41130315be8625a27a1030ce0cd83c0f2b058424c7d710881763fca4382802185618229bc048600407d44a01402c1486389698900250f5b467061de8501004d120014e6413552c00",
+ "miner": "0x4200000000000000000000000000000000000011",
+ "mixHash": "0x5717635e56293ec6927bce48be9cf6af6c185047a200e3332d990f8c30e756ae",
+ "nonce": "0x0000000000000000",
+ "number": "0xe0d586",
+ "parentBeaconBlockRoot": "0xc3f9e025e7e43a37674277035eb813f953d76e12617c189fec2bad4d08c31d08",
+ "parentHash": "0xd382a43886929730b4592d837e318d87da4081965431c526702916162b04224b",
+ "receiptsRoot": "0xa13a5e22bdf523609428f6be33a69acfec44806bcfa4ebb9a51a38ff9a62bc20",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0x3679756ae9eddd19b7fd37c83b1e798f4ac19297d9a3640f9d2482f330a4e1b7",
+ "timestamp": "0x664c07ef",
+ "transactionsRoot": "0xc747fcd1371c5601588daafcf0b3acec224c5166ef16a42ceafadb88dae601a2",
+ "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
+ });
+ deepStrictEqual(hash, '0x774ead5372a1495454d912f3dcc8d9011b8209fe7f2d7c8080e2a4da67d2719c');
+ });
+});
+
+suite('Avalanche C-Chain', { concurrency: true }, () => {
+ test('Block number 0', { concurrency: true }, () => {
+ const { hash } = calculate({
+ "blockExtraData": "0x",
+ "difficulty": "0x0",
+ "extDataHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "extraData": "0x00",
+ "gasLimit": "0x5f5e100",
+ "gasUsed": "0x0",
+ "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "miner": "0x0000000000000000000000000000000000000000",
+ "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "nonce": "0x0000000000000000",
+ "number": "0x0",
+ "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0xd65eb1b8604a7aa497d41cd6372663785a5f809a17bd192edb86658ef24e29cc",
+ "timestamp": "0x0",
+ "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ });
+ deepStrictEqual(hash, '0x31ced5b9beb7f8782b014660da0cb18cc409f121f408186886e1ca3e8eeca96b');
+ });
+
+ test('Block number 45698875 (Apricot Phase 4)', { concurrency: true }, () => {
+ const { hash } = calculate({
+ "baseFeePerGas": "0x5d21dba00",
+ "blockExtraData": "0x",
+ "blockGasCost": "0x0",
+ "difficulty": "0x1",
+ "extDataGasUsed": "0x0",
+ "extDataHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ "extraData": "0x00000000000b0752000000000005782000000000000205140000000000000000000000000000000000000000000bbc560000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "gasLimit": "0xe4e1c0",
+ "gasUsed": "0x8ae04",
+ "logsBloom": "0x082000000000000000400002c004000000002800020000002000000100041000002810000001000000420001000000000011000000020000000002000020000402088400400000000a002009002000a000000000010000000200200000100000000004000a000400004004000000080000200000010000000400001002800000014400010000010001000000000000000000048000000808000000400000000002040000140000000440000000000000000010210000000000000200000000000000000200000800000100000000080a004008000000001001020000000030800010000000100000000000000004000800000000100000200000000000000000",
+ "miner": "0x0100000000000000000000000000000000000000",
+ "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "nonce": "0x0000000000000000",
+ "number": "0x2b94f3b",
+ "parentHash": "0x26f699ad4a263b19fc1346744cb12b593c760e5ea75a55fa396ba03f6eaee988",
+ "receiptsRoot": "0x893384114e1ec640352f9cd4f78589363a783a89280c97e9622fe58197e9dd15",
+ "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
+ "stateRoot": "0xb1126a92e81283ac9c90411789bb775a54fa1791e682ff25a1cdfbb4389e817f",
+ "timestamp": "0x664c0884",
+ "transactionsRoot": "0x716d6caf346c6b2a558a19869ac60f10040b0d9aaef3fce471147e1f450ac7ca"
+ });
+ deepStrictEqual(hash, '0x7909846e3b1756942e59a49632122454c0748f9787eed03025f4a99efacffe92');
+ });
+});
\ No newline at end of file
--- /dev/null
+{
+ "name": "block-hash-calculator",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "devDependencies": {
+ "@ethereumjs/rlp": "5.0.2",
+ "@noble/hashes": "1.4.0",
+ "esbuild": "0.21.3"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.3.tgz",
+ "integrity": "sha512-yTgnwQpFVYfvvo4SvRFB0SwrW8YjOxEoT7wfMT7Ol5v7v5LDNvSGo67aExmxOb87nQNeWPVvaGBNfQ7BXcrZ9w==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.3.tgz",
+ "integrity": "sha512-bviJOLMgurLJtF1/mAoJLxDZDL6oU5/ztMHnJQRejbJrSc9FFu0QoUoFhvi6qSKJEw9y5oGyvr9fuDtzJ30rNQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.3.tgz",
+ "integrity": "sha512-c+ty9necz3zB1Y+d/N+mC6KVVkGUUOcm4ZmT5i/Fk5arOaY3i6CA3P5wo/7+XzV8cb4GrI/Zjp8NuOQ9Lfsosw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.3.tgz",
+ "integrity": "sha512-JReHfYCRK3FVX4Ra+y5EBH1b9e16TV2OxrPAvzMsGeES0X2Ndm9ImQRI4Ket757vhc5XBOuGperw63upesclRw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.3.tgz",
+ "integrity": "sha512-U3fuQ0xNiAkXOmQ6w5dKpEvXQRSpHOnbw7gEfHCRXPeTKW9sBzVck6C5Yneb8LfJm0l6le4NQfkNPnWMSlTFUQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.3.tgz",
+ "integrity": "sha512-3m1CEB7F07s19wmaMNI2KANLcnaqryJxO1fXHUV5j1rWn+wMxdUYoPyO2TnAbfRZdi7ADRwJClmOwgT13qlP3Q==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.3.tgz",
+ "integrity": "sha512-fsNAAl5pU6wmKHq91cHWQT0Fz0vtyE1JauMzKotrwqIKAswwP5cpHUCxZNSTuA/JlqtScq20/5KZ+TxQdovU/g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.3.tgz",
+ "integrity": "sha512-tci+UJ4zP5EGF4rp8XlZIdq1q1a/1h9XuronfxTMCNBslpCtmk97Q/5qqy1Mu4zIc0yswN/yP/BLX+NTUC1bXA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.3.tgz",
+ "integrity": "sha512-f6kz2QpSuyHHg01cDawj0vkyMwuIvN62UAguQfnNVzbge2uWLhA7TCXOn83DT0ZvyJmBI943MItgTovUob36SQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.3.tgz",
+ "integrity": "sha512-vvG6R5g5ieB4eCJBQevyDMb31LMHthLpXTc2IGkFnPWS/GzIFDnaYFp558O+XybTmYrVjxnryru7QRleJvmZ6Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.3.tgz",
+ "integrity": "sha512-HjCWhH7K96Na+66TacDLJmOI9R8iDWDDiqe17C7znGvvE4sW1ECt9ly0AJ3dJH62jHyVqW9xpxZEU1jKdt+29A==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.3.tgz",
+ "integrity": "sha512-BGpimEccmHBZRcAhdlRIxMp7x9PyJxUtj7apL2IuoG9VxvU/l/v1z015nFs7Si7tXUwEsvjc1rOJdZCn4QTU+Q==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.3.tgz",
+ "integrity": "sha512-5rMOWkp7FQGtAH3QJddP4w3s47iT20hwftqdm7b+loe95o8JU8ro3qZbhgMRy0VuFU0DizymF1pBKkn3YHWtsw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.3.tgz",
+ "integrity": "sha512-h0zj1ldel89V5sjPLo5H1SyMzp4VrgN1tPkN29TmjvO1/r0MuMRwJxL8QY05SmfsZRs6TF0c/IDH3u7XYYmbAg==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.3.tgz",
+ "integrity": "sha512-dkAKcTsTJ+CRX6bnO17qDJbLoW37npd5gSNtSzjYQr0svghLJYGYB0NF1SNcU1vDcjXLYS5pO4qOW4YbFama4A==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.3.tgz",
+ "integrity": "sha512-vnD1YUkovEdnZWEuMmy2X2JmzsHQqPpZElXx6dxENcIwTu+Cu5ERax6+Ke1QsE814Zf3c6rxCfwQdCTQ7tPuXA==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.3.tgz",
+ "integrity": "sha512-IOXOIm9WaK7plL2gMhsWJd+l2bfrhfilv0uPTptoRoSb2p09RghhQQp9YY6ZJhk/kqmeRt6siRdMSLLwzuT0KQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.3.tgz",
+ "integrity": "sha512-uTgCwsvQ5+vCQnqM//EfDSuomo2LhdWhFPS8VL8xKf+PKTCrcT/2kPPoWMTs22aB63MLdGMJiE3f1PHvCDmUOw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.3.tgz",
+ "integrity": "sha512-vNAkR17Ub2MgEud2Wag/OE4HTSI6zlb291UYzHez/psiKarp0J8PKGDnAhMBcHFoOHMXHfExzmjMojJNbAStrQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.3.tgz",
+ "integrity": "sha512-W8H9jlGiSBomkgmouaRoTXo49j4w4Kfbl6I1bIdO/vT0+0u4f20ko3ELzV3hPI6XV6JNBVX+8BC+ajHkvffIJA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.3.tgz",
+ "integrity": "sha512-EjEomwyLSCg8Ag3LDILIqYCZAq/y3diJ04PnqGRgq8/4O3VNlXyMd54j/saShaN4h5o5mivOjAzmU6C3X4v0xw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.3.tgz",
+ "integrity": "sha512-WGiE/GgbsEwR33++5rzjiYsKyHywE8QSZPF7Rfx9EBfK3Qn3xyR6IjyCr5Uk38Kg8fG4/2phN7sXp4NPWd3fcw==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.3.tgz",
+ "integrity": "sha512-xRxC0jaJWDLYvcUvjQmHCJSfMrgmUuvsoXgDeU/wTorQ1ngDdUBuFtgY3W1Pc5sprGAvZBtWdJX7RPg/iZZUqA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@ethereumjs/rlp": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-5.0.2.tgz",
+ "integrity": "sha512-DziebCdg4JpGlEqEdGgXmjqcFoJi+JGulUXwEjsZGAscAQ7MyD/7LE/GVCP29vEQxKc7AAwjT3A2ywHp2xfoCA==",
+ "dev": true,
+ "license": "MPL-2.0",
+ "bin": {
+ "rlp": "bin/rlp.cjs"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@noble/hashes": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz",
+ "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/esbuild": {
+ "version": "0.21.3",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.3.tgz",
+ "integrity": "sha512-Kgq0/ZsAPzKrbOjCQcjoSmPoWhlcVnGAUo7jvaLHoxW1Drto0KGkR1xBNg2Cp43b9ImvxmPEJZ9xkfcnqPsfBw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.21.3",
+ "@esbuild/android-arm": "0.21.3",
+ "@esbuild/android-arm64": "0.21.3",
+ "@esbuild/android-x64": "0.21.3",
+ "@esbuild/darwin-arm64": "0.21.3",
+ "@esbuild/darwin-x64": "0.21.3",
+ "@esbuild/freebsd-arm64": "0.21.3",
+ "@esbuild/freebsd-x64": "0.21.3",
+ "@esbuild/linux-arm": "0.21.3",
+ "@esbuild/linux-arm64": "0.21.3",
+ "@esbuild/linux-ia32": "0.21.3",
+ "@esbuild/linux-loong64": "0.21.3",
+ "@esbuild/linux-mips64el": "0.21.3",
+ "@esbuild/linux-ppc64": "0.21.3",
+ "@esbuild/linux-riscv64": "0.21.3",
+ "@esbuild/linux-s390x": "0.21.3",
+ "@esbuild/linux-x64": "0.21.3",
+ "@esbuild/netbsd-x64": "0.21.3",
+ "@esbuild/openbsd-x64": "0.21.3",
+ "@esbuild/sunos-x64": "0.21.3",
+ "@esbuild/win32-arm64": "0.21.3",
+ "@esbuild/win32-ia32": "0.21.3",
+ "@esbuild/win32-x64": "0.21.3"
+ }
+ }
+ }
+}
-function m(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function Y(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function h(t,...e){if(!Y(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function L(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function I(t,e){h(t);let n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}var g=BigInt(4294967295),O=BigInt(32);function Z(t,e=!1){return e?{h:Number(t&g),l:Number(t>>O&g)}:{h:Number(t>>O&g)|0,l:Number(t&g)|0}}function U(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let o=0;o<t.length;o++){let{h:s,l:i}=Z(t[o],e);[n[o],r[o]]=[s,i]}return[n,r]}var S=(t,e,n)=>t<<n|e>>>32-n,H=(t,e,n)=>e<<n|t>>>32-n,T=(t,e,n)=>e<<n-32|t>>>64-n,R=(t,e,n)=>t<<n-32|e>>>64-n;var P=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));var A=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,tt=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function k(t){for(let e=0;e<t.length;e++)t[e]=tt(t[e])}function et(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function w(t){return typeof t=="string"&&(t=et(t)),h(t),t}var y=class{clone(){return this._cloneInto()}},Lt={}.toString;function F(t){let e=r=>t().update(w(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function N(t){let e=(r,o)=>t(o).update(w(r)).digest(),n=t({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=r=>t(r),e}var X=[],C=[],V=[],nt=BigInt(0),d=BigInt(1),rt=BigInt(2),ot=BigInt(7),it=BigInt(256),st=BigInt(113);for(let t=0,e=d,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],X.push(2*(5*r+n)),C.push((t+1)*(t+2)/2%64);let o=nt;for(let s=0;s<7;s++)e=(e<<d^(e>>ot)*st)%it,e&rt&&(o^=d<<(d<<BigInt(s))-d);V.push(o)}var[ct,ft]=U(V,!0),j=(t,e,n)=>n>32?T(t,e,n):S(t,e,n),$=(t,e,n)=>n>32?R(t,e,n):H(t,e,n);function ut(t,e=24){let n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let i=0;i<10;i++)n[i]=t[i]^t[i+10]^t[i+20]^t[i+30]^t[i+40];for(let i=0;i<10;i+=2){let c=(i+8)%10,f=(i+2)%10,p=n[f],a=n[f+1],K=j(p,a,1)^n[c],Q=$(p,a,1)^n[c+1];for(let x=0;x<50;x+=10)t[i+x]^=K,t[i+x+1]^=Q}let o=t[2],s=t[3];for(let i=0;i<24;i++){let c=C[i],f=j(o,s,c),p=$(o,s,c),a=X[i];o=t[a],s=t[a+1],t[a]=f,t[a+1]=p}for(let i=0;i<50;i+=10){for(let c=0;c<10;c++)n[c]=t[i+c];for(let c=0;c<10;c++)t[i+c]^=~n[(c+2)%10]&n[(c+4)%10]}t[0]^=ct[r],t[1]^=ft[r]}n.fill(0)}var b=class t extends y{constructor(e,n,r,o=!1,s=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,m(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=P(this.state)}keccak(){A||k(this.state32),ut(this.state32,this.rounds),A||k(this.state32),this.posOut=0,this.pos=0}update(e){L(this);let{blockLen:n,state:r}=this;e=w(e);let o=e.length;for(let s=0;s<o;){let i=Math.min(n-this.pos,o-s);for(let c=0;c<i;c++)r[this.pos++]^=e[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:n,pos:r,blockLen:o}=this;e[r]^=n,n&128&&r===o-1&&this.keccak(),e[o-1]^=128,this.keccak()}writeInto(e){L(this,!1),h(e),this.finish();let n=this.state,{blockLen:r}=this;for(let o=0,s=e.length;o<s;){this.posOut>=r&&this.keccak();let i=Math.min(r-this.posOut,s-o);e.set(n.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return m(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(I(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:n,suffix:r,outputLen:o,rounds:s,enableXOF:i}=this;return e||(e=new t(n,r,o,i,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=o,e.enableXOF=i,e.destroyed=this.destroyed,e}},u=(t,e,n)=>F(()=>new b(e,t,n)),Et=u(6,144,224/8),It=u(6,136,256/8),Ot=u(6,104,384/8),Ut=u(6,72,512/8),St=u(1,144,224/8),at=u(1,136,256/8),Ht=u(1,104,384/8),Tt=u(1,72,512/8),v=(t,e,n)=>N((r={})=>new b(e,t,r.dkLen===void 0?n:r.dkLen,!0)),Rt=v(31,168,128/8),Pt=v(31,136,256/8);function z(t){if(Array.isArray(t)){let n=[],r=0;for(let o=0;o<t.length;o++){let s=z(t[o]);n.push(s),r+=s.length}return W(D(r,192),...n)}let e=J(t);return e.length===1&&e[0]<128?e:W(D(e.length,128),e)}function l(t,e,n){if(n>t.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return t.slice(e,n)}function M(t){if(t[0]===0)throw new Error("invalid RLP: extra zeros");return q(dt(t))}function D(t,e){if(t<56)return Uint8Array.from([t+e]);let n=E(t),r=n.length/2,o=E(e+55+r);return Uint8Array.from(B(o+n))}function lt(t,e=!1){if(typeof t>"u"||t===null||t.length===0)return Uint8Array.from([]);let n=J(t),r=_(n);if(e)return{data:r.data,remainder:r.remainder.slice()};if(r.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return r.data}function _(t){let e,n,r,o,s,i=[],c=t[0];if(c<=127)return{data:t.slice(0,1),remainder:t.subarray(1)};if(c<=183){if(e=c-127,c===128?r=Uint8Array.from([]):r=l(t,1,e),e===2&&r[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:r,remainder:t.subarray(e)}}else if(c<=191){if(n=c-182,t.length-1<n)throw new Error("invalid RLP: not enough bytes for string length");if(e=M(l(t,1,n)),e<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return r=l(t,n,e+n),{data:r,remainder:t.subarray(e+n)}}else if(c<=247){for(e=c-191,o=l(t,1,e);o.length;)s=_(o),i.push(s.data),o=s.remainder;return{data:i,remainder:t.subarray(e)}}else{if(n=c-246,e=M(l(t,1,n)),e<56)throw new Error("invalid RLP: encoded list too short");let f=n+e;if(f>t.length)throw new Error("invalid RLP: total length is larger than the data");for(o=l(t,n,f);o.length;)s=_(o),i.push(s.data),o=s.remainder;return{data:i,remainder:t.subarray(f)}}}var ht=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function dt(t){let e="";for(let n=0;n<t.length;n++)e+=ht[t[n]];return e}function q(t){let e=Number.parseInt(t,16);if(Number.isNaN(e))throw new Error("Invalid byte sequence");return e}function B(t){if(typeof t!="string")throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++){let r=n*2;e[n]=q(t.slice(r,r+2))}return e}function W(...t){if(t.length===1)return t[0];let e=t.reduce((r,o)=>r+o.length,0),n=new Uint8Array(e);for(let r=0,o=0;r<t.length;r++){let s=t[r];n.set(s,o),o+=s.length}return n}function pt(t){return new TextEncoder().encode(t)}function E(t){if(t<0)throw new Error("Invalid integer as argument, must be unsigned!");let e=t.toString(16);return e.length%2?`0${e}`:e}function xt(t){return t.length%2?`0${t}`:t}function G(t){return t.length>=2&&t[0]==="0"&&t[1]==="x"}function gt(t){return typeof t!="string"?t:G(t)?t.slice(2):t}function J(t){if(t instanceof Uint8Array)return t;if(typeof t=="string")return G(t)?B(xt(gt(t))):pt(t);if(typeof t=="number"||typeof t=="bigint")return t?B(E(t)):Uint8Array.from([]);if(t==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof t)}var yt={encode:z,decode:lt};export{yt as RLP,at as keccak256};
-/*! Bundled license information:
+import { keccak_256 } from '@noble/hashes/sha3';
+import { RLP } from '@ethereumjs/rlp';
-@noble/hashes/esm/utils.js:
- (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
-*/
+export { RLP, keccak_256 as keccak256 };
\ No newline at end of file