Example #1
0
def test_project_directory_properties(project_dir):
    project = Project()

    contracts_dir = get_contracts_dir(project_dir)
    assert is_same_path(project.contracts_dir, contracts_dir)

    build_dir = get_build_dir(project_dir)
    assert is_same_path(project.build_dir, build_dir)

    compiled_contracts_file_path = get_compiled_contracts_file_path(
        project_dir)
    assert is_same_path(project.compiled_contracts_file_path,
                        compiled_contracts_file_path)

    blockchains_dir = get_blockchains_dir(project_dir)
    assert is_same_path(project.blockchains_dir, blockchains_dir)

    data_dir = get_data_dir(project_dir, 'some-test-chain-name')
    assert is_same_path(
        project.get_blockchain_data_dir('some-test-chain-name'), data_dir)

    chaindata_dir = get_chaindata_dir(data_dir)
    assert is_same_path(
        project.get_blockchain_chaindata_dir('some-test-chain-name'),
        chaindata_dir)

    geth_ipc_path = get_geth_ipc_path(data_dir)
    assert is_same_path(
        project.get_blockchain_ipc_path('some-test-chain-name'), geth_ipc_path)
Example #2
0
def write_compiled_sources(project_dir, compiled_sources):
    compiled_contract_path = get_compiled_contracts_file_path(project_dir)

    with open(compiled_contract_path, 'w') as outfile:
        outfile.write(
            json.dumps(compiled_sources,
                       sort_keys=True,
                       indent=4,
                       separators=(',', ': ')))
    return compiled_contract_path
Example #3
0
def write_compiled_sources(project_dir, compiled_sources):
    compiled_contract_path = get_compiled_contracts_file_path(project_dir)

    with open(compiled_contract_path, 'w') as outfile:
        outfile.write(
            json.dumps(compiled_sources,
                       sort_keys=True,
                       indent=4,
                       separators=(',', ': '))
        )
    return compiled_contract_path
def test_project_directory_properties(project_dir):
    project = Project()

    contracts_dir = get_contracts_dir(project_dir)
    assert is_same_path(project.contracts_dir, contracts_dir)

    build_dir = get_build_dir(project_dir)
    assert is_same_path(project.build_dir, build_dir)

    compiled_contracts_file_path = get_compiled_contracts_file_path(project_dir)
    assert is_same_path(project.compiled_contracts_file_path, compiled_contracts_file_path)

    blockchains_dir = get_blockchains_dir(project_dir)
    assert is_same_path(project.blockchains_dir, blockchains_dir)

    data_dir = get_data_dir(project_dir, "some-test-chain-name")
    assert is_same_path(project.get_blockchain_data_dir("some-test-chain-name"), data_dir)

    chaindata_dir = get_chaindata_dir(data_dir)
    assert is_same_path(project.get_blockchain_chaindata_dir("some-test-chain-name"), chaindata_dir)

    geth_ipc_path = get_geth_ipc_path(data_dir)
    assert is_same_path(project.get_blockchain_ipc_path("some-test-chain-name"), geth_ipc_path)
Example #5
0
 def compiled_contracts_file_path(self):
     return get_compiled_contracts_file_path(self.project_dir)