Skip to content

Commit

Permalink
Add missing hints to tests - HELpy integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Michał Kudela authored and vogel76 committed Dec 7, 2023
1 parent 40900e6 commit d94c163
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@pytest.mark.testnet()
@pytest.mark.parametrize("limit", [6, 15, 30, 45, 90, 180, 360, 720])
def test_modify_hive_owner_update_limit(limit):
def test_modify_hive_owner_update_limit(limit: int) -> None:
node = tt.InitNode()
current_hardfork_number = int(node.get_version()["version"]["blockchain_version"].split(".")[1])

Expand All @@ -24,7 +24,7 @@ def test_modify_hive_owner_update_limit(limit):
arguments=["--alternate-chain-spec", str(tt.context.get_current_directory() / ALTERNATE_CHAIN_JSON_FILENAME)]
)

limit_in_microseconds = node.api.database.get_config()["HIVE_OWNER_UPDATE_LIMIT"]
limit_in_microseconds = node.api.database.get_config().HIVE_OWNER_UPDATE_LIMIT
assert limit_in_microseconds / 1_000_000 == limit, "The `HIVE_OWNER_UPDATE_LIMIT` was not updated correctly."


Expand All @@ -36,7 +36,7 @@ def test_modify_hive_owner_update_limit(limit):
7, # the limit must be divisible by 3,
],
)
def test_invalid_hive_owner_update_limit_modification(limit):
def test_invalid_hive_owner_update_limit_modification(limit: int) -> None:
node = tt.InitNode()
current_hardfork_number = int(node.get_version()["version"]["blockchain_version"].split(".")[1])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from hive_local_tools.constants import ALTERNATE_CHAIN_JSON_FILENAME


def test_simply_hardfork_schedule():
def test_simply_hardfork_schedule() -> None:
"""
Hardfork schedule depends on time. Therefore, possible is situation the hard works will be applying in other
blocks in different runs. Slight delays are caused by a.o. using in this test faketime to increase speed of test,
Expand Down Expand Up @@ -94,7 +94,7 @@ def test_simply_hardfork_schedule():
),
],
)
def test_incorrect_hardfork_schedules(hardfork_schedule):
def test_incorrect_hardfork_schedules(hardfork_schedule: list[dict]) -> None:
create_alternate_chain_spec_file(
genesis_time=int(tt.Time.now(serialize=False).timestamp()),
hardfork_schedule=hardfork_schedule,
Expand All @@ -117,7 +117,7 @@ def test_incorrect_hardfork_schedules(hardfork_schedule):
["genesis_time"],
],
)
def test_alternate_chain_spec_necessary_keys(keys_to_drop):
def test_alternate_chain_spec_necessary_keys(keys_to_drop: list[str]) -> None:
alternate_chain_spec = {
"genesis_time": int(tt.Time.now(serialize=False).timestamp()),
"hardfork_schedule": [{"hardfork": 2, "block_num": 0}],
Expand Down Expand Up @@ -147,7 +147,7 @@ def test_alternate_chain_spec_necessary_keys(keys_to_drop):
["hbd_init_supply"],
],
)
def test_alternate_chain_spec_optional_keys(keys_to_drop):
def test_alternate_chain_spec_optional_keys(keys_to_drop: list[str]) -> None:
alternate_chain_spec = {
"genesis_time": int(tt.Time.now(serialize=False).timestamp()),
"hardfork_schedule": [{"hardfork": 2, "block_num": 0}],
Expand All @@ -174,7 +174,7 @@ def test_alternate_chain_spec_optional_keys(keys_to_drop):
["a", "ab"],
],
)
def test_invalid_witness_names(witnesses):
def test_invalid_witness_names(witnesses: list[int | str]) -> None:
alternate_chain_spec = {
"genesis_time": int(tt.Time.now(serialize=False).timestamp()),
"hardfork_schedule": [{"hardfork": 2, "block_num": 0}],
Expand Down

0 comments on commit d94c163

Please sign in to comment.