aboutsummaryrefslogtreecommitdiff
path: root/src/rest.cpp
diff options
context:
space:
mode:
authorstickies-v <stickies-v@protonmail.com>2022-01-27 21:20:05 +0000
committerstickies-v <stickies-v@protonmail.com>2022-03-10 11:24:15 +0100
commit9f1c54787c81177dd56a31c881a9ad2834a122dc (patch)
treee176b2645ecceec4774f2c768f3d88d694387b29 /src/rest.cpp
parent219d728fcbde8c313940788838afa46c2fb88762 (diff)
downloadbitcoin-9f1c54787c81177dd56a31c881a9ad2834a122dc.tar.xz
Refactoring: move declarations to rest.h
This facilitates unit testing
Diffstat (limited to 'src/rest.cpp')
-rw-r--r--src/rest.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/rest.cpp b/src/rest.cpp
index 063872b47a..418d4796be 100644
--- a/src/rest.cpp
+++ b/src/rest.cpp
@@ -3,6 +3,8 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#include <rest.h>
+
#include <blockfilter.h>
#include <chain.h>
#include <chainparams.h>
@@ -27,6 +29,7 @@
#include <version.h>
#include <any>
+#include <string>
#include <boost/algorithm/string.hpp>
@@ -40,13 +43,6 @@ using node::ReadBlockFromDisk;
static const size_t MAX_GETUTXOS_OUTPOINTS = 15; //allow a max of 15 outpoints to be queried at once
static constexpr unsigned int MAX_REST_HEADERS_RESULTS = 2000;
-enum class RetFormat {
- UNDEF,
- BINARY,
- HEX,
- JSON,
-};
-
static const struct {
RetFormat rf;
const char* name;
@@ -137,7 +133,7 @@ static ChainstateManager* GetChainman(const std::any& context, HTTPRequest* req)
return node_context->chainman.get();
}
-static RetFormat ParseDataFormat(std::string& param, const std::string& strReq)
+RetFormat ParseDataFormat(std::string& param, const std::string& strReq)
{
const std::string::size_type pos = strReq.rfind('.');
if (pos == std::string::npos)