Skip to content

Commit 25fe087

Browse files
committed
rpc: move-only: move ScriptPubKeyDoc to utils
1 parent 25dacae commit 25fe087

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,6 @@ static void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue&
8282
}
8383
}
8484

85-
static std::vector<RPCResult> ScriptPubKeyDoc() {
86-
return
87-
{
88-
{RPCResult::Type::STR, "asm", "Disassembly of the output script"},
89-
{RPCResult::Type::STR, "desc", "Inferred descriptor for the output"},
90-
{RPCResult::Type::STR_HEX, "hex", "The raw output script bytes, hex-encoded"},
91-
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},
92-
{RPCResult::Type::STR, "type", "The type (one of: " + GetAllOutputTypes() + ")"},
93-
};
94-
}
95-
9685
static std::vector<RPCResult> DecodeTxDoc(const std::string& txid_field_doc)
9786
{
9887
return {

src/rpc/util.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,3 +1404,14 @@ void PushWarnings(const std::vector<bilingual_str>& warnings, UniValue& obj)
14041404
if (warnings.empty()) return;
14051405
obj.pushKV("warnings", BilingualStringsToUniValue(warnings));
14061406
}
1407+
1408+
std::vector<RPCResult> ScriptPubKeyDoc() {
1409+
return
1410+
{
1411+
{RPCResult::Type::STR, "asm", "Disassembly of the output script"},
1412+
{RPCResult::Type::STR, "desc", "Inferred descriptor for the output"},
1413+
{RPCResult::Type::STR_HEX, "hex", "The raw output script bytes, hex-encoded"},
1414+
{RPCResult::Type::STR, "address", /*optional=*/true, "The Bitcoin address (only if a well-defined address exists)"},
1415+
{RPCResult::Type::STR, "type", "The type (one of: " + GetAllOutputTypes() + ")"},
1416+
};
1417+
}

src/rpc/util.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,4 +512,6 @@ class RPCHelpMan
512512
void PushWarnings(const UniValue& warnings, UniValue& obj);
513513
void PushWarnings(const std::vector<bilingual_str>& warnings, UniValue& obj);
514514

515+
std::vector<RPCResult> ScriptPubKeyDoc();
516+
515517
#endif // BITCOIN_RPC_UTIL_H

0 commit comments

Comments
 (0)