Update test contract compilation path

pull/2017/head
Kieran Prasch 2020-05-22 17:07:13 -07:00 committed by Kieran R. Prasch
parent 28cce2fccc
commit bb32d210a3
3 changed files with 11 additions and 7 deletions

View File

@ -20,6 +20,7 @@ import os
from nucypher.blockchain.eth.deployers import NucypherTokenDeployer
from nucypher.blockchain.eth.sol.compile import SolidityCompiler, SourceDirs
from tests.constants import TEST_CONTRACTS_DIR
from tests.utils.blockchain import TesterBlockchain
@ -37,7 +38,7 @@ def test_nucypher_contract_compiled(testerchain, test_registry):
def test_multi_source_compilation(testerchain):
solidity_compiler = SolidityCompiler(source_dirs=[
(SolidityCompiler.default_contract_dir(), None),
(SolidityCompiler.default_contract_dir(), {TesterBlockchain.TEST_CONTRACTS_DIR})
(SolidityCompiler.default_contract_dir(), {TEST_CONTRACTS_DIR})
])
interfaces = solidity_compiler.compile()

View File

@ -57,7 +57,7 @@ NUMBER_OF_MOCK_KEYSTORE_ACCOUNTS = NUMBER_OF_ETH_TEST_ACCOUNTS
# Testerchain
#
TEST_CONTRACTS_DIR = Path(BASE_DIR) / 'tests' / 'blockchain' / 'eth' / 'contracts' / 'contracts'
TEST_CONTRACTS_DIR = Path(BASE_DIR) / 'tests' / 'contracts' / 'contracts'
ONE_YEAR_IN_SECONDS = ((60 * 60) * 24) * 365

View File

@ -31,11 +31,15 @@ from nucypher.blockchain.eth.registry import InMemoryContractRegistry
from nucypher.blockchain.eth.sol.compile import SolidityCompiler
from nucypher.blockchain.eth.token import NU
from nucypher.blockchain.eth.utils import epoch_to_period
from nucypher.config.constants import BASE_DIR
from nucypher.crypto.powers import TransactingPower
from tests.constants import (DEVELOPMENT_ETH_AIRDROP_AMOUNT, INSECURE_DEVELOPMENT_PASSWORD,
NUMBER_OF_ETH_TEST_ACCOUNTS, NUMBER_OF_STAKERS_IN_BLOCKCHAIN_TESTS,
NUMBER_OF_URSULAS_IN_BLOCKCHAIN_TESTS)
from tests.constants import (
DEVELOPMENT_ETH_AIRDROP_AMOUNT,
INSECURE_DEVELOPMENT_PASSWORD,
NUMBER_OF_ETH_TEST_ACCOUNTS,
NUMBER_OF_STAKERS_IN_BLOCKCHAIN_TESTS,
NUMBER_OF_URSULAS_IN_BLOCKCHAIN_TESTS,
TEST_CONTRACTS_DIR
)
def token_airdrop(token_agent, amount: NU, origin: str, addresses: List[str]):
@ -73,7 +77,6 @@ class TesterBlockchain(BlockchainDeployerInterface):
'free': free_gas_price_strategy}
_PROVIDER_URI = 'tester://pyevm'
TEST_CONTRACTS_DIR = os.path.join(BASE_DIR, 'tests', 'blockchain', 'eth', 'contracts', 'contracts')
_compiler = SolidityCompiler(source_dirs=[(SolidityCompiler.default_contract_dir(), {TEST_CONTRACTS_DIR})])
_test_account_cache = list()