From 0fe47524be4b2b731f80573d30bcade8e9f1b801 Mon Sep 17 00:00:00 2001 From: Calina Cenan Date: Wed, 20 Dec 2023 19:34:00 +0000 Subject: [PATCH] Fix pylint. --- pdr_backend/contract/base_contract.py | 6 ++++-- pdr_backend/ppss/web3_pp.py | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pdr_backend/contract/base_contract.py b/pdr_backend/contract/base_contract.py index d5893d986..339794bff 100644 --- a/pdr_backend/contract/base_contract.py +++ b/pdr_backend/contract/base_contract.py @@ -7,12 +7,14 @@ class BaseContract(ABC): def __init__(self, web3_pp, address: str, contract_name: str): super().__init__() + # pylint: disable=import-outside-toplevel from pdr_backend.ppss.web3_pp import ( Web3PP, - ) # pylint: disable=import-outside-toplevel + ) + # pylint: disable=import-outside-toplevel from pdr_backend.util.contract import ( get_contract_abi, - ) # pylint: disable=import-outside-toplevel + ) if not isinstance(web3_pp, Web3PP): raise ValueError(f"web3_pp is {web3_pp.__class__}, not Web3PP") diff --git a/pdr_backend/ppss/web3_pp.py b/pdr_backend/ppss/web3_pp.py index aa40c8943..f992f06ad 100644 --- a/pdr_backend/ppss/web3_pp.py +++ b/pdr_backend/ppss/web3_pp.py @@ -115,9 +115,10 @@ def get_contracts(self, feed_addrs: List[str]) -> Dict[str, Any]: @return contracts -- dict of [feed_addr] : PredictoorContract """ + # pylint: disable=import-outside-toplevel from pdr_backend.contract.predictoor_contract import ( PredictoorContract, - ) # pylint: disable=import-outside-toplevel + ) contracts = {} for addr in feed_addrs: @@ -175,9 +176,10 @@ def mock_web3_pp(network: str) -> Web3PP: @enforce_types def inplace_mock_feedgetters(web3_pp, feed: SubgraphFeed): + # pylint: disable=import-outside-toplevel from pdr_backend.contract.predictoor_contract import ( mock_predictoor_contract, - ) # pylint: disable=import-outside-toplevel + ) inplace_mock_query_feed_contracts(web3_pp, feed) @@ -195,9 +197,10 @@ def inplace_mock_query_feed_contracts(web3_pp: Web3PP, feed: SubgraphFeed): def inplace_mock_get_contracts( web3_pp: Web3PP, feed: SubgraphFeed, predictoor_contract ): + # pylint: disable=import-outside-toplevel from pdr_backend.contract.predictoor_contract import ( PredictoorContract, - ) # pylint: disable=import-outside-toplevel + ) assert isinstance(predictoor_contract, PredictoorContract) web3_pp.get_contracts = Mock()