diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-01-27 09:26:29 +0000 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-01-27 09:26:29 +0000 |
commit | 7a820cee0e6408f5848799011d82dd29ee7fa8c5 (patch) | |
tree | a840e2cbc6c62ffd43e7a51e99b2163c31cd6425 /src/test/script_tests.cpp | |
parent | 835212cd1d8f8fc7f19775f5ff8cc21c099122b2 (diff) |
test, build: Separate `read_json` function into its own module
Diffstat (limited to 'src/test/script_tests.cpp')
-rw-r--r-- | src/test/script_tests.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index d4cede8f7c..22f6cfd164 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -15,6 +15,7 @@ #include <script/sign.h> #include <script/signingprovider.h> #include <streams.h> +#include <test/util/json.h> #include <test/util/setup_common.h> #include <test/util/transaction_utils.h> #include <util/strencodings.h> @@ -41,18 +42,6 @@ static const unsigned int gFlags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC; unsigned int ParseScriptFlags(std::string strFlags); std::string FormatScriptFlags(unsigned int flags); -UniValue read_json(const std::string& jsondata) -{ - UniValue v; - - if (!v.read(jsondata) || !v.isArray()) - { - BOOST_ERROR("Parse error."); - return UniValue(UniValue::VARR); - } - return v.get_array(); -} - struct ScriptErrorDesc { ScriptError_t err; |