Last active
June 11, 2024 19:09
-
-
Save JossDuff/b13ef0b321fb41de00e98f476fa8a833 to your computer and use it in GitHub Desktop.
Comparison of hypersync and fuel graphql receipts at transaction 0x9d65154b185851dabe344f7b07afc8df45c9170a4ad66b0795fffade9336bea2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hyperfuel | |
from hyperfuel import ReceiptField | |
import asyncio | |
async def main(): | |
client = hyperfuel.HyperfuelClient() | |
tx_id = "0x9d65154b185851dabe344f7b07afc8df45c9170a4ad66b0795fffade9336bea2" | |
target_block = 1868403 | |
query = hyperfuel.Query( | |
from_block=target_block, | |
to_block=target_block+1, | |
receipts=[ | |
hyperfuel.ReceiptSelection( | |
# only receipts from spark's contract | |
root_contract_id=["0x4a2ce054e3e94155f7092f7365b212f7f45105b74819c623744ebcc5d065c6ac"], | |
# only logdata receipts | |
receipt_type=[6] | |
) | |
], | |
field_selection=hyperfuel.FieldSelection( | |
receipt=[ | |
ReceiptField.TX_ID, | |
ReceiptField.RECEIPT_INDEX, # our internal field used for ordering based on the order we receive receipts from graphql | |
ReceiptField.ROOT_CONTRACT_ID, # receipt id field | |
ReceiptField.PC, | |
ReceiptField.PTR, | |
ReceiptField.DIGEST, | |
ReceiptField.RA, | |
ReceiptField.RB, | |
ReceiptField.RC, | |
ReceiptField.RD, | |
ReceiptField.LEN, | |
ReceiptField.RECEIPT_TYPE, | |
ReceiptField.DATA, | |
] | |
) | |
) | |
res = await client.get_selected_data(query) | |
print("{ \"receipts\": [") | |
for receipt in res.data.receipts: | |
if receipt.tx_id == tx_id: | |
print("{") | |
print(f"\"receipt_index\": \"{str(receipt.receipt_index)}\",") | |
print(f"\"id\": \"{str(receipt.root_contract_id)}\",") | |
print(f"\"pc\": \"{str(receipt.pc)}\",") | |
print(f"\"ptr\": \"{str(receipt.ptr)}\",") | |
print(f"\"digest\": \"{str(receipt.digest)}\",") | |
print(f"\"ra\": \"{str(receipt.ra)}\",") | |
print(f"\"rb\": \"{str(receipt.rb)}\",") | |
print(f"\"rc\": \"{str(receipt.rc)}\",") | |
print(f"\"rd\": \"{str(receipt.rd)}\",") | |
print(f"\"len\": \"{str(receipt.len)}\",") | |
print(f"\"receipt_type\": \"{str(receipt.receipt_type)}\",") | |
print(f"\"data\": \"{str(receipt.data)}\"") | |
print("},") | |
print("]}") | |
asyncio.run(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"receipts": [ | |
{ | |
"receipt_index": "15", | |
"id": "0x4a2ce054e3e94155f7092f7365b212f7f45105b74819c623744ebcc5d065c6ac", | |
"pc": "64776", | |
"ptr": "67094240", | |
"digest": "0x0311b355417c12b94909ff900cb7b4a977836cc8132c3fba25bc07d8c991c7b8", | |
"ra": "0", | |
"rb": "6411998037120698508", | |
"rc": "None", | |
"rd": "None", | |
"len": "128", | |
"receipt_type": "6", | |
"data": "0x3f4c260ac2b54cd1fb9a3331fcfc1a9da1e803e941077d4878df3c702065b21a00000000000000003c08cd6a39aaaf614c1842a305b91a205ea4af88a6a1d534c0753868d015dcb6400000006662dcb500000000000000029d65154b185851dabe344f7b07afc8df45c9170a4ad66b0795fffade9336bea20000000000000000" | |
}, | |
{ | |
"receipt_index": "16", | |
"id": "0x4a2ce054e3e94155f7092f7365b212f7f45105b74819c623744ebcc5d065c6ac", | |
"pc": "65340", | |
"ptr": "67089088", | |
"digest": "0x5f00f9b65ab92a748d606e4eb12fea884d3466d4174a7b1dd06d58f26d8d16f2", | |
"ra": "0", | |
"rb": "6411998037120698508", | |
"rc": "None", | |
"rd": "None", | |
"len": "241", | |
"receipt_type": "6", | |
"data": "0x97ff915f6783fdba0ed03d8dc0b60f90186c08646ebbe0cd1e25863ee700478d00000000000000003c08cd6a39aaaf614c1842a305b91a205ea4af88a6a1d534c0753868d015dcb6400000006662dcb500000000000000029d65154b185851dabe344f7b07afc8df45c9170a4ad66b0795fffade9336bea2000000000000000197ff915f6783fdba0ed03d8dc0b60f90186c08646ebbe0cd1e25863ee700478dc8a3b04b77d680066a978ff29b562898a5298070071f33a425ec82dc12e9bcd9ccceae45a7c23dcd4024f4083e959a0686a191694e76fa4fb76c449361ca01f7000000000000d7a000000048c273950000" | |
}, | |
{ | |
"receipt_index": "17", | |
"id": "0x4a2ce054e3e94155f7092f7365b212f7f45105b74819c623744ebcc5d065c6ac", | |
"pc": "65648", | |
"ptr": "67088064", | |
"digest": "0x5742a7e6a1b8f66f141d3b97e9a260b82bf339fc381d3ce06655aeec5537d7a3", | |
"ra": "0", | |
"rb": "8794783797310168923", | |
"rc": "None", | |
"rd": "None", | |
"len": "248", | |
"receipt_type": "6", | |
"data": "0xccceae45a7c23dcd4024f4083e959a0686a191694e76fa4fb76c449361ca01f73c08cd6a39aaaf614c1842a305b91a205ea4af88a6a1d534c0753868d015dcb69981187e36343413cc59228c3e259a1e6057e237d5ec6b46e0a8ae69c63a15c6c8a3b04b77d680066a978ff29b562898a5298070071f33a425ec82dc12e9bcd9000000000008b290000040c1868922803f4c260ac2b54cd1fb9a3331fcfc1a9da1e803e941077d4878df3c702065b21a97ff915f6783fdba0ed03d8dc0b60f90186c08646ebbe0cd1e25863ee700478d400000006662dcb59d65154b185851dabe344f7b07afc8df45c9170a4ad66b0795fffade9336bea2" | |
}, | |
{ | |
"receipt_index": "26", | |
"id": "0x4a2ce054e3e94155f7092f7365b212f7f45105b74819c623744ebcc5d065c6ac", | |
"pc": "64776", | |
"ptr": "67062016", | |
"digest": "0xf5ef2a485fc2631642afabdbd282efbc49e300cd28355513445ea145758baffd", | |
"ra": "0", | |
"rb": "6411998037120698508", | |
"rc": "None", | |
"rd": "None", | |
"len": "241", | |
"receipt_type": "6", | |
"data": "0x71bb4148bff731f8348fa822fd71e5b40fbca87f6b5a104408b8b961429aaea200000000000000003c08cd6a39aaaf614c1842a305b91a205ea4af88a6a1d534c0753868d015dcb6400000006662dcb500000000000000029d65154b185851dabe344f7b07afc8df45c9170a4ad66b0795fffade9336bea2000000000000000171bb4148bff731f8348fa822fd71e5b40fbca87f6b5a104408b8b961429aaea2634de1661ed6bfc8639be4514ec55c9f323e0e8d773d88f8478060214d38bf5cccceae45a7c23dcd4024f4083e959a0686a191694e76fa4fb76c449361ca01f7000000000002902a01000040c166a5aec0" | |
}, | |
{ | |
"receipt_index": "27", | |
"id": "0x4a2ce054e3e94155f7092f7365b212f7f45105b74819c623744ebcc5d065c6ac", | |
"pc": "65340", | |
"ptr": "67056864", | |
"digest": "0x6c43696e0c7578a239ca1164675d3faa194421e80485c4ca5b3da62313f25bb0", | |
"ra": "0", | |
"rb": "6411998037120698508", | |
"rc": "None", | |
"rd": "None", | |
"len": "128", | |
"receipt_type": "6", | |
"data": "0x97ff915f6783fdba0ed03d8dc0b60f90186c08646ebbe0cd1e25863ee700478d00000000000000003c08cd6a39aaaf614c1842a305b91a205ea4af88a6a1d534c0753868d015dcb6400000006662dcb500000000000000029d65154b185851dabe344f7b07afc8df45c9170a4ad66b0795fffade9336bea20000000000000000" | |
}, | |
{ | |
"receipt_index": "28", | |
"id": "0x4a2ce054e3e94155f7092f7365b212f7f45105b74819c623744ebcc5d065c6ac", | |
"pc": "65648", | |
"ptr": "67055840", | |
"digest": "0x0b48534a7e84dfa9fd77a842d6bdfc960bac6faec23ac25c62a752cae6d186a6", | |
"ra": "0", | |
"rb": "8794783797310168923", | |
"rc": "None", | |
"rd": "None", | |
"len": "248", | |
"receipt_type": "6", | |
"data": "0xccceae45a7c23dcd4024f4083e959a0686a191694e76fa4fb76c449361ca01f73c08cd6a39aaaf614c1842a305b91a205ea4af88a6a1d534c0753868d015dcb6634de1661ed6bfc8639be4514ec55c9f323e0e8d773d88f8478060214d38bf5cc8a3b04b77d680066a978ff29b562898a5298070071f33a425ec82dc12e9bcd9000000000000f246000040c166a5aec071bb4148bff731f8348fa822fd71e5b40fbca87f6b5a104408b8b961429aaea297ff915f6783fdba0ed03d8dc0b60f90186c08646ebbe0cd1e25863ee700478d400000006662dcb59d65154b185851dabe344f7b07afc8df45c9170a4ad66b0795fffade9336bea2" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"transaction": { | |
"receiptsRoot": "0x34de79384962cbc8d6390b9d0419ed52590935683155b60bf937f54d5c40aef3", | |
"status": { | |
"__typename": "SuccessStatus", | |
"receipts": [ | |
{ | |
"id": "0x4a2ce054e3e94155f7092f7365b212f7f45105b74819c623744ebcc5d065c6ac", | |
"pc": "64776", | |
"is": "21320", | |
"ptr": "67094240", | |
"digest": "0x0311b355417c12b94909ff900cb7b4a977836cc8132c3fba25bc07d8c991c7b8", | |
"reason": null, | |
"ra": "0", | |
"rb": "6411998037120698508", | |
"rc": null, | |
"rd": null, | |
"len": "128", | |
"receiptType": "LOG_DATA", | |
"data": "0x3f4c260ac2b54cd1fb9a3331fcfc1a9da1e803e941077d4878df3c702065b21a00000000000000003c08cd6a39aaaf614c1842a305b91a205ea4af88a6a1d534c0753868d015dcb6400000006662dcb500000000000000029d65154b185851dabe344f7b07afc8df45c9170a4ad66b0795fffade9336bea20000000000000000" | |
}, | |
{ | |
"id": "0x4a2ce054e3e94155f7092f7365b212f7f45105b74819c623744ebcc5d065c6ac", | |
"pc": "65340", | |
"is": "21320", | |
"ptr": "67089088", | |
"digest": "0x5f00f9b65ab92a748d606e4eb12fea884d3466d4174a7b1dd06d58f26d8d16f2", | |
"reason": null, | |
"ra": "0", | |
"rb": "6411998037120698508", | |
"rc": null, | |
"rd": null, | |
"len": "241", | |
"receiptType": "LOG_DATA", | |
"data": "0x97ff915f6783fdba0ed03d8dc0b60f90186c08646ebbe0cd1e25863ee700478d00000000000000003c08cd6a39aaaf614c1842a305b91a205ea4af88a6a1d534c0753868d015dcb6400000006662dcb500000000000000029d65154b185851dabe344f7b07afc8df45c9170a4ad66b0795fffade9336bea2000000000000000197ff915f6783fdba0ed03d8dc0b60f90186c08646ebbe0cd1e25863ee700478dc8a3b04b77d680066a978ff29b562898a5298070071f33a425ec82dc12e9bcd9ccceae45a7c23dcd4024f4083e959a0686a191694e76fa4fb76c449361ca01f7000000000000d7a000000048c273950000" | |
}, | |
{ | |
"id": "0x4a2ce054e3e94155f7092f7365b212f7f45105b74819c623744ebcc5d065c6ac", | |
"pc": "65648", | |
"is": "21320", | |
"ptr": "67088064", | |
"digest": "0x5742a7e6a1b8f66f141d3b97e9a260b82bf339fc381d3ce06655aeec5537d7a3", | |
"reason": null, | |
"ra": "0", | |
"rb": "8794783797310168923", | |
"rc": null, | |
"rd": null, | |
"len": "248", | |
"receiptType": "LOG_DATA", | |
"data": "0xccceae45a7c23dcd4024f4083e959a0686a191694e76fa4fb76c449361ca01f73c08cd6a39aaaf614c1842a305b91a205ea4af88a6a1d534c0753868d015dcb69981187e36343413cc59228c3e259a1e6057e237d5ec6b46e0a8ae69c63a15c6c8a3b04b77d680066a978ff29b562898a5298070071f33a425ec82dc12e9bcd9000000000008b290000040c1868922803f4c260ac2b54cd1fb9a3331fcfc1a9da1e803e941077d4878df3c702065b21a97ff915f6783fdba0ed03d8dc0b60f90186c08646ebbe0cd1e25863ee700478d400000006662dcb59d65154b185851dabe344f7b07afc8df45c9170a4ad66b0795fffade9336bea2" | |
}, | |
{ | |
"id": "0x4a2ce054e3e94155f7092f7365b212f7f45105b74819c623744ebcc5d065c6ac", | |
"pc": "64776", | |
"is": "21320", | |
"ptr": "67062016", | |
"digest": "0xf5ef2a485fc2631642afabdbd282efbc49e300cd28355513445ea145758baffd", | |
"reason": null, | |
"ra": "0", | |
"rb": "6411998037120698508", | |
"rc": null, | |
"rd": null, | |
"len": "241", | |
"receiptType": "LOG_DATA", | |
"data": "0x71bb4148bff731f8348fa822fd71e5b40fbca87f6b5a104408b8b961429aaea200000000000000003c08cd6a39aaaf614c1842a305b91a205ea4af88a6a1d534c0753868d015dcb6400000006662dcb500000000000000029d65154b185851dabe344f7b07afc8df45c9170a4ad66b0795fffade9336bea2000000000000000171bb4148bff731f8348fa822fd71e5b40fbca87f6b5a104408b8b961429aaea2634de1661ed6bfc8639be4514ec55c9f323e0e8d773d88f8478060214d38bf5cccceae45a7c23dcd4024f4083e959a0686a191694e76fa4fb76c449361ca01f7000000000002902a01000040c166a5aec0" | |
}, | |
{ | |
"id": "0x4a2ce054e3e94155f7092f7365b212f7f45105b74819c623744ebcc5d065c6ac", | |
"pc": "65340", | |
"is": "21320", | |
"ptr": "67056864", | |
"digest": "0x6c43696e0c7578a239ca1164675d3faa194421e80485c4ca5b3da62313f25bb0", | |
"reason": null, | |
"ra": "0", | |
"rb": "6411998037120698508", | |
"rc": null, | |
"rd": null, | |
"len": "128", | |
"receiptType": "LOG_DATA", | |
"data": "0x97ff915f6783fdba0ed03d8dc0b60f90186c08646ebbe0cd1e25863ee700478d00000000000000003c08cd6a39aaaf614c1842a305b91a205ea4af88a6a1d534c0753868d015dcb6400000006662dcb500000000000000029d65154b185851dabe344f7b07afc8df45c9170a4ad66b0795fffade9336bea20000000000000000" | |
}, | |
{ | |
"id": "0x4a2ce054e3e94155f7092f7365b212f7f45105b74819c623744ebcc5d065c6ac", | |
"pc": "65648", | |
"is": "21320", | |
"ptr": "67055840", | |
"digest": "0x0b48534a7e84dfa9fd77a842d6bdfc960bac6faec23ac25c62a752cae6d186a6", | |
"reason": null, | |
"ra": "0", | |
"rb": "8794783797310168923", | |
"rc": null, | |
"rd": null, | |
"len": "248", | |
"receiptType": "LOG_DATA", | |
"data": "0xccceae45a7c23dcd4024f4083e959a0686a191694e76fa4fb76c449361ca01f73c08cd6a39aaaf614c1842a305b91a205ea4af88a6a1d534c0753868d015dcb6634de1661ed6bfc8639be4514ec55c9f323e0e8d773d88f8478060214d38bf5cc8a3b04b77d680066a978ff29b562898a5298070071f33a425ec82dc12e9bcd9000000000000f246000040c166a5aec071bb4148bff731f8348fa822fd71e5b40fbca87f6b5a104408b8b961429aaea297ff915f6783fdba0ed03d8dc0b60f90186c08646ebbe0cd1e25863ee700478d400000006662dcb59d65154b185851dabe344f7b07afc8df45c9170a4ad66b0795fffade9336bea2" | |
} | |
] | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query { | |
transaction(id: "0x9d65154b185851dabe344f7b07afc8df45c9170a4ad66b0795fffade9336bea2") { | |
receiptsRoot | |
status { | |
__typename | |
... on SuccessStatus { | |
receipts { | |
id | |
pc | |
is | |
to | |
toAddress | |
amount | |
assetId | |
gas | |
param1 | |
param2 | |
val | |
ptr | |
digest | |
reason | |
ra | |
rb | |
rc | |
rd | |
len | |
receiptType | |
result | |
gasUsed | |
data | |
sender | |
recipient | |
nonce | |
contractId | |
subId | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment