Commit 4dd2ab9d authored by Gyanendra Mishra's avatar Gyanendra Mishra

enabled optional fields

parent 9ef5e2d6
......@@ -16,12 +16,26 @@ DEFAULT_CL_IMAGES = {
BESU_NODE_NAME = "besu"
NETHERMIND_NODE_NAME = "nethermind"
LAUNCH_ADDITIONAL_ATTR = "launch_additional_services"
def parse_input(input_args):
default_input = default_module_input()
result = {}
for attr in dir(input_args):
value = getattr(input_args, attr)
if type(value) == "int" and value == 0:
print(value, type(value), attr, type(attr))
# this is a builtin attribute we don't care about
if attr == "descriptor":
continue
# if there's an optional that exists don't change anything just move on
elif attr == LAUNCH_ADDITIONAL_ATTR:
if proto.has(input_args, LAUNCH_ADDITIONAL_ATTR):
result[attr] = value
else:
result[attr] = default_input[attr]
elif type(value) == "bool" and value == False:
result[attr] = default_input[attr]
elif type(value) == "int" and value == 0:
result[attr] = default_input[attr]
elif type(value) == "string" and value == "":
result[attr] = default_input[attr]
......@@ -128,7 +142,7 @@ def default_module_input():
return {
"participants": participants,
"network_params": network_params,
"dont_launch_additional_services": False,
LAUNCH_ADDITIONAL_ATTR: True,
"wait_for_finalization": False,
"wait_for_verifications": False,
"verifications_epoch_limit": 5,
......
......@@ -18,7 +18,7 @@ message ModuleInput {
// This is a hack - it's not very elegant - but this is a commonly-requested feature
// The longterm solution is making the module trivial to decompose so we don't need flags like this; we're working
// on this at the Kurtosis product level
bool dont_launch_additional_services = 3;
optional bool launch_additional_services = 3;
// If set, the module will block until a finalized epoch has occurred.
// If `waitForVerifications` is set to true, this extra wait will be skipped.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment