11#pragma once
22#include < array>
3+ #include < cstdint>
34
45#include " aos/converters/tickers_to_trading_pair/converter.h"
56#include " aos/market_type/market_type.h"
67#include " aos/trading_pair/trading_pair.h"
78
89namespace aos {
910
10- enum class ActionType { Buy, Sell };
11+ enum class ActionType : uint8_t { kBuy , kSell };
1112
1213struct Action {
1314 ActionType action_type;
@@ -17,11 +18,11 @@ struct Action {
1718
1819namespace spot {
1920inline Action Buy (TradingPair trading_pair) {
20- return Action{ActionType::Buy , MarketType::Spot , trading_pair};
21+ return Action{ActionType::kBuy , MarketType::kSpot , trading_pair};
2122}
2223
2324inline Action Sell (TradingPair trading_pair) {
24- return Action{ActionType::Sell , MarketType::Spot , trading_pair};
25+ return Action{ActionType::kSell , MarketType::kSpot , trading_pair};
2526}
2627} // namespace spot
2728
@@ -49,9 +50,9 @@ class fmt::formatter<aos::Action> {
4950 template <typename Context>
5051 constexpr auto format (const aos::Action& foo, Context& ctx) const {
5152 auto action_type = foo.action_type ;
52- std::string actionStr =
53- (action_type == aos::ActionType::Buy ? " BUY" : " SELL" );
54- return fmt::format_to (ctx.out (), " {} {} on {}" , actionStr ,
53+ std::string action_str =
54+ (action_type == aos::ActionType::kBuy ? " BUY" : " SELL" );
55+ return fmt::format_to (ctx.out (), " {} {} on {}" , action_str ,
5556 foo.trading_pair , foo.market_type );
5657 }
5758};
0 commit comments