actually handle book_offers

This commit is contained in:
CJ Cobb
2021-01-27 10:19:48 -05:00
parent ae494e8ee1
commit 689f548fb7
2 changed files with 47 additions and 3 deletions

View File

@@ -35,13 +35,21 @@
#include <vector>
//------------------------------------------------------------------------------
enum RPCCommand { tx, account_tx, ledger, account_info, ledger_data };
enum RPCCommand {
tx,
account_tx,
ledger,
account_info,
ledger_data,
book_offers
};
std::unordered_map<std::string, RPCCommand> commandMap{
{"tx", tx},
{"account_tx", account_tx},
{"ledger", ledger},
{"account_info", account_info},
{"ledger_data", ledger_data}};
{"ledger_data", ledger_data},
{"book_offers", book_offers}};
boost::json::object
doAccountInfo(
@@ -62,6 +70,11 @@ boost::json::object
doLedgerData(
boost::json::object const& request,
CassandraFlatMapBackend const& backend);
boost::json::object
doBookOffers(
boost::json::object const& request,
CassandraFlatMapBackend const& backend,
std::shared_ptr<PgPool>& pgPool);
boost::json::object
buildResponse(
@@ -88,6 +101,9 @@ buildResponse(
case account_info:
return doAccountInfo(request, backend, pgPool);
break;
case book_offers:
return doBookOffers(request, backend, pgPool);
break;
default:
BOOST_LOG_TRIVIAL(error) << "Unknown command: " << command;
}