Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect call for getting db from mongo client #62

Merged
merged 3 commits into from
Oct 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions ethtx/ethtx.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@ class EthTxConfig:
mongo_connection_string: str
etherscan_api_key: str
web3nodes: Dict[str, dict]
mongo_database: str
etherscan_urls: Dict[str, str]
default_chain: str

def __init__(
self,
mongo_connection_string: str,
mongo_database: str,
web3nodes: Dict[str, dict],
etherscan_api_key: str,
etherscan_urls: Dict[str, str],
Expand All @@ -49,7 +47,6 @@ def __init__(
self.mongo_connection_string = mongo_connection_string
self.etherscan_api_key = etherscan_api_key
self.web3nodes = web3nodes
self.mongo_database = mongo_database
self.default_chain = default_chain
self.etherscan_urls = etherscan_urls

Expand Down Expand Up @@ -112,10 +109,8 @@ def __init__(

@staticmethod
def initialize(config: EthTxConfig):
mongo_client: MongoClient = connect(
db=config.mongo_database, host=config.mongo_connection_string
)
repository = MongoSemanticsDatabase(db=mongo_client.db)
mongo_client: MongoClient = connect(host=config.mongo_connection_string)
repository = MongoSemanticsDatabase(db=mongo_client.get_database())

web3provider = Web3Provider(
nodes=config.web3nodes, default_chain=config.default_chain
Expand Down