Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
KahanMajmudar committed Nov 20, 2024
1 parent 939415b commit 8b3a4f8
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ def input_with_default_value(prompt: str, default_value: str) -> str:

def input_select_chain(options: t.List[ChainType]):
"""Chose a single option from the offered ones"""
user_input = input(
f"Chose one of the following options {[option.name for option in options]}: "
user_input = input_with_default_value(
f"Chose one of the following options {[option.name for option in options]}", "GNOSIS"
)
try:
return ChainType.from_string(user_input.upper())
Expand Down Expand Up @@ -323,6 +323,21 @@ def get_local_config() -> MechQuickstartConfig:
mech_quickstart_config.gnosis_rpc = input(
f"Please enter a {ChainType.from_id(mech_quickstart_config.home_chain_id).name} RPC URL: "
)

if mech_quickstart_config.mech_hash is None:
mech_hash = (
input(
f"Do you want to set the mech_hash dict(set to {DEFAULT_MECH_HASH})? (y/n): "
).lower()
== "y"
)
if mech_hash:
while True:
user_input = input(f"Please enter the mech_hash: ")
mech_quickstart_config.mech_hash = user_input
break
else:
mech_quickstart_config.mech_hash = DEFAULT_MECH_HASH

if mech_quickstart_config.password_migrated is None:
mech_quickstart_config.password_migrated = False
Expand Down Expand Up @@ -361,22 +376,6 @@ def get_local_config() -> MechQuickstartConfig:
DEFAULT_TOOLS_TO_PACKAGE_HASH
)

if mech_quickstart_config.mech_hash is None:
mech_hash = (
input(
f"Do you want to set the mech_hash dict(set to {DEFAULT_MECH_HASH})? (y/n): "
).lower()
== "y"
)
if mech_hash:
while True:
user_input = input(f"Please enter the mech_hash: ")
mech_quickstart_config.mech_hash = user_input
break
else:
mech_quickstart_config.mech_hash = DEFAULT_MECH_HASH


mech_quickstart_config.store()
return mech_quickstart_config

Expand Down

0 comments on commit 8b3a4f8

Please sign in to comment.