mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 11:27:28 -03:00
rpc: move-only: move ScriptPubKeyDoc to utils
This commit is contained in:
parent
25dacae9c7
commit
25fe087de5
3 changed files with 13 additions and 11 deletions
|
@ -82,17 +82,6 @@ static void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue&
|
|||
}
|
||||
}
|
||||
|
||||
static std::vector<RPCResult> 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<RPCResult> DecodeTxDoc(const std::string& txid_field_doc)
|
||||
{
|
||||
return {
|
||||
|
|
|
@ -1404,3 +1404,14 @@ void PushWarnings(const std::vector<bilingual_str>& warnings, UniValue& obj)
|
|||
if (warnings.empty()) return;
|
||||
obj.pushKV("warnings", BilingualStringsToUniValue(warnings));
|
||||
}
|
||||
|
||||
std::vector<RPCResult> 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() + ")"},
|
||||
};
|
||||
}
|
||||
|
|
|
@ -512,4 +512,6 @@ private:
|
|||
void PushWarnings(const UniValue& warnings, UniValue& obj);
|
||||
void PushWarnings(const std::vector<bilingual_str>& warnings, UniValue& obj);
|
||||
|
||||
std::vector<RPCResult> ScriptPubKeyDoc();
|
||||
|
||||
#endif // BITCOIN_RPC_UTIL_H
|
||||
|
|
Loading…
Reference in a new issue