Skip to content

Commit

Permalink
Relocate change_hive_owner_update_limit function
Browse files Browse the repository at this point in the history
  • Loading branch information
Michał Kudela committed Oct 10, 2023
1 parent 8926346 commit f90c152
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
17 changes: 1 addition & 16 deletions tests/python/functional/hf26_tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from datetime import datetime
import json
from typing import Dict, Optional

import pytest

import test_tools as tt
from hive_local_tools.constants import ALTERNATE_CHAIN_JSON_FILENAME
from hive_local_tools.functional.python import change_hive_owner_update_limit
from shared_tools.complex_networks import init_network


Expand Down Expand Up @@ -147,17 +146,3 @@ def network_after_hf26_without_majority():
"alpha": alpha_net,
"beta": beta_net,
}


def change_hive_owner_update_limit(seconds_limit: int) -> None:
current_time = datetime.now()
alternate_chain_spec_content = {
"genesis_time": int(current_time.timestamp()),
"hardfork_schedule": [{"hardfork": 26, "block_num": 1}],
"hive_owner_update_limit": seconds_limit,
}

directory = tt.context.get_current_directory()
directory.mkdir(parents=True, exist_ok=True)
with open(directory / ALTERNATE_CHAIN_JSON_FILENAME, "w") as json_file:
json.dump(alternate_chain_spec_content, json_file)
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import json
from datetime import datetime

import test_tools as tt
from hive_local_tools.constants import ALTERNATE_CHAIN_JSON_FILENAME


def change_hive_owner_update_limit(seconds_limit: int) -> None:
current_time = datetime.now()
alternate_chain_spec_content = {
"genesis_time": int(current_time.timestamp()),
"hardfork_schedule": [{"hardfork": 26, "block_num": 1}],
"hive_owner_update_limit": seconds_limit,
}

directory = tt.context.get_current_directory()
directory.mkdir(parents=True, exist_ok=True)
with open(directory / ALTERNATE_CHAIN_JSON_FILENAME, "w") as json_file:
json.dump(alternate_chain_spec_content, json_file)

0 comments on commit f90c152

Please sign in to comment.