Skip to content

Commit

Permalink
Expose switchover_noisiness argument in create_multi_provider_web3()
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Oct 24, 2024
1 parent 2d2c742 commit debabdf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion eth_defi/provider/multi_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def create_multi_provider_web3(
fallback_backoff=1.25,
request_kwargs: Optional[Any] = None,
session: Optional[Any] = None,
switchover_noisiness=logging.WARNING,
) -> MultiProviderWeb3:
"""Create a Web3 instance with multi-provider support.
Expand Down Expand Up @@ -161,6 +162,9 @@ def create_multi_provider_web3(
If not given create a default session manager with retry logic.
:param switchover_noisiness:
Log level for messages when one RPC provider fails and we try other one.
:return:
Configured Web3 instance with multiple providers
"""
Expand Down Expand Up @@ -213,7 +217,7 @@ def create_multi_provider_web3(
for p in call_providers:
_fix_provider(p)

fallback_provider = FallbackProvider(call_providers, sleep=fallback_sleep, backoff=fallback_backoff)
fallback_provider = FallbackProvider(call_providers, sleep=fallback_sleep, backoff=fallback_backoff, switchover_noisiness=switchover_noisiness)
transact_provider = None
if len(transact_endpoints) > 0:
transact_endpoint = transact_endpoints[0]
Expand Down

0 comments on commit debabdf

Please sign in to comment.