Skip to content

Commit 68800d7

Browse files
committed
fix mypy errs
1 parent a0e933e commit 68800d7

File tree

2 files changed

+8
-20
lines changed

2 files changed

+8
-20
lines changed

benchmarks/web3/_utils/params.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Shared parameterizations and real-world data for microbenchmarks
2+
# All data below is based on real mainnet-style values or representative realistic examples.
23

34
# Transaction dict (mainnet-style)
45
TX_DICT = {
5-
"from": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
6-
"to": "0x53d284357ec70cE289D6D64134DfAc8E511c8a3D",
6+
"from": "0xFEB4acf3df3cDEA7399794D0869ef76A6EfAff52",
7+
"to": "0xdeadbeef0000000000000000000000000000000000",
78
"value": 1000000000000000000,
89
"gas": 21000,
910
"data": "0x",

benchmarks/web3/_utils/test_method_formatters_benchmarks.py

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from faster_web3.types import RPCEndpoint
1010
from 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

1315
def 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

Comments
 (0)