-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check if ETHEREUM_4337_BUNDLER_URL uses the correct chainId
- Closes #1987
- Loading branch information
Showing
4 changed files
with
69 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import logging | ||
from functools import cache | ||
from typing import Optional | ||
|
||
from django.conf import settings | ||
|
||
from gnosis.eth.account_abstraction import BundlerClient | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
@cache | ||
def get_bundler_client() -> Optional[BundlerClient]: | ||
""" | ||
:return: Initialized `ERC4337 RPC Bundler Client` if configured, `None` otherwise | ||
""" | ||
if settings.ETHEREUM_4337_BUNDLER_URL: | ||
return BundlerClient(settings.ETHEREUM_4337_BUNDLER_URL) | ||
logger.warning("ETHEREUM_4337_BUNDLER_URL not set, cannot configure bundler client") | ||
return None |
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