diff --git a/brownie/network/multicall.py b/brownie/network/multicall.py index 000a294e5..fc32ac342 100644 --- a/brownie/network/multicall.py +++ b/brownie/network/multicall.py @@ -3,7 +3,7 @@ from dataclasses import dataclass from threading import get_ident from types import FunctionType, TracebackType -from typing import Any, Dict, List, Tuple, Union +from typing import Any, Dict, List, Optional, Tuple, Union from lazy_object_proxy import Proxy from wrapt import ObjectProxy @@ -55,10 +55,10 @@ def __init__(self) -> None: ContractCall.__call__.__code__ = self._proxy_call.__code__ def __call__( - self, address: str = None, block_identifier: Union[str, bytes, int] = None + self, address: Optional[str] = None, block_identifier: Union[str, bytes, int, None] = None ) -> "Multicall": - self.address = address - self.block_number = block_identifier + self.address = address # type: ignore + self.block_number = block_identifier # type: ignore return self def _flush(self, future_result: Result = None) -> Any: @@ -67,7 +67,7 @@ def _flush(self, future_result: Result = None) -> Any: # or this result has already been retrieved return future_result ContractCall.__call__.__code__ = getattr(ContractCall, "__original_call_code") - results = self._contract.tryAggregate( + results = self._contract.tryAggregate( # type: ignore False, [_call.calldata for _call in self._pending_calls], block_identifier=self.block_number, @@ -121,8 +121,8 @@ def __enter__(self) -> "Multicall": self.address = active_network["multicall2"] elif "cmd" in active_network: deployment = self.deploy({"from": accounts[0]}) - self.address = deployment.address - self.block_number = deployment.tx.block_number + self.address = deployment.address # type: ignore + self.block_number = deployment.tx.block_number # type: ignore self.block_number = self.block_number or web3.eth.get_block_number() diff --git a/tests/network/test_mulitcall.py b/tests/network/test_mulitcall.py index 3ea1cccf8..081c6609e 100644 --- a/tests/network/test_mulitcall.py +++ b/tests/network/test_mulitcall.py @@ -1,10 +1,8 @@ import inspect -import pytest from lazy_object_proxy import Proxy import brownie -from brownie.exceptions import ContractNotFound def test_auto_deploy_on_testnet(config, devnetwork):