Skip to content

Commit

Permalink
Fix pylint.
Browse files Browse the repository at this point in the history
  • Loading branch information
calina-c committed Dec 20, 2023
1 parent c1e62a8 commit ca4c3d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
8 changes: 2 additions & 6 deletions pdr_backend/contract/base_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
class BaseContract(ABC):
def __init__(self, web3_pp, address: str, contract_name: str):
super().__init__()
from pdr_backend.ppss.web3_pp import (
Web3PP,
) # pylint: disable=import-outside-toplevel
from pdr_backend.util.contract import (
get_contract_abi,
) # pylint: disable=import-outside-toplevel
from pdr_backend.ppss.web3_pp import Web3PP # 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")
Expand Down
12 changes: 3 additions & 9 deletions pdr_backend/ppss/web3_pp.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ def get_contracts(self, feed_addrs: List[str]) -> Dict[str, Any]:
@return
contracts -- dict of [feed_addr] : PredictoorContract
"""
from pdr_backend.contract.predictoor_contract import (
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:
Expand Down Expand Up @@ -175,9 +173,7 @@ def mock_web3_pp(network: str) -> Web3PP:

@enforce_types
def inplace_mock_feedgetters(web3_pp, feed: SubgraphFeed):
from pdr_backend.contract.predictoor_contract import (
mock_predictoor_contract,
) # 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)

Expand All @@ -195,9 +191,7 @@ def inplace_mock_query_feed_contracts(web3_pp: Web3PP, feed: SubgraphFeed):
def inplace_mock_get_contracts(
web3_pp: Web3PP, feed: SubgraphFeed, predictoor_contract
):
from pdr_backend.contract.predictoor_contract import (
PredictoorContract,
) # 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()
Expand Down

0 comments on commit ca4c3d7

Please sign in to comment.