Exemplo n.º 1
0
def rotkehlchen_api_server(
        uninitialized_rotkehlchen,
        database,
        api_port,
        blockchain,
        accountant,
        start_with_logged_in_user,
        start_with_valid_premium,
        function_scope_messages_aggregator,
        db_password,
        rotki_premium_credentials,
        accounting_data_dir,
        username,
        etherscan,
):
    """A partially mocked rotkehlchen server instance"""

    api_server = create_api_server(rotki=uninitialized_rotkehlchen, port_number=api_port)

    initialize_mock_rotkehlchen_instance(
        rotki=api_server.rest_api.rotkehlchen,
        start_with_logged_in_user=start_with_logged_in_user,
        start_with_valid_premium=start_with_valid_premium,
        msg_aggregator=function_scope_messages_aggregator,
        accountant=accountant,
        blockchain=blockchain,
        db_password=db_password,
        rotki_premium_credentials=rotki_premium_credentials,
        data_dir=accounting_data_dir,
        database=database,
        username=username,
        etherscan=etherscan,
    )
    return api_server
Exemplo n.º 2
0
def fixture_rotkehlchen_api_server(
    uninitialized_rotkehlchen,
    api_port,
    start_with_logged_in_user,
    start_with_valid_premium,
    db_password,
    rotki_premium_credentials,
    username,
    blockchain_accounts,
    include_etherscan_key,
    include_cryptocompare_key,
    should_mock_price_queries,
    mocked_price_queries,
    ethereum_modules,
    db_settings,
    ignored_assets,
    tags,
    manually_tracked_balances,
    default_mock_price_value,
    ethereum_manager_connect_at_start,
    kusama_manager_connect_at_start,
    ethrpc_endpoint,
    ksm_rpc_endpoint,
    aave_use_graph,
    max_tasks_num,
):
    """A partially mocked rotkehlchen server instance"""

    api_server = create_api_server(rotki=uninitialized_rotkehlchen,
                                   port_number=api_port)

    initialize_mock_rotkehlchen_instance(
        rotki=api_server.rest_api.rotkehlchen,
        start_with_logged_in_user=start_with_logged_in_user,
        start_with_valid_premium=start_with_valid_premium,
        db_password=db_password,
        rotki_premium_credentials=rotki_premium_credentials,
        username=username,
        blockchain_accounts=blockchain_accounts,
        include_etherscan_key=include_etherscan_key,
        include_cryptocompare_key=include_cryptocompare_key,
        should_mock_price_queries=should_mock_price_queries,
        mocked_price_queries=mocked_price_queries,
        ethereum_modules=ethereum_modules,
        db_settings=db_settings,
        ignored_assets=ignored_assets,
        tags=tags,
        manually_tracked_balances=manually_tracked_balances,
        default_mock_price_value=default_mock_price_value,
        ethereum_manager_connect_at_start=ethereum_manager_connect_at_start,
        kusama_manager_connect_at_start=kusama_manager_connect_at_start,
        eth_rpc_endpoint=ethrpc_endpoint,
        ksm_rpc_endpoint=ksm_rpc_endpoint,
        aave_use_graph=aave_use_graph,
        max_tasks_num=max_tasks_num,
    )
    yield api_server
    api_server.stop()
Exemplo n.º 3
0
def rotkehlchen_api_server(
    uninitialized_rotkehlchen,
    api_port,
    start_with_logged_in_user,
    start_with_valid_premium,
    db_password,
    rotki_premium_credentials,
    username,
    blockchain_accounts,
    owned_eth_tokens,
    include_etherscan_key,
    include_cryptocompare_key,
    should_mock_price_queries,
    mocked_price_queries,
    ethereum_modules,
    db_settings,
    ignored_assets,
    tags,
    manually_tracked_balances,
    default_mock_price_value,
):
    """A partially mocked rotkehlchen server instance"""

    api_server = create_api_server(rotki=uninitialized_rotkehlchen,
                                   port_number=api_port)

    initialize_mock_rotkehlchen_instance(
        rotki=api_server.rest_api.rotkehlchen,
        start_with_logged_in_user=start_with_logged_in_user,
        start_with_valid_premium=start_with_valid_premium,
        db_password=db_password,
        rotki_premium_credentials=rotki_premium_credentials,
        username=username,
        blockchain_accounts=blockchain_accounts,
        owned_eth_tokens=owned_eth_tokens,
        include_etherscan_key=include_etherscan_key,
        include_cryptocompare_key=include_cryptocompare_key,
        should_mock_price_queries=should_mock_price_queries,
        mocked_price_queries=mocked_price_queries,
        ethereum_modules=ethereum_modules,
        db_settings=db_settings,
        ignored_assets=ignored_assets,
        tags=tags,
        manually_tracked_balances=manually_tracked_balances,
        default_mock_price_value=default_mock_price_value,
    )
    return api_server
Exemplo n.º 4
0
def fixture_rotkehlchen_api_server(
    uninitialized_rotkehlchen,
    rest_api_port,
    websockets_api_port,
    start_with_logged_in_user,
    start_with_valid_premium,
    db_password,
    rotki_premium_credentials,
    username,
    blockchain_accounts,
    include_etherscan_key,
    include_cryptocompare_key,
    should_mock_price_queries,
    mocked_price_queries,
    ethereum_modules,
    db_settings,
    ignored_assets,
    tags,
    manually_tracked_balances,
    default_mock_price_value,
    ethereum_manager_connect_at_start,
    kusama_manager_connect_at_start,
    ethrpc_endpoint,
    ksm_rpc_endpoint,
    aave_use_graph,
    max_tasks_num,
    legacy_messages_via_websockets,
    data_migration_version,
    use_custom_database,
    user_data_dir,
    perform_migrations_at_unlock,
    perform_upgrades_at_unlock,
):
    """A partially mocked rotkehlchen server instance"""

    api_server = create_api_server(
        rotki=uninitialized_rotkehlchen,
        rest_port_number=rest_api_port,
        websockets_port_number=websockets_api_port,
    )

    initialize_mock_rotkehlchen_instance(
        rotki=api_server.rest_api.rotkehlchen,
        start_with_logged_in_user=start_with_logged_in_user,
        start_with_valid_premium=start_with_valid_premium,
        db_password=db_password,
        rotki_premium_credentials=rotki_premium_credentials,
        username=username,
        blockchain_accounts=blockchain_accounts,
        include_etherscan_key=include_etherscan_key,
        include_cryptocompare_key=include_cryptocompare_key,
        should_mock_price_queries=should_mock_price_queries,
        mocked_price_queries=mocked_price_queries,
        ethereum_modules=ethereum_modules,
        db_settings=db_settings,
        ignored_assets=ignored_assets,
        tags=tags,
        manually_tracked_balances=manually_tracked_balances,
        default_mock_price_value=default_mock_price_value,
        ethereum_manager_connect_at_start=ethereum_manager_connect_at_start,
        kusama_manager_connect_at_start=kusama_manager_connect_at_start,
        eth_rpc_endpoint=ethrpc_endpoint,
        ksm_rpc_endpoint=ksm_rpc_endpoint,
        aave_use_graph=aave_use_graph,
        max_tasks_num=max_tasks_num,
        legacy_messages_via_websockets=legacy_messages_via_websockets,
        data_migration_version=data_migration_version,
        use_custom_database=use_custom_database,
        user_data_dir=user_data_dir,
        perform_migrations_at_unlock=perform_migrations_at_unlock,
        perform_upgrades_at_unlock=perform_upgrades_at_unlock,
    )
    yield api_server
    api_server.stop()