From 1b1d21c79f46dd086d4835d9d1ae772657a26a62 Mon Sep 17 00:00:00 2001 From: "Kieran R. Prasch" Date: Tue, 9 Jun 2020 16:54:46 -0700 Subject: [PATCH] Allow a signer URI to be used when initializing a Bob via CLI. --- nucypher/cli/commands/bob.py | 1 + nucypher/cli/commands/ursula.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/nucypher/cli/commands/bob.py b/nucypher/cli/commands/bob.py index 53ed55637..0d1d87ec1 100644 --- a/nucypher/cli/commands/bob.py +++ b/nucypher/cli/commands/bob.py @@ -116,6 +116,7 @@ class BobConfigOptions: checksum_address = self.checksum_address if not checksum_address and not self.federated_only: checksum_address = select_client_account(emitter=emitter, + signer_uri=self.signer_uri, provider_uri=self.provider_uri) # TODO: See #1888 return BobConfiguration.generate( diff --git a/nucypher/cli/commands/ursula.py b/nucypher/cli/commands/ursula.py index 2e57d7f86..daf01c8dd 100644 --- a/nucypher/cli/commands/ursula.py +++ b/nucypher/cli/commands/ursula.py @@ -174,13 +174,17 @@ class UrsulaConfigOptions: def generate_config(self, emitter, config_root, force): - assert not self.dev # TODO: Raise instead + if self.dev: + raise RuntimeError('Persistent configurations cannot be created in development mode.') worker_address = self.worker_address if (not worker_address) and not self.federated_only: if not worker_address: prompt = "Select worker account" - worker_address = select_client_account(emitter=emitter, prompt=prompt, provider_uri=self.provider_uri, signer_uri=self.signer_uri) + worker_address = select_client_account(emitter=emitter, + prompt=prompt, + provider_uri=self.provider_uri, + signer_uri=self.signer_uri) rest_host = self.rest_host if not rest_host: @@ -258,8 +262,11 @@ class UrsulaCharacterOptions: def create_character(self, emitter, config_file, json_ipc, load_seednodes=True): + # TODO: embed compatibility layer? ursula_config = self.config_options.create_config(emitter, config_file) is_clef = ClefSigner.is_valid_clef_uri(self.config_options.signer_uri) + + # TODO: Oh client_password = None if not ursula_config.federated_only: if not self.config_options.dev and not json_ipc and not is_clef: