Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Add arg to take Unix integer as genesis time #686

Merged
merged 4 commits into from
Jun 4, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions trinity/plugins/eth2/network_generator/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def run_generate_testnet_dir(cls, args: Namespace, trinity_config: TrinityConfig
logger.info("Generating testnet")
network_dir = args.network_dir
if len(os.listdir(network_dir)) > 0:
logger.error("This directory is not empty, won't create network files here.")
logger.error("This directory is not empty, won't create network files here")
sys.exit(1)

clients = cls.generate_trinity_root_dirs(network_dir)
Expand All @@ -161,7 +161,7 @@ def generate_keys(cls,
network_dir: Path,
clients: Tuple[Client, ...]) -> Dict[Any, Any]:
logger = cls.get_logger()
logger.info(f"Creating {num} validators' keys")
logger.info("Creating %s validators' keys", num)
keys_dir = network_dir / KEYS_DIR
ChihChengLiang marked this conversation as resolved.
Show resolved Hide resolved
keys_dir.mkdir()

Expand Down Expand Up @@ -206,7 +206,8 @@ def generate_genesis_state(cls,
genesis_time = get_genesis_time()
print(genesis_time)
logger.info(
ChihChengLiang marked this conversation as resolved.
Show resolved Hide resolved
f"Genesis time will be {humanize_seconds(genesis_time-int(time.time()))} from now"
"Genesis time will be %s from now",
humanize_seconds(genesis_time - int(time.time())),
)
state = state.copy(
genesis_time=genesis_time,
Expand Down