Ensure allocation registry is passed onto test agency

pull/805/head
Kieran R. Prasch 2019-01-30 20:44:40 -08:00 committed by Kieran Prasch
parent 3818cef773
commit dceabd8d04
No known key found for this signature in database
GPG Key ID: 199AB839D4125A62
2 changed files with 6 additions and 1 deletions

View File

@ -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:'

View File

@ -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