Skip to content

Commit 1401c72

Browse files
authored
Merge pull request #3368 from IntersectMBO/type_checking_mypy
Rely solely on mypy for type checking
2 parents 89614c5 + 3bf48a1 commit 1401c72

19 files changed

Lines changed: 40 additions & 52 deletions

.pre-commit-config.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,3 @@ repos:
3939
entry: mypy
4040
language: system
4141
types: [python]
42-
- id: pyright
43-
name: pyright
44-
entry: pyright
45-
language: system
46-
types: [python]

cardano_node_tests/tests/test_kes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def _check_block_production(
116116
)
117117

118118
# Check if the pool is forging any blocks
119-
blocks_made = ledger_state["blocksCurrent"] or {}
119+
blocks_made: dict = ledger_state["blocksCurrent"] or {}
120120
is_forging = pool_id_dec in blocks_made
121121

122122
return epoch, is_forging

cardano_node_tests/tests/test_mir_certs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def registered_users(
8585
fixture_cache: cluster_management.FixtureCache[list[clusterlib.PoolUser] | None]
8686
with cluster_manager.cache_fixture() as fixture_cache:
8787
if fixture_cache.value is not None:
88-
return fixture_cache.value
88+
return fixture_cache.value # type: ignore[no-any-return]
8989
fixture_cache.value = registered
9090

9191
for i, pool_user in enumerate(registered):

cardano_node_tests/tests/test_native_tokens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1779,7 +1779,7 @@ def new_token(
17791779
fixture_cache: cluster_management.FixtureCache[clusterlib_utils.NativeTokenRec | None]
17801780
with cluster_manager.cache_fixture() as fixture_cache:
17811781
if fixture_cache.value is not None:
1782-
return fixture_cache.value
1782+
return fixture_cache.value # type: ignore[no-any-return]
17831783

17841784
rand = clusterlib.get_rand_str(4)
17851785
temp_template = f"test_tx_new_token_ci{cluster_manager.cluster_instance_num}_{rand}"

cardano_node_tests/tests/test_staking_rewards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ def test_decreasing_reward_transferred_funds(
10351035
f"Incorrect balance for source address `{delegation_out.pool_user.payment.address}`"
10361036
)
10371037

1038-
rewards_rec = []
1038+
rewards_rec: list[int] = []
10391039

10401040
# Keep withdrawing new rewards so reward balance is 0
10411041
def _withdraw():

cardano_node_tests/tests/test_tx_negative.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def _get_validity_range(
330330
"""Get validity range from a transaction body."""
331331
tx_loaded = tx_view.load_tx_view(cluster_obj=cluster_obj, tx_body_file=tx_body_file)
332332

333-
validity_range = tx_loaded.get("validity range") or {}
333+
validity_range: dict = tx_loaded.get("validity range") or {}
334334

335335
loaded_invalid_before = validity_range.get("lower bound")
336336
loaded_invalid_hereafter = validity_range.get("upper bound") or validity_range.get(

cardano_node_tests/tests/tests_conway/test_committee.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,9 @@ def _check_resign_dbsync(res_member: clusterlib.CCMember) -> None:
11501150

11511151
xfail_ledger_4001_msgs = set()
11521152
for _cc_member_key in (cc_member1_key, cc_member2_key, cc_member3_key):
1153-
rat_add_member_rec = rat_add_committee_state["committee"].get(_cc_member_key) or {}
1153+
rat_add_member_rec: dict = (
1154+
rat_add_committee_state["committee"].get(_cc_member_key) or {}
1155+
)
11541156
if rat_add_member_rec:
11551157
assert rat_add_member_rec["hotCredsAuthStatus"]["tag"] != "MemberAuthorized", (
11561158
"CC Member is still authorized"
@@ -1516,7 +1518,7 @@ def _check_rat_gov_state(
15161518
vote_zero_cc_epoch = cluster.g_query.get_epoch()
15171519

15181520
def _check_zero_cc_state(state: dict):
1519-
pparams = state.get("curPParams") or state.get("currentPParams") or {}
1521+
pparams: dict = state.get("curPParams") or state.get("currentPParams") or {}
15201522
clusterlib_utils.check_updated_params(
15211523
update_proposals=zero_cc_proposal.proposals, protocol_params=pparams
15221524
)

cardano_node_tests/tests/tests_conway/test_drep.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def get_custom_drep(
101101
fixture_cache: cluster_management.FixtureCache[governance_utils.DRepRegistration | None]
102102
with cluster_manager.cache_fixture(key=caching_key) as fixture_cache:
103103
if fixture_cache.value is not None:
104-
return fixture_cache.value
104+
return fixture_cache.value # type: ignore[no-any-return]
105105

106106
reg_drep = create_drep(
107107
name_template=name_template,

cardano_node_tests/tests/tests_conway/test_pparam_update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ def _propose_pparams_update(
707707
prev_action_rec=prev_action_rec,
708708
)
709709

710-
proposed_pparams_errors = []
710+
proposed_pparams_errors: list[str] = []
711711

712712
def _check_proposed_pparams(
713713
update_proposals: list[clusterlib_utils.UpdateProposal], protocol_params: dict

cardano_node_tests/tests/tests_plutus/test_mint_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def past_horizon_funds(
6464
fixture_cache: cluster_management.FixtureCache[PHorizonFundsT | None]
6565
with cluster_manager.cache_fixture() as fixture_cache:
6666
if fixture_cache.value is not None:
67-
return fixture_cache.value
67+
return fixture_cache.value # type: ignore[no-any-return]
6868

6969
temp_template = common.get_test_id(cluster)
7070
payment_addr = payment_addrs[0]

0 commit comments

Comments
 (0)