-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
30 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"""Ankr specific Web3.py functionality. | ||
- Ankr has issues with some JSON-RPC access patterns. | ||
See also :py:mod:`eth_defi.rpc.broken_provider`. | ||
""" | ||
from web3 import Web3 | ||
|
||
from eth_defi.provider.named import get_provider_name | ||
|
||
|
||
def is_ankr(web3: Web3) -> bool: | ||
"""Are we connected to Ankr as a provider. | ||
We use this function to detect and activate Ankr workarounds | ||
for their bugs and features. | ||
""" | ||
name = get_provider_name(web3.provider) | ||
return name == "rpc.ankr.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters