From dceabd8d0433a33581ff6216bd02edf69af12dad Mon Sep 17 00:00:00 2001 From: "Kieran R. Prasch" Date: Wed, 30 Jan 2019 20:44:40 -0800 Subject: [PATCH] Ensure allocation registry is passed onto test agency --- nucypher/utilities/sandbox/constants.py | 3 +++ tests/cli/commands/test_deploy.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/nucypher/utilities/sandbox/constants.py b/nucypher/utilities/sandbox/constants.py index 2b98a41c3..4c0e126bd 100644 --- a/nucypher/utilities/sandbox/constants.py +++ b/nucypher/utilities/sandbox/constants.py @@ -93,6 +93,8 @@ TEMPORARY_DOMAIN = 'TEMPORARY_DOMAIN' MOCK_REGISTRY_FILEPATH = os.path.join(BASE_TEMP_DIR, f'{BASE_TEMP_PREFIX}mock-registry-{str(datetime.now())}.json') +TEMPORARY_DOMAIN = ':TEMPORARY_DOMAIN:' # for use with `--dev` node runtimes + GETH_DEV_URI = f'ipc://{BASE_TEMP_DIR}/geth.ipc' # Standard IPC path for `geth --dev` PYEVM_DEV_URI = "tester://pyevm" @@ -109,3 +111,4 @@ MOCK_IP_ADDRESS = '0.0.0.0' MOCK_IP_ADDRESS_2 = '10.10.10.10' MOCK_URSULA_DB_FILEPATH = ':memory:' + diff --git a/tests/cli/commands/test_deploy.py b/tests/cli/commands/test_deploy.py index f8b46589c..a9d86c1b5 100644 --- a/tests/cli/commands/test_deploy.py +++ b/tests/cli/commands/test_deploy.py @@ -2,6 +2,7 @@ import os from nucypher.blockchain.eth.agents import NucypherTokenAgent, MinerAgent, UserEscrowAgent from nucypher.blockchain.eth.constants import MAX_ALLOWED_LOCKED +from nucypher.blockchain.eth.registry import AllocationRegistry from nucypher.cli.deploy import deploy from nucypher.config.constants import DEFAULT_CONFIG_ROOT from nucypher.utilities.sandbox.constants import ( @@ -64,7 +65,8 @@ def test_nucypher_deploy_allocations(testerchain, click_runner, mock_allocation_ # ensure that a pre-allocation recipient has the allocated token quantity. beneficiary = testerchain.interface.w3.eth.accounts[-1] - user_escrow_agent = UserEscrowAgent(beneficiary=beneficiary) + allocation_registry = AllocationRegistry(registry_filepath=MOCK_ALLOCATION_REGISTRY_FILEPATH) + user_escrow_agent = UserEscrowAgent(beneficiary=beneficiary, allocation_registry=allocation_registry) assert user_escrow_agent.unvested_tokens == MAX_ALLOWED_LOCKED