Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
hweawer committed Dec 16, 2024
1 parent cf5e190 commit 4cd8a5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/blockchain/web3_extentions/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ def add_requests_metric_middleware(web3: Web3) -> Web3:
ETH_RPC_REQUESTS - Counter with requests count, response codes and request domain.
"""
chain_id = web3.eth.chain_id
metric = ETH_RPC_REQUESTS if chain_id == 1 else ONCHAIN_TRANSPORT_ETH_RPC_REQUESTS

def metrics_collector(make_request: Callable[[RPCEndpoint, Any], RPCResponse], w3: Web3) -> Callable[[RPCEndpoint, Any], RPCResponse]:
"""Constructs a middleware which measure requests parameters"""
metric = ETH_RPC_REQUESTS if chain_id == 1 else ONCHAIN_TRANSPORT_ETH_RPC_REQUESTS

def middleware(method: RPCEndpoint, params: Any) -> RPCResponse:
try:
Expand Down

0 comments on commit 4cd8a5e

Please sign in to comment.