99from faster_web3 .types import RPCEndpoint
1010from pytest_codspeed import BenchmarkFixture
1111
12+ from benchmarks .web3 ._utils .params import BLOCK_DICT , FEE_HISTORY_DICT , LOG_ENTRY , RECEIPT_DICT , TX_DICT
13+
1214
1315def run_1000 (fn , * args ):
1416 for _ in range (1000 ):
@@ -18,21 +20,6 @@ def run_1000(fn, *args):
1820# --- SYSTEMATIC BENCHMARKS FOR PYTHONIC_RESULT_FORMATTERS ---
1921
2022# NOTE: These are explicit, non-parameterized, one-per-key test stubs for both web3 and faster_web3.
21- # All data below is based on real mainnet-style values or representative realistic examples.
22-
23- TX_DATA = {
24- "hash" : "0xfaceb00c1234567890b00b7be2feedbeefcafe1234567890deadbeefcafebaba" ,
25- "nonce" : "0x42" ,
26- "blockHash" : "0x5e1d3a76fbf824220e3d1e4b8b1c1b6b1c1b6b1c1b6b1c1b6b1c1b6b1c1b6b1c" ,
27- "blockNumber" : "0x1337" ,
28- "transactionIndex" : "0x0" ,
29- "from" : "0xFEB4acf3df3cDEA7399794D0869ef76A6EfAff52" ,
30- "to" : "0xdeadbeef0000000000000000000000000000000000" ,
31- "value" : "0x1234" ,
32- "gas" : "0x5208" ,
33- "gasPrice" : "0x3b9aca00" ,
34- "input" : "0x" ,
35- }
3623
3724
3825# PYTHONIC_REQUEST_FORMATTERS
@@ -125,7 +112,7 @@ def test_faster_PYTHONIC_REQUEST_FORMATTERS(
125112 "eth_sendTransaction" : "0xfeedbabe1234567890cafebabe1234567890feedbabe1234567890cafebabe12" ,
126113 "eth_signTypedData" : "0x1c6401ff0c2b6a1c1b6b1c1b6b1c1b6b1c1b6b1c1b6b1c1b6b1c1b6b1c1b6b1c1" ,
127114 "eth_getRawTransactionByHash" : "0x5e1d3a76fbf824220e3d1e4b8b1c1b6b1c1b6b1c1b6b1c1b6b1c1b6b1c1b6b1c1" ,
128- "eth_getTransactionByHash" : TX_DATA ,
115+ "eth_getTransactionByHash" : TX_DICT ,
129116 "eth_getUncleCountByBlockHash" : "0x2" ,
130117 "eth_getUncleCountByBlockNumber" : "0x2" ,
131118 "eth_getStorageAt" : "0x0000000000000000000000000000000000000000000000000000000000000000" ,
@@ -139,8 +126,8 @@ def test_faster_PYTHONIC_REQUEST_FORMATTERS(
139126 "storageHash" : "0x5e1d3a76fbf824220e3d1e4b8b1c1b6b1c1b6b1c1b6b1c1b6b1c1b6b1c1b6b1" ,
140127 "storageProof" : [],
141128 },
142- "eth_getTransactionByBlockHashAndIndex" : TX_DATA ,
143- "eth_getTransactionByBlockNumberAndIndex" : TX_DATA ,
129+ "eth_getTransactionByBlockHashAndIndex" : TX_DICT ,
130+ "eth_getTransactionByBlockNumberAndIndex" : TX_DICT ,
144131 "eth_subscribe" : {
145132 "result" : "0x5e1d3a76fbf824220e3d1e4b8b1c1b6b1c1b6b1c1b6b1c1b6b1c1b6b1c1b6b1c1"
146133 },
0 commit comments