Skip to content

Commit 06f16ba

Browse files
committed
Fix web3 lint errors
1 parent e6c86a4 commit 06f16ba

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ commands=
5454
flake8 {toxinidir}/web3 {toxinidir}/ens {toxinidir}/ethpm {toxinidir}/tests --exclude {toxinidir}/ethpm/ethpm-spec,{toxinidir}/**/*_pb2.py
5555
black {toxinidir}/ens {toxinidir}/ethpm {toxinidir}/web3 {toxinidir}/tests {toxinidir}/setup.py --exclude /ethpm/ethpm-spec/|/ethpm/_utils/protobuf/ipfs_file_pb2\.py --check
5656
isort --check-only --diff {toxinidir}/web3/ {toxinidir}/ens/ {toxinidir}/ethpm/ {toxinidir}/tests/
57-
mypy -p web3 -p ethpm -p ens --config-file {toxinidir}/mypy.ini
57+
mypy -p web3 -p ethpm -p ens --enable-incomplete-feature Unpack --config-file {toxinidir}/mypy.ini
5858

5959
[testenv:lint]
6060
basepython: python

web3/_utils/events.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def construct_event_topic_set(
140140
for arg, arg_options in zipped_abi_and_args
141141
]
142142

143-
topics = list(normalize_topic_list([event_topic] + encoded_args)) # type: ignore
143+
topics = list(normalize_topic_list([event_topic] + encoded_args))
144144
return topics
145145

146146

@@ -394,12 +394,12 @@ def address(self, value: ChecksumAddress) -> None:
394394
def ordered_args(self) -> Tuple[Any, ...]:
395395
return tuple(map(self.args.__getitem__, self._ordered_arg_names))
396396

397-
@property # type: ignore
397+
@property
398398
@to_tuple
399399
def indexed_args(self) -> Tuple[Any, ...]:
400400
return tuple(filter(is_indexed, self.ordered_args))
401401

402-
@property # type: ignore
402+
@property
403403
@to_tuple
404404
def data_args(self) -> Tuple[Any, ...]:
405405
return tuple(filter(is_not_indexed, self.ordered_args))
@@ -432,7 +432,7 @@ def deploy(self, w3: "Web3") -> "LogFilter":
432432
if not isinstance(w3, web3.Web3):
433433
raise ValueError(f"Invalid web3 argument: got: {w3!r}")
434434

435-
for arg in AttributeDict.values(self.args):
435+
for arg in self.args.values():
436436
arg._immutable = True
437437
self._immutable = True
438438

web3/_utils/module_testing/eth_module.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2670,7 +2670,7 @@ def test_eth_modify_transaction_legacy(
26702670
txn_hash = w3.eth.send_transaction(txn_params)
26712671

26722672
modified_txn_hash = w3.eth.modify_transaction(
2673-
txn_hash, gasPrice=(cast(int, txn_params["gasPrice"]) * 2), value=2
2673+
txn_hash, gasPrice=(cast(Wei, txn_params["gasPrice"] * 2)), value=Wei(2)
26742674
)
26752675
modified_txn = w3.eth.get_transaction(modified_txn_hash)
26762676

@@ -2699,9 +2699,9 @@ def test_eth_modify_transaction(
26992699

27002700
modified_txn_hash = w3.eth.modify_transaction(
27012701
txn_hash,
2702-
value=2,
2703-
maxPriorityFeePerGas=(cast(Wei, txn_params["maxPriorityFeePerGas"]) * 2),
2704-
maxFeePerGas=(cast(Wei, txn_params["maxFeePerGas"]) * 2),
2702+
value=Wei(2),
2703+
maxPriorityFeePerGas=(cast(Wei, txn_params["maxPriorityFeePerGas"] * 2)),
2704+
maxFeePerGas=(cast(Wei, txn_params["maxFeePerGas"] * 2)),
27052705
)
27062706
modified_txn = w3.eth.get_transaction(modified_txn_hash)
27072707

web3/_utils/module_testing/web3_module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def test_solidity_keccak(
229229
expected: HexBytes,
230230
) -> None:
231231
if isinstance(expected, type) and issubclass(expected, Exception):
232-
with pytest.raises(expected): # type: ignore
232+
with pytest.raises(expected):
233233
w3.solidity_keccak(types, values)
234234
return
235235

web3/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def pm(self) -> "PM":
330330
if hasattr(self, "_pm"):
331331
# ignored b/c property is dynamically set
332332
# via enable_unstable_package_management_api
333-
return self._pm # type: ignore
333+
return self._pm
334334
else:
335335
raise AttributeError(
336336
"The Package Management feature is disabled by default until "

0 commit comments

Comments
 (0)