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 0fe4752
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions pdr_backend/contract/base_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 6 additions & 3 deletions pdr_backend/ppss/web3_pp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand All @@ -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()
Expand Down

0 comments on commit 0fe4752

Please sign in to comment.