mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-02 15:32:34 +02:00
Move GetAllOutputTypes
function from rpc/rawtransaction.cpp
to rpc/util.{h|cpp}
This commit is contained in:
parent
3ce40e64d4
commit
d970a85d33
@ -542,16 +542,6 @@ static RPCHelpMan decoderawtransaction()
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string GetAllOutputTypes()
|
|
||||||
{
|
|
||||||
std::vector<std::string> ret;
|
|
||||||
using U = std::underlying_type<TxoutType>::type;
|
|
||||||
for (U i = (U)TxoutType::NONSTANDARD; i <= (U)TxoutType::WITNESS_UNKNOWN; ++i) {
|
|
||||||
ret.emplace_back(GetTxnOutputType(static_cast<TxoutType>(i)));
|
|
||||||
}
|
|
||||||
return Join(ret, ", ");
|
|
||||||
}
|
|
||||||
|
|
||||||
static RPCHelpMan decodescript()
|
static RPCHelpMan decodescript()
|
||||||
{
|
{
|
||||||
return RPCHelpMan{
|
return RPCHelpMan{
|
||||||
|
@ -21,6 +21,16 @@
|
|||||||
const std::string UNIX_EPOCH_TIME = "UNIX epoch time";
|
const std::string UNIX_EPOCH_TIME = "UNIX epoch time";
|
||||||
const std::string EXAMPLE_ADDRESS[2] = {"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl", "bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3"};
|
const std::string EXAMPLE_ADDRESS[2] = {"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl", "bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3"};
|
||||||
|
|
||||||
|
std::string GetAllOutputTypes()
|
||||||
|
{
|
||||||
|
std::vector<std::string> ret;
|
||||||
|
using U = std::underlying_type<TxoutType>::type;
|
||||||
|
for (U i = (U)TxoutType::NONSTANDARD; i <= (U)TxoutType::WITNESS_UNKNOWN; ++i) {
|
||||||
|
ret.emplace_back(GetTxnOutputType(static_cast<TxoutType>(i)));
|
||||||
|
}
|
||||||
|
return Join(ret, ", ");
|
||||||
|
}
|
||||||
|
|
||||||
void RPCTypeCheck(const UniValue& params,
|
void RPCTypeCheck(const UniValue& params,
|
||||||
const std::list<UniValueType>& typesExpected,
|
const std::list<UniValueType>& typesExpected,
|
||||||
bool fAllowNull)
|
bool fAllowNull)
|
||||||
|
@ -39,6 +39,13 @@ class CPubKey;
|
|||||||
class CScript;
|
class CScript;
|
||||||
struct Sections;
|
struct Sections;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets all existing output types formatted for RPC help sections.
|
||||||
|
*
|
||||||
|
* @return Comma separated string representing output type names.
|
||||||
|
*/
|
||||||
|
std::string GetAllOutputTypes();
|
||||||
|
|
||||||
/** Wrapper for UniValue::VType, which includes typeAny:
|
/** Wrapper for UniValue::VType, which includes typeAny:
|
||||||
* Used to denote don't care type. */
|
* Used to denote don't care type. */
|
||||||
struct UniValueType {
|
struct UniValueType {
|
||||||
|
Loading…
Reference in New Issue
Block a user