From 7a31b025a2751af5655e723012ba4ea82ac8a77a Mon Sep 17 00:00:00 2001 From: John Colvin Date: Tue, 16 Aug 2022 16:21:33 -0400 Subject: [PATCH] refactor: Add 'ms' suffix to exch-open-order timestamp fields Just to make it clear that they are milliseconds (not nanos, micros, etc.) --- src/lib/api/services/OrderService.proto | 6 ++++-- src/lib/orderman/OrderServiceServer.cpp | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/api/services/OrderService.proto b/src/lib/api/services/OrderService.proto index 77dfbf2f6..5548d4b3e 100644 --- a/src/lib/api/services/OrderService.proto +++ b/src/lib/api/services/OrderService.proto @@ -740,8 +740,10 @@ message RetrievedExchangeOpenOrder{ double qty = 100; double filled_price = 110; double filled_qty = 120; - uint64 creation_timestamp = 130; - uint64 last_update_timestamp = 140; + // millis from unix epoch + uint64 creation_timestamp_ms = 130; + // millis from unix epoch + uint64 last_update_timestamp_ms = 140; bool api = 150; bool web = 160; } diff --git a/src/lib/orderman/OrderServiceServer.cpp b/src/lib/orderman/OrderServiceServer.cpp index 63931c9c5..38ca23e86 100644 --- a/src/lib/orderman/OrderServiceServer.cpp +++ b/src/lib/orderman/OrderServiceServer.cpp @@ -528,8 +528,8 @@ void OrderServiceServer::_on_exchange_open_orders( o_ord.set_qty(o.qty.full_value()); o_ord.set_filled_price(o.filled_price.value()); o_ord.set_filled_qty(o.filled_qty.full_value()); - o_ord.set_creation_timestamp(o.creation_timestamp); - o_ord.set_last_update_timestamp(o.last_update_timestamp); + o_ord.set_creation_timestamp_ms(o.creation_timestamp); + o_ord.set_last_update_timestamp_ms(o.last_update_timestamp); o_ord.set_api(o.api); o_ord.set_web(o.web); me->open_orders_publisher.add_or_update(o_ord);