Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Commit 705150b

Browse files
committed
fix SPV tests
1 parent d8098d4 commit 705150b

File tree

1 file changed

+100
-84
lines changed

1 file changed

+100
-84
lines changed

test/unit/Test/Chainweb/SPV/Argument.hs

Lines changed: 100 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -323,54 +323,36 @@ testRpcReceipt = case eitherDecodeStrictText jsonReceiptStr of
323323
jsonReceiptStr :: T.Text
324324
jsonReceiptStr = [r|
325325
{
326-
"type": "0x2",
327-
"status": "0x1",
328-
"cumulativeGasUsed": "0x9dcf",
329-
"logs": [
326+
"status": "0x1",
327+
"cumulativeGasUsed": "0xb1d6",
328+
"logs": [
330329
{
331-
"address": "0x0826f2fc8902ca5afe82570560ba752a7f53675c",
332-
"topics": [
333-
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
334-
"0x000000000000000000000000fb8fb7f9bdc8951040a6d195764905138f7462ed",
335-
"0x0000000000000000000000000000000000000000000000000000000000000000"
336-
],
337-
"data": "0x0000000000000000000000000000000000000000000000056bc75e2d63100000",
338-
"blockHash": "0x47c1944c382527f82044276c04a9e0d642da58316d1b963e7a623e03ac085d4f",
339-
"blockNumber": "0x162",
340-
"blockTimestamp": "0x67ef2c65",
341-
"transactionHash": "0x3247ba77980ba47c6a59afc8d73bf5d70eff69e7f129b680b15451e45c3b4d5d",
342-
"transactionIndex": "0x0",
343-
"logIndex": "0x0",
344-
"removed": false
345-
},
346-
{
347-
"address": "0x0826f2fc8902ca5afe82570560ba752a7f53675c",
348-
"topics": [
349-
"0x9d2528c24edd576da7816ca2bdaa28765177c54b32fb18e2ca18567fbc2a9550",
350-
"0x0000000000000000000000000000000000000000000000000000000000000001",
351-
"0x000000000000000000000000ead0610198d4d802f9d14ec7e8d85d30233ccc6b",
352-
"0x0000000000000000000000000000000000000000000000000000000000000001"
353-
],
354-
"data": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000028f2d8ef4e0fe6b2e945cf5c33a0118a30a623540000000000000000000000000000000000000000000000056bc75e2d63100000",
355-
"blockHash": "0x47c1944c382527f82044276c04a9e0d642da58316d1b963e7a623e03ac085d4f",
356-
"blockNumber": "0x162",
357-
"blockTimestamp": "0x67ef2c65",
358-
"transactionHash": "0x3247ba77980ba47c6a59afc8d73bf5d70eff69e7f129b680b15451e45c3b4d5d",
359-
"transactionIndex": "0x0",
360-
"logIndex": "0x1",
361-
"removed": false
330+
"address": "0x7f81bfb73cb29c3725779ec2c060787daa2f97d4",
331+
"topics": [
332+
"0xb4beca5a896c70c0f896e51f0c7c91592fe79893272eb4d5f41aa376c3c2aa95",
333+
"0x000000000000000000000000a525fcb70404336c591833a85abb1663b779cddf"
334+
],
335+
"data": "0x0000000000000000000000000000000000000000000000000000000068e6c67d00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000004f91",
336+
"blockHash": "0x78bc1a838d8e69c3f980d3c69ad79bf9b1dbc934ca9f9cb572408fac3259d161",
337+
"blockNumber": "0x45426",
338+
"blockTimestamp": "0x68e6c67d",
339+
"transactionHash": "0x807bd8e1999cc975bd14826033e998c92d1eb604342ae0dcdc3e2dec015466c3",
340+
"transactionIndex": "0x0",
341+
"logIndex": "0x0",
342+
"removed": false
362343
}
363-
],
364-
"logsBloom": "0x00000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000800000000000000000000040100000000000000000000000008000000000000000000040000000000000000000000000000020000000000000000000800000000000000000000002010000000000000000000000000000100000000004000000000000000000001000000000000000000000000000000000000000000000000000000008000000000000000002000000002000000000000000000000000000000000000000040000000000060004000000000000000000000000000000000000200000000000000000000000000",
365-
"transactionHash": "0x3247ba77980ba47c6a59afc8d73bf5d70eff69e7f129b680b15451e45c3b4d5d",
366-
"transactionIndex": "0x0",
367-
"blockHash": "0x47c1944c382527f82044276c04a9e0d642da58316d1b963e7a623e03ac085d4f",
368-
"blockNumber": "0x162",
369-
"gasUsed": "0x9dcf",
370-
"effectiveGasPrice": "0x3b9aca07",
371-
"from": "0xfb8fb7f9bdc8951040a6d195764905138f7462ed",
372-
"to": "0x0826f2fc8902ca5afe82570560ba752a7f53675c",
373-
"contractAddress": null
344+
],
345+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000002000000001200000000000000000000000000000000001000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000002000",
346+
"type": "0x0",
347+
"transactionHash": "0x807bd8e1999cc975bd14826033e998c92d1eb604342ae0dcdc3e2dec015466c3",
348+
"transactionIndex": "0x0",
349+
"blockHash": "0x78bc1a838d8e69c3f980d3c69ad79bf9b1dbc934ca9f9cb572408fac3259d161",
350+
"blockNumber": "0x45426",
351+
"gasUsed": "0xb1d6",
352+
"effectiveGasPrice": "0x47868c08",
353+
"from": "0xa525fcb70404336c591833a85abb1663b779cddf",
354+
"to": "0x7f81bfb73cb29c3725779ec2c060787daa2f97d4",
355+
"contractAddress": null
374356
}
375357
|]
376358

