From 7a820cee0e6408f5848799011d82dd29ee7fa8c5 Mon Sep 17 00:00:00 2001
From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Date: Fri, 27 Jan 2023 09:26:29 +0000
Subject: test, build: Separate `read_json` function into its own module

---
 src/test/util/json.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 src/test/util/json.cpp

(limited to 'src/test/util/json.cpp')

diff --git a/src/test/util/json.cpp b/src/test/util/json.cpp
new file mode 100644
index 0000000000..ad3c346c84
--- /dev/null
+++ b/src/test/util/json.cpp
@@ -0,0 +1,17 @@
+// Copyright (c) 2023 The Bitcoin Core developers
+// Distributed under the MIT software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#include <test/util/json.h>
+
+#include <string>
+#include <util/check.h>
+
+#include <univalue.h>
+
+UniValue read_json(const std::string& jsondata)
+{
+    UniValue v;
+    Assert(v.read(jsondata) && v.isArray());
+    return v.get_array();
+}
-- 
cgit v1.2.3