From 8ac80aca80f392db801e404b85c2e38e9b154140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=BA=C3=B1ez?= Date: Mon, 26 Aug 2019 22:40:13 +0200 Subject: [PATCH] Fix minor glitches of nucypher alice, nucypher bob, and nucypher-deploy --- nucypher/characters/control/serializers.py | 1 + nucypher/cli/characters/alice.py | 5 +++-- nucypher/cli/characters/bob.py | 5 +++-- nucypher/cli/deploy.py | 7 ++++--- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/nucypher/characters/control/serializers.py b/nucypher/characters/control/serializers.py index 829fa0756..99c854dfa 100644 --- a/nucypher/characters/control/serializers.py +++ b/nucypher/characters/control/serializers.py @@ -120,6 +120,7 @@ class AliceControlJSONSerializer(CharacterControlJSONSerializer, MessageHandlerM label=request['label'].encode(), m=request['m'], n=request['n'], + value=request['value'], expiration=maya.MayaDT.from_iso8601(iso8601_string=request['expiration'])) return parsed_input diff --git a/nucypher/cli/characters/alice.py b/nucypher/cli/characters/alice.py index ea759f5b0..10f671c72 100644 --- a/nucypher/cli/characters/alice.py +++ b/nucypher/cli/characters/alice.py @@ -1,8 +1,7 @@ import click from constant_sorrow.constants import NO_BLOCKCHAIN_CONNECTION -from nucypher.blockchain.eth.interfaces import BlockchainInterface -from nucypher.blockchain.eth.registry import BaseContractRegistry +from nucypher.blockchain.eth.interfaces import BlockchainInterfaceFactory from nucypher.characters.banners import ALICE_BANNER from nucypher.cli import actions, painting, types from nucypher.cli.actions import get_nucypher_password, select_client_account, get_client_password @@ -125,6 +124,8 @@ def alice(click_config, ETH_NODE = actions.get_provider_process() provider_uri = ETH_NODE.provider_uri(scheme='file') + BlockchainInterfaceFactory.initialize_interface(provider_uri=provider_uri, poa=poa, sync=sync) + # # Eager Actions (No Authentication Required) # diff --git a/nucypher/cli/characters/bob.py b/nucypher/cli/characters/bob.py index 363dd41c8..b95edc12c 100644 --- a/nucypher/cli/characters/bob.py +++ b/nucypher/cli/characters/bob.py @@ -1,7 +1,6 @@ import click -from nucypher.blockchain.eth.interfaces import BlockchainInterface -from nucypher.blockchain.eth.registry import BaseContractRegistry +from nucypher.blockchain.eth.interfaces import BlockchainInterfaceFactory from nucypher.characters.banners import BOB_BANNER from nucypher.cli import actions, painting from nucypher.cli.actions import get_nucypher_password, select_client_account @@ -86,6 +85,8 @@ def bob(click_config, # Eager Actions # + BlockchainInterfaceFactory.initialize_interface(provider_uri=provider_uri, poa=poa, sync=sync) + if action == 'init': """Create a brand-new persistent Bob""" diff --git a/nucypher/cli/deploy.py b/nucypher/cli/deploy.py index 1a4418929..4019589fb 100644 --- a/nucypher/cli/deploy.py +++ b/nucypher/cli/deploy.py @@ -81,7 +81,6 @@ def deploy(action, allocations Deploy pre-allocation contracts. upgrade Upgrade NuCypher existing proxy contract deployments. rollback Rollback a proxy contract's target. - status Echo owner information and bare contract metadata. transfer-tokens Transfer tokens to another address. transfer-ownership Transfer ownership of contracts to another address. """ @@ -120,11 +119,13 @@ def deploy(action, # Connect to Registry # + default_registry_filepath = os.path.join(DEFAULT_CONFIG_ROOT, BaseContractRegistry.REGISTRY_NAME) + # Establish a contract registry from disk if specified - registry_filepath = registry_outfile or registry_infile + registry_filepath = registry_outfile or registry_infile or default_registry_filepath if dev: # TODO: Need a way to detect a geth--dev registry filepath here. (then deprecate the --dev flag) - registry_filepath = os.path.join(DEFAULT_CONFIG_ROOT, 'dev_contract_registry.json') + registry_filepath = os.path.join(config_root, 'dev_contract_registry.json') registry = LocalContractRegistry(filepath=registry_filepath) emitter.echo(f"Using contract registry filepath {registry.filepath}")