@@ -383,27 +365,58 @@ testPayload = case eitherDecodeStrictText payloadStr of
383365
payloadStr :: T.Text
384366
payloadStr = [r|
385367
{
386-
"parentHash": "0x692d784f999068270a78491f50404073f988a324598799866f740e2a52857a6a",
387-
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
388-
"miner": "0xd42d71cdc2a0a78fe7fbe7236c19925f62c442ba",
389-
"stateRoot": "0x05f700ac2df8e2985433b63e3641e308976dd1a0dc0d29b600f71cc20939cba9",
390-
"transactionsRoot": "0x8748b3f2e8d6a4a78a6f4b4b39e608cd3765505fd317020ba4c4a1aae4a6018c",
391-
"receiptsRoot": "0x37cb5c601f1a535769d6a36c35f34c22fea9e9a1a011144381b8e3c7bb31657c",
392-
"logsBloom": "0x00000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000800000000000000000000040100000000000000000000000008000000000000000000040000000000000000000000000000020000000000000000000800000000000000000000002010000000000000000000000000000100000000004000000000000000000001000000000000000000000000000000000000000000000000000000008000000000000000002000000002000000000000000000000000000000000000000040000000000060004000000000000000000000000000000000000200000000000000000000000000",
393-
"difficulty": "0x0",
394-
"number": "0x162",
395-
"gasLimit": "0x1c9c380",
396-
"gasUsed": "0x9dcf",
397-
"timestamp": "0x67ef2c65",
398-
"extraData": "0x726574682f76312e312e352f6c696e7578",
399-
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
400-
"nonce": "0x0000000000000000",
401-
"baseFeePerGas": "0x7",
402-
"withdrawalsRoot": "0x2f1a2b19c3801a44641db3f88532b818b585754dc389fd18ab6a0299e2ebdbc2",
403-
"blobGasUsed": "0x0",
404-
"excessBlobGas": "0x0",
405-
"parentBeaconBlockRoot": "0x80af8b91b32cae2e3c3b17ef0b6ce9124e01176bf953f192633a6cc718f129ba",
406-
"hash": "0x47c1944c382527f82044276c04a9e0d642da58316d1b963e7a623e03ac085d4f",
368+
"hash": "0x78bc1a838d8e69c3f980d3c69ad79bf9b1dbc934ca9f9cb572408fac3259d161",
369+
"parentHash": "0x2afaa2d34fb53b08aa150f9e8b0f707753ed7778d0f8ee6b22601d8a6fadcd01",
370+
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
371+
"miner": "0x8cb33ecc40c31b79ae414a3d958b1b094b8993ce",
372+
"stateRoot": "0x6ffe7d5fe11439a683a9de6a59b9d9b2576772298d4c077ab0b262c311aa0139",
373+
"transactionsRoot": "0xed97db66cd791a681eb8ef982285003fa51aa9bd1eba11df2a616b0b2d479a8c",
374+
"receiptsRoot": "0xb2c672dbd3f5c41fe156dddcca90b1ebc847da3a5f338bc66b697f3a1151f582",
375+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000002000000001200000000000000000000000000000000001000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000002000",
376+
"difficulty": "0x0",
377+
"number": "0x45426",
378+
"gasLimit": "0x1c9c380",
379+
"gasUsed": "0xb1d6",
380+
"timestamp": "0x68e6c67d",
381+
"extraData": "0x",
382+
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
383+
"nonce": "0x0000000000000000",
384+
"baseFeePerGas": "0x7",
385+
"withdrawalsRoot": "0x7e36212b14efdeab5312650a1c64bfd672db373e97d00d4aa9e6ec1397d94b82",
386+
"blobGasUsed": "0x0",
387+
"excessBlobGas": "0x0",
388+
"parentBeaconBlockRoot": "0xb2613c38880572d2467803b8a236eee297f20a1ec0bb20b6ee3ba69f85aa168c",
389+
"requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
390+
"size": "0x2f6",
391+
"uncles": [],
392+
"transactions": [
393+
{
394+
"type": "0x0",
395+
"chainId": "0x1720",
396+
"nonce": "0x1b",
397+
"gasPrice": "0x47868c08",
398+
"gas": "0x10cfd",
399+
"to": "0x7f81bfb73cb29c3725779ec2c060787daa2f97d4",
400+
"value": "0x0",
401+
"input": "0xef5fb05b",
402+
"r": "0xb51a0cefb88f0a0ab6bc82720a1da7c9ba05116e76ac519740736a1f225524e9",
403+
"s": "0x1447924901426ae0a0df648f700eb7f4760cd3b572360c6d1981077248eeeda6",
404+
"v": "0x2e63",
405+
"hash": "0x807bd8e1999cc975bd14826033e998c92d1eb604342ae0dcdc3e2dec015466c3",
406+
"blockHash": "0x78bc1a838d8e69c3f980d3c69ad79bf9b1dbc934ca9f9cb572408fac3259d161",
407+
"blockNumber": "0x45426",
408+
"transactionIndex": "0x0",
409+
"from": "0xa525fcb70404336c591833a85abb1663b779cddf"
410+
}
411+
],
412+
"withdrawals": [
413+
{
414+
"index": "0x45426",
415+
"validatorIndex": "0x0",
416+
"address": "0x8cb33ecc40c31b79ae414a3d958b1b094b8993ce",
417+
"amount": "0xde53c1b"
418+
}
419+
]
407420
}
408421
|]
409422

@@ -415,26 +428,29 @@ testHeader = case eitherDecodeStrictText headerStr of
415428
headerStr :: T.Text
416429
headerStr = [r|
417430
{
418-
"nonce": "0",
419-
"creationTime": 1743727718036200,
420-
"parent": "gK-LkbMsri48OxfvC2zpEk4BF2v5U_GSYzpsxxjxKbo",
421-
"adjacents": {
422-
"10": "RJuqDTjhoclukSr7qPOkg0IOAcEJ1bIeltehw_-OHTo",
423-
"5": "xOqpgPjJl0VehoCDX4se2i-cK1Ql_R75YHa1pAuSuWo",
424-
"15": "B0iB0OTRlVtQgOyCpdomGfJTyXF92R8pcs06upXTOrY"
425-
},
426-
"target": "PKUF-3dimGnG6F3iN6MvPUA1hTNt8eECAAAAAAAAAAA",
427-
"payloadHash": "RXrRaAvhF74-xJcQzVT8ZHJqW7FtgP4y0WWQCy13w9U",
428-
"chainId": 0,
429-
"weight": "9puuQnDNZ7WAKQAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
430-
"height": 354,
431-
"chainwebVersion": "evm-development",
432-
"epochStart": 1743727581567100,
433-
"featureFlags": 0,
434-
"hash": "9NDFjt_VVE2_fJD54eLcybRfbp_BAOR2T2HxavWe7ho"
431+
"featureFlags": 0,
432+
"creationTime": 1759954586876631,
433+
"parent": "smE8OIgFctJGeAO4ojbu4pfyCh7AuyC27jumn4WqFow",
434+
"adjacents": {
435+
"41": "bRgmeumz8u8L1V_HYKgL-rwUNSqKlXB-ap_7ssmpptI",
436+
"69": "ZacCSYKvKIUoVcRLD8Y_J0SLjyHBL9lotdeWn3kFFJ4",
437+
"79": "sefhr1YuvwtsnqOoCftjW28lytACU_5I0UmHH2EK_rM",
438+
"86": "taX_Ekq_vacCT4G6AR6oMo0VRVt2RgAJ2sPmUiMtYDY"
439+
},
440+
"target": "BgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
441+
"payloadHash": "JUXtOVmUmUCCR8O0F4qNzLdp8WU7Xr4CGpLte70Ef9E",
442+
"chainId": 20,
443+
"weight": "ziBRVAzQZq_oNsjiWK0LSFSwS3WbffvI28fVKKlcqFY",
444+
"height": 283686,
445+
"chainwebVersion": "evm-development",
446+
"epochStart": 1759954428697267,
447+
"nonce": "0x0000000000000000",
448+
"hash": "aV9bLh5Pfb-ZnM-jFlsarg6kNZ31HFL-0hjlV1BC4DQ"
435449
}
436450
|]
437451

452+
-- FIXME: this is actually an evm-testnet header
453+
438454

439455
-- EVM Development block (chain 0, height 354)
440456
-- {

0 commit comments

Comments
 (0)