-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relocate
change_hive_owner_update_limit
function
- Loading branch information
Michał Kudela
committed
Oct 10, 2023
1 parent
8926346
commit f90c152
Showing
2 changed files
with
20 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |