Passing --no-registry correctly to characters' config

pull/1175/head
David Núñez 2019-07-31 14:41:30 +02:00
parent b1ef98fe34
commit 23d84ae22b
6 changed files with 18 additions and 5 deletions

View File

@ -134,12 +134,13 @@ def alice(click_config,
blockchain.connect(sync_now=sync, fetch_registry=False)
pay_with = select_client_account(emitter=emitter, blockchain=blockchain)
download_registry = not federated_only and not click_config.no_registry
new_alice_config = AliceConfiguration.generate(password=get_nucypher_password(confirm=True),
config_root=config_root,
checksum_address=pay_with,
domains={network} if network else None,
federated_only=federated_only,
download_registry=click_config.no_registry,
download_registry=download_registry,
registry_filepath=registry_filepath,
provider_process=ETH_NODE,
poa=poa,

View File

@ -89,12 +89,13 @@ def bob(click_config,
blockchain.connect()
checksum_address = select_client_account(emitter=emitter, blockchain=blockchain)
download_registry = not federated_only and not click_config.no_registry
new_bob_config = BobConfiguration.generate(password=get_nucypher_password(confirm=True),
config_root=config_root or DEFAULT_CONFIG_ROOT,
checksum_address=checksum_address,
domains={network} if network else None,
federated_only=federated_only,
download_registry=click_config.no_registry,
download_registry=download_registry,
registry_filepath=registry_filepath,
provider_uri=provider_uri)

View File

@ -178,6 +178,7 @@ def ursula(click_config,
if not rest_host:
rest_host = actions.determine_external_ip_address(emitter, force=force)
download_registry = not federated_only and not click_config.no_registry
ursula_config = UrsulaConfiguration.generate(password=get_nucypher_password(confirm=True),
config_root=config_root,
rest_host=rest_host,
@ -187,7 +188,7 @@ def ursula(click_config,
federated_only=federated_only,
checksum_address=staker_address,
worker_address=worker_address,
download_registry=federated_only or click_config.no_registry,
download_registry=download_registry,
registry_filepath=registry_filepath,
provider_process=ETH_NODE,
provider_uri=provider_uri,

View File

@ -109,6 +109,7 @@ def test_cli_lifecycle(click_runner,
alice_init_args += ('--federated-only', )
else:
alice_init_args += ('--provider', TEST_PROVIDER_URI,
'--no-registry',
'--pay-with', testerchain.alice_account)
alice_init_response = click_runner.invoke(nucypher_cli, alice_init_args, catch_exceptions=False, env=envvars)
@ -144,6 +145,7 @@ def test_cli_lifecycle(click_runner,
bob_init_args += ('--federated-only', )
else:
bob_init_args += ('--provider', TEST_PROVIDER_URI,
'--no-registry',
'--checksum-address', testerchain.bob_account)
bob_init_response = click_runner.invoke(nucypher_cli, bob_init_args, catch_exceptions=False, env=envvars)

View File

@ -84,7 +84,8 @@ def test_coexisting_configurations(click_runner,
'--network', TEMPORARY_DOMAIN,
'--provider', TEST_PROVIDER_URI,
'--checksum-address', felix,
'--registry-filepath', mock_primary_registry_filepath
'--registry-filepath', mock_primary_registry_filepath,
'--no-registry'
)
result = click_runner.invoke(nucypher_cli, felix_init_args, catch_exceptions=False, env=envvars)
@ -102,6 +103,7 @@ def test_coexisting_configurations(click_runner,
'--provider', TEST_PROVIDER_URI,
'--pay-with', alice,
'--registry-filepath', mock_primary_registry_filepath,
'--no-registry',
'--config-root', custom_filepath)
result = click_runner.invoke(nucypher_cli, alice_init_args, catch_exceptions=False, env=envvars)
@ -120,6 +122,7 @@ def test_coexisting_configurations(click_runner,
'--staker-address', staker,
'--rest-host', MOCK_IP_ADDRESS,
'--registry-filepath', mock_primary_registry_filepath,
'--no-registry',
'--config-root', custom_filepath)
result = click_runner.invoke(nucypher_cli, init_args, catch_exceptions=False, env=envvars)
@ -138,6 +141,7 @@ def test_coexisting_configurations(click_runner,
'--staker-address', staker,
'--rest-host', MOCK_IP_ADDRESS_2,
'--registry-filepath', mock_primary_registry_filepath,
'--no-registry',
'--provider', TEST_PROVIDER_URI,
'--config-root', custom_filepath)
@ -217,7 +221,9 @@ def test_corrupted_configuration(click_runner, custom_filepath, testerchain, moc
'--staker-address', staker,
'--network', TEMPORARY_DOMAIN,
'--rest-host', MOCK_IP_ADDRESS,
'--config-root', custom_filepath)
'--config-root', custom_filepath,
'--no-registry',
)
# Fails because password is too short and the command uses incomplete args (needs either -F or blockchain details)
envvars = {'NUCYPHER_KEYRING_PASSWORD': ''}
@ -244,6 +250,7 @@ def test_corrupted_configuration(click_runner, custom_filepath, testerchain, moc
'--staker-address', staker,
'--rest-host', MOCK_IP_ADDRESS,
'--registry-filepath', mock_primary_registry_filepath,
'--no-registry',
'--config-root', custom_filepath)
envvars = {'NUCYPHER_KEYRING_PASSWORD': INSECURE_DEVELOPMENT_PASSWORD}

View File

@ -258,6 +258,7 @@ def test_ursula_init(click_runner,
'--config-root', custom_filepath,
'--provider', TEST_PROVIDER_URI,
'--registry-filepath', mock_registry_filepath,
'--no-registry',
'--rest-host', MOCK_IP_ADDRESS,
'--rest-port', MOCK_URSULA_STARTING_PORT)