| 405 | } |
| 406 | |
| 407 | void ScriptToUniv(const CScript& script, UniValue& out, bool include_hex, bool include_address, const SigningProvider* provider) |
| 408 | { |
| 409 | CTxDestination address; |
| 410 | |
| 411 | out.pushKV("asm", ScriptToAsmStr(script)); |
| 412 | if (include_address) { |
| 413 | out.pushKV("desc", InferDescriptor(script, provider ? *provider : DUMMY_SIGNING_PROVIDER)->ToString()); |
| 414 | } |
| 415 | if (include_hex) { |
| 416 | out.pushKV("hex", HexStr(script)); |
| 417 | } |
| 418 | |
| 419 | std::vector<std::vector<unsigned char>> solns; |
| 420 | const TxoutType type{Solver(script, solns)}; |
| 421 | |
| 422 | if (include_address && ExtractDestination(script, address) && type != TxoutType::PUBKEY) { |
| 423 | out.pushKV("address", EncodeDestination(address)); |
| 424 | } |
| 425 | out.pushKV("type", GetTxnOutputType(type)); |
| 426 | } |
| 427 | |
| 428 | void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry, bool include_hex, const CTxUndo* txundo, TxVerbosity verbosity, std::function<bool(const CTxOut&)> is_change_func) |
| 429 | { |
no test coverage detected