From 25fe087de59e967ce968d35ed77138325eb9a9fa Mon Sep 17 00:00:00 2001 From: James O'Beirne Date: Fri, 15 Nov 2024 13:58:53 -0500 Subject: [PATCH] rpc: move-only: move ScriptPubKeyDoc to utils --- src/rpc/rawtransaction.cpp | 11 ----------- src/rpc/util.cpp | 11 +++++++++++ src/rpc/util.h | 2 ++ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 65e6e40b0dc..8f20e61fae0 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -82,17 +82,6 @@ static void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& } } -static std::vector ScriptPubKeyDoc() { - return - { - {RPCResult::Type::STR, "asm", "Disassembly of the output script"}, - {RPCResult::Type::STR, "desc", "Inferred descriptor for the output"}, - {RPCResult::Type::STR_HEX, "hex", "The raw output script bytes, hex-encoded"}, - {RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"}, - {RPCResult::Type::STR, "type", "The type (one of: " + GetAllOutputTypes() + ")"}, - }; -} - static std::vector DecodeTxDoc(const std::string& txid_field_doc) { return { diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index d71d7d737b0..9a658e3f62d 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -1404,3 +1404,14 @@ void PushWarnings(const std::vector& warnings, UniValue& obj) if (warnings.empty()) return; obj.pushKV("warnings", BilingualStringsToUniValue(warnings)); } + +std::vector ScriptPubKeyDoc() { + return + { + {RPCResult::Type::STR, "asm", "Disassembly of the output script"}, + {RPCResult::Type::STR, "desc", "Inferred descriptor for the output"}, + {RPCResult::Type::STR_HEX, "hex", "The raw output script bytes, hex-encoded"}, + {RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"}, + {RPCResult::Type::STR, "type", "The type (one of: " + GetAllOutputTypes() + ")"}, + }; +} diff --git a/src/rpc/util.h b/src/rpc/util.h index b8e67597688..cd120ce2e2c 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -512,4 +512,6 @@ class RPCHelpMan void PushWarnings(const UniValue& warnings, UniValue& obj); void PushWarnings(const std::vector& warnings, UniValue& obj); +std::vector ScriptPubKeyDoc(); + #endif // BITCOIN_RPC_UTIL_H