File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 11# Ensures all names in NAMES_FULL_COVERAGE resolve successfully in benchmarks.
2+ from benchmarks .web3 ._utils .params import BLOCK_DICT
3+
24FAKE_ENS_REGISTRY = "0x0000000000000000000000000000000000000002"
35FAKE_RESOLVER = "0x0000000000000000000000000000000000000001"
46FAKE_RESULT_ADDR = "0x314159265dD8dbb310642f98f50C066173C1259b"
57
6-
78def fake_json_rpc_response (request_data : dict ):
89 method = request_data .get ("method" )
910 params = request_data .get ("params" , [])
@@ -41,5 +42,12 @@ def fake_json_rpc_response(request_data: dict):
4142 }
4243 else :
4344 return {"jsonrpc" : "2.0" , "id" : request_data ["id" ], "result" : "0x" }
45+ elif method == "eth_getBlockByNumber" :
46+ # Return a realistic block dict for block queries (shared with tests)
47+ return {
48+ "jsonrpc" : "2.0" ,
49+ "id" : request_data ["id" ],
50+ "result" : BLOCK_DICT ,
51+ }
4452 # Default: always return a valid hex string for any other method
4553 return {"jsonrpc" : "2.0" , "id" : request_data ["id" ], "result" : "0x" }
You can’t perform that action at this time.
0 commit comments