Merge pull request #61 from ethereum/hwwhww/network-selection

Add network (chain) name selection to prompt
This commit is contained in:
Hsiao-Wei Wang 2020-07-28 00:46:28 +08:00 committed by GitHub
commit 55b89503f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 2 deletions

View File

@ -70,6 +70,7 @@ def check_python_version() -> None:
)
@click.option(
'--chain',
prompt='Please choose the (mainnet or testnet) network/chain name',
type=click.Choice(ALL_CHAINS.keys(), case_sensitive=False),
default=MAINNET,
)

View File

@ -5,7 +5,7 @@ class BaseChainSetting(NamedTuple):
GENESIS_FORK_VERSION: bytes
# Eth2 Mainet setting
# Eth2 Mainnet setting
MainnetSetting = BaseChainSetting(GENESIS_FORK_VERSION=bytes.fromhex('00000000'))
# Eth2 spec v0.11.3 testnet
WittiSetting = BaseChainSetting(GENESIS_FORK_VERSION=bytes.fromhex('00000113'))

View File

@ -27,6 +27,7 @@ async def main():
run_script_cmd,
'--num_validators', '1',
'--mnemonic_language', 'english',
'--chain', 'mainnet',
'--password', 'MyPassword',
'--folder', my_folder_path,
]

View File

@ -41,7 +41,7 @@ def test_deposit(monkeypatch) -> None:
os.mkdir(my_folder_path)
runner = CliRunner()
inputs = ['5', 'english', 'MyPassword', 'MyPassword', 'fakephrase']
inputs = ['5', 'english', 'mainnet', 'MyPassword', 'MyPassword', 'fakephrase']
data = '\n'.join(inputs)
result = runner.invoke(main, ['--folder', my_folder_path], input=data)
@ -87,6 +87,7 @@ async def test_script() -> None:
run_script_cmd,
'--num_validators', '1',
'--mnemonic_language', 'english',
'--chain', 'mainnet',
'--password', 'MyPassword',
'--folder', my_folder_path,
]