diff --git a/tox.ini b/tox.ini index 4d4974551b..242ea695fb 100644 --- a/tox.ini +++ b/tox.ini @@ -54,7 +54,7 @@ commands= flake8 {toxinidir}/web3 {toxinidir}/ens {toxinidir}/ethpm {toxinidir}/tests --exclude {toxinidir}/ethpm/ethpm-spec,{toxinidir}/**/*_pb2.py black {toxinidir}/ens {toxinidir}/ethpm {toxinidir}/web3 {toxinidir}/tests {toxinidir}/setup.py --exclude /ethpm/ethpm-spec/|/ethpm/_utils/protobuf/ipfs_file_pb2\.py --check isort --check-only --diff {toxinidir}/web3/ {toxinidir}/ens/ {toxinidir}/ethpm/ {toxinidir}/tests/ - mypy -p web3 -p ethpm -p ens --config-file {toxinidir}/mypy.ini + mypy -p web3 -p ethpm -p ens --enable-incomplete-feature Unpack --config-file {toxinidir}/mypy.ini [testenv:lint] basepython: python diff --git a/web3/_utils/events.py b/web3/_utils/events.py index 1eee6b5ae9..0a00c6c6ae 100644 --- a/web3/_utils/events.py +++ b/web3/_utils/events.py @@ -140,7 +140,7 @@ def construct_event_topic_set( for arg, arg_options in zipped_abi_and_args ] - topics = list(normalize_topic_list([event_topic] + encoded_args)) # type: ignore + topics = list(normalize_topic_list([event_topic] + encoded_args)) return topics @@ -394,12 +394,12 @@ def address(self, value: ChecksumAddress) -> None: def ordered_args(self) -> Tuple[Any, ...]: return tuple(map(self.args.__getitem__, self._ordered_arg_names)) - @property # type: ignore + @property @to_tuple def indexed_args(self) -> Tuple[Any, ...]: return tuple(filter(is_indexed, self.ordered_args)) - @property # type: ignore + @property @to_tuple def data_args(self) -> Tuple[Any, ...]: return tuple(filter(is_not_indexed, self.ordered_args)) @@ -432,7 +432,7 @@ def deploy(self, w3: "Web3") -> "LogFilter": if not isinstance(w3, web3.Web3): raise ValueError(f"Invalid web3 argument: got: {w3!r}") - for arg in AttributeDict.values(self.args): + for arg in self.args.values(): arg._immutable = True self._immutable = True diff --git a/web3/_utils/module_testing/eth_module.py b/web3/_utils/module_testing/eth_module.py index 83e01ea30d..770b6f7422 100644 --- a/web3/_utils/module_testing/eth_module.py +++ b/web3/_utils/module_testing/eth_module.py @@ -2670,7 +2670,7 @@ def test_eth_modify_transaction_legacy( txn_hash = w3.eth.send_transaction(txn_params) modified_txn_hash = w3.eth.modify_transaction( - txn_hash, gasPrice=(cast(int, txn_params["gasPrice"]) * 2), value=2 + txn_hash, gasPrice=(cast(Wei, txn_params["gasPrice"] * 2)), value=Wei(2) ) modified_txn = w3.eth.get_transaction(modified_txn_hash) @@ -2699,9 +2699,9 @@ def test_eth_modify_transaction( modified_txn_hash = w3.eth.modify_transaction( txn_hash, - value=2, - maxPriorityFeePerGas=(cast(Wei, txn_params["maxPriorityFeePerGas"]) * 2), - maxFeePerGas=(cast(Wei, txn_params["maxFeePerGas"]) * 2), + value=Wei(2), + maxPriorityFeePerGas=(cast(Wei, txn_params["maxPriorityFeePerGas"] * 2)), + maxFeePerGas=(cast(Wei, txn_params["maxFeePerGas"] * 2)), ) modified_txn = w3.eth.get_transaction(modified_txn_hash) diff --git a/web3/_utils/module_testing/web3_module.py b/web3/_utils/module_testing/web3_module.py index ef3243bac3..7590e8b7e5 100644 --- a/web3/_utils/module_testing/web3_module.py +++ b/web3/_utils/module_testing/web3_module.py @@ -229,7 +229,7 @@ def test_solidity_keccak( expected: HexBytes, ) -> None: if isinstance(expected, type) and issubclass(expected, Exception): - with pytest.raises(expected): # type: ignore + with pytest.raises(expected): w3.solidity_keccak(types, values) return diff --git a/web3/main.py b/web3/main.py index 5d89a4cbdf..d138101ddf 100644 --- a/web3/main.py +++ b/web3/main.py @@ -328,9 +328,7 @@ def is_encodable(self, _type: TypeStr, value: Any) -> bool: @property def pm(self) -> "PM": if hasattr(self, "_pm"): - # ignored b/c property is dynamically set - # via enable_unstable_package_management_api - return self._pm # type: ignore + return self._pm else: raise AttributeError( "The Package Management feature is disabled by default until "