Skip to content

Commit

Permalink
fix a code cov issue by removing old code
Browse files Browse the repository at this point in the history
  • Loading branch information
andrlime committed Nov 29, 2023
1 parent ea55085 commit 722bd97
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 30 deletions.
13 changes: 0 additions & 13 deletions wrapper/src/pywrapper/pywrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,6 @@ get_trade_and_account_update_function()
return py::globals()["strategy"].attr("on_trade_and_account_update");

Check warning on line 33 in wrapper/src/pywrapper/pywrapper.cpp

View check run for this annotation

Codecov / codecov/patch

wrapper/src/pywrapper/pywrapper.cpp#L33

Added line #L33 was not covered by tests
}

// A tiny amount of backwards compatibility
const py::object
get_trade_update_function()
{
return py::globals()["strategy"].attr("on_trade_and_account_update");
}

const py::object
get_account_update_function()
{
return py::globals()["strategy"].attr("on_trade_and_account_update");
}

void
run_code_init(const std::string& py_code)
{
Expand Down
16 changes: 1 addition & 15 deletions wrapper/src/pywrapper/pywrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,7 @@ const py::object get_ob_update_function();
* Designed to be triggered by the rabbitmq class when a trade or account update is
* received
*/
const py::object get_on_trade_and_account_update();

/**
* @brief Gets the callback function for trade updates
*
* Some backwards compatibility, but returns on_trade_and_account_update()
*/
const py::object get_trade_update_function();

/**
* @brief Gets the callback function for account updates
*
* Some backwards compatibility, but returns on_trade_and_account_update()
*/
const py::object get_account_update_function();
const py::object get_trade_and_account_update_function();

/**
* @brief Creates the Python API module
Expand Down
4 changes: 2 additions & 2 deletions wrapper/src/rabbitmq/rabbitmq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ RabbitMQ::handleIncomingMessages()
Match match = std::get<Match>(data);
std::string side =
match.side == messages::SIDE::BUY ? "BUY" : "SELL";
nutc::pywrapper::get_trade_update_function()(
nutc::pywrapper::get_trade_and_account_update_function()(

Check warning on line 103 in wrapper/src/rabbitmq/rabbitmq.cpp

View check run for this annotation

Codecov / codecov/patch

wrapper/src/rabbitmq/rabbitmq.cpp#L103

Added line #L103 was not covered by tests
match.ticker, side, match.price, match.quantity
);
return nothing;
Expand All @@ -114,7 +114,7 @@ RabbitMQ::handleIncomingMessages()
);
std::string side =
update.side == messages::SIDE::BUY ? "BUY" : "SELL";
nutc::pywrapper::get_account_update_function()(
nutc::pywrapper::get_trade_and_account_update_function()(

Check warning on line 117 in wrapper/src/rabbitmq/rabbitmq.cpp

View check run for this annotation

Codecov / codecov/patch

wrapper/src/rabbitmq/rabbitmq.cpp#L117

Added line #L117 was not covered by tests
update.ticker,
side,
update.price,
Expand Down

0 comments on commit 722bd97

Please sign in to comment.