From e75be2da2fe7d88f3df8f3483659c2f03a8e10f9 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Thu, 15 May 2025 15:38:38 +0000 Subject: [PATCH] refactor: Move ExecutionReportStore to lib_spark From lib_binance_execution --- .../binance_execution/cross_margin/cross_margin_gateway.cpp | 3 ++- .../binance_execution/spots/spots_gateway.cpp | 4 ++-- .../binance_execution/usds_futures/usds_futures_gateway.cpp | 3 ++- .../orderman/orderman_utils}/execution_report_store.cpp | 4 ++-- .../spark/orderman/orderman_utils}/execution_report_store.h | 6 ++---- 5 files changed, 10 insertions(+), 10 deletions(-) rename src/{lib_binance_execution/binance_execution => lib_spark/spark/orderman/orderman_utils}/execution_report_store.cpp (98%) rename src/{lib_binance_execution/binance_execution => lib_spark/spark/orderman/orderman_utils}/execution_report_store.h (96%) diff --git a/src/lib_binance_execution/binance_execution/cross_margin/cross_margin_gateway.cpp b/src/lib_binance_execution/binance_execution/cross_margin/cross_margin_gateway.cpp index 3cf8a6a7f..3139e685e 100644 --- a/src/lib_binance_execution/binance_execution/cross_margin/cross_margin_gateway.cpp +++ b/src/lib_binance_execution/binance_execution/cross_margin/cross_margin_gateway.cpp @@ -4,7 +4,6 @@ #include "binance_execution/cross_margin/rest_api_client.h" #include "binance_execution/cross_margin/side_effect_type.h" #include "binance_execution/cross_margin/trade_data_stream/trade_data_subscription.h" -#include "binance_execution/execution_report_store.h" #include "binance_execution/gateway_config.h" #include "binance_execution/listen_key_requestor.h" #include "binance_execution/order_key_map.h" @@ -28,6 +27,7 @@ #include "spark/orderman/events/NewSecuritiesEvent.h" #include "spark/orderman/orderman_utils/ExchangePosition.h" #include "spark/orderman/orderman_utils/ExecutionReport.h" +#include "spark/orderman/orderman_utils/execution_report_store.h" #include "spark/orderman/orderman_utils/orderman_common.h" #include "spark/utils/overloaded.h" @@ -60,6 +60,7 @@ using bts::orderman::CancelOrderMsg; using bts::orderman::CancelReplaceOrderMsg; using bts::orderman::CreateOrderMsg; using bts::orderman::ExecutionReport; +using bts::orderman::ExecutionReportStore; using bts::orderman::NewAdminDataEvent; using bts::orderman::NewSecuritiesEvent; using bts::orderman::OrderMsg; diff --git a/src/lib_binance_execution/binance_execution/spots/spots_gateway.cpp b/src/lib_binance_execution/binance_execution/spots/spots_gateway.cpp index 6f081da46..8690f4976 100644 --- a/src/lib_binance_execution/binance_execution/spots/spots_gateway.cpp +++ b/src/lib_binance_execution/binance_execution/spots/spots_gateway.cpp @@ -1,6 +1,5 @@ #include "spots_gateway.h" #include "binance_execution/enums/api_key_type.h" -#include "binance_execution/execution_report_store.h" #include "binance_execution/gateway_config.h" #include "binance_execution/listen_key_requestor.h" #include "binance_execution/order_key_map.h" @@ -42,6 +41,7 @@ #include "spark/orderman/log_messages/modify_order_log.h" #include "spark/orderman/orderman_utils/ExchangePosition.h" #include "spark/orderman/orderman_utils/ExecutionReport.h" +#include "spark/orderman/orderman_utils/execution_report_store.h" #include "spark/orderman/orderman_utils/orderman_common.h" #include "spark/utils/Delegate.h" #include "spark/utils/Uuid.h" @@ -149,7 +149,7 @@ struct SpotsGateway::PImpl { ExecutionGatewayCallbacks callbacks; bts::orderman::ExchangePosition pos; bts::api::admin::BTSAccount account; - ExecutionReportStore orders; + bts::orderman::ExecutionReportStore orders; tuple &> build_request( const string &method) { diff --git a/src/lib_binance_execution/binance_execution/usds_futures/usds_futures_gateway.cpp b/src/lib_binance_execution/binance_execution/usds_futures/usds_futures_gateway.cpp index 07b210555..e954f2ec2 100644 --- a/src/lib_binance_execution/binance_execution/usds_futures/usds_futures_gateway.cpp +++ b/src/lib_binance_execution/binance_execution/usds_futures/usds_futures_gateway.cpp @@ -1,7 +1,6 @@ #include "usds_futures_gateway.h" #include "binance_execution/enums/order_status.h" #include "binance_execution/enums/time_in_force.h" -#include "binance_execution/execution_report_store.h" #include "binance_execution/gateway_config.h" #include "binance_execution/listen_key_requestor.h" #include "binance_execution/position_calculator.h" @@ -46,6 +45,7 @@ #include "spark/orderman/log_messages/modify_order_log.h" #include "spark/orderman/orderman_utils/ExchangePosition.h" #include "spark/orderman/orderman_utils/ExecutionReport.h" +#include "spark/orderman/orderman_utils/execution_report_store.h" #include "spark/orderman/orderman_utils/orderman_common.h" #include "spark/utils/Uuid.h" #include "spark/utils/bts_lock_guard.h" @@ -112,6 +112,7 @@ using bts::orderman::CancelOrderMsg; using bts::orderman::CancelReplaceOrderMsg; using bts::orderman::CreateOrderMsg; using bts::orderman::ExecutionReport; +using bts::orderman::ExecutionReportStore; using bts::orderman::NewAdminDataEvent; using bts::orderman::NewSecuritiesEvent; using bts::orderman::OrderKey; diff --git a/src/lib_binance_execution/binance_execution/execution_report_store.cpp b/src/lib_spark/spark/orderman/orderman_utils/execution_report_store.cpp similarity index 98% rename from src/lib_binance_execution/binance_execution/execution_report_store.cpp rename to src/lib_spark/spark/orderman/orderman_utils/execution_report_store.cpp index d64af0823..30b00cc3a 100644 --- a/src/lib_binance_execution/binance_execution/execution_report_store.cpp +++ b/src/lib_spark/spark/orderman/orderman_utils/execution_report_store.cpp @@ -6,7 +6,7 @@ #include -namespace binance_execution { +namespace bts::orderman { using bts::orderman::ExecutionReport; using std::uint64_t; @@ -82,4 +82,4 @@ std::shared_ptr ExecutionReportStore::set_error( return store.get_or_add(key, init); } -} // namespace binance_execution +} // namespace bts::orderman diff --git a/src/lib_binance_execution/binance_execution/execution_report_store.h b/src/lib_spark/spark/orderman/orderman_utils/execution_report_store.h similarity index 96% rename from src/lib_binance_execution/binance_execution/execution_report_store.h rename to src/lib_spark/spark/orderman/orderman_utils/execution_report_store.h index 43ab22005..3980ef83b 100644 --- a/src/lib_binance_execution/binance_execution/execution_report_store.h +++ b/src/lib_spark/spark/orderman/orderman_utils/execution_report_store.h @@ -15,11 +15,9 @@ class JetFIX_Connection; } namespace bts::orderman { + struct CreateOrderMsg; class ExecutionReport; -} // namespace bts::orderman - -namespace binance_execution { class ExecutionReportStore { std::string account; @@ -56,4 +54,4 @@ class ExecutionReportStore { bts::orderman::OrderKey key, const std::string &error); }; -} // namespace binance_execution +} // namespace bts::orderman