Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Merge branch 'main' into gyani/lint
Browse files Browse the repository at this point in the history
  • Loading branch information
h4ck3rk3y committed Sep 26, 2023
2 parents 9aeb034 + 1e1e9ce commit ed2db7c
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -87,26 +87,27 @@ def get_args_with_default_values(args):


def parse_input(input_args):
result = default_input_args()
for attr in input_args:
value = input_args[attr]
# if its insterted we use the value inserted
if attr not in ATTR_TO_BE_SKIPPED_AT_ROOT and attr in input_args:
result[attr] = value
elif attr == "network_params":
for sub_attr in input_args["network_params"]:
sub_value = input_args["network_params"][sub_attr]
result["network_params"][sub_attr] = sub_value
elif attr == "participants":
participants = []
for participant in input_args["participants"]:
new_participant = default_participant()
for sub_attr, sub_value in participant.items():
# if the value is set in input we set it in participant
new_participant[sub_attr] = sub_value
for _ in range(0, new_participant["count"]):
participants.append(new_participant)
result["participants"] = participants
result = default_input_args()
for attr in input_args:
value = input_args[attr]
# if its insterted we use the value inserted
if attr not in ATTR_TO_BE_SKIPPED_AT_ROOT and attr in input_args:
result[attr] = value
elif attr == "network_params":
for sub_attr in input_args["network_params"]:
sub_value = input_args["network_params"][sub_attr]
result["network_params"][sub_attr] = sub_value
elif attr == "participants":
participants = []
for participant in input_args["participants"]:
new_participant = default_participant()
for sub_attr, sub_value in participant.items():
# if the value is set in input we set it in participant
new_participant[sub_attr] = sub_value
for _ in range(0, new_participant["count"]):
participant_copy = deep_copy_participant(new_participant)
participants.append(participant_copy)
result["participants"] = participants

total_participant_count = 0
actual_num_validators = 0
Expand Down

0 comments on commit ed2db7c

Please sign in to comment.