MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / TxOutsFromJSON

Function TxOutsFromJSON

src/test/fuzz/script_assets_test_minimizer.cpp:66–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66std::vector<CTxOut> TxOutsFromJSON(const UniValue& univalue)
67{
68 if (!univalue.isArray()) throw std::runtime_error("Prevouts must be array");
69 std::vector<CTxOut> prevouts;
70 for (size_t i = 0; i < univalue.size(); ++i) {
71 CTxOut txout;
72 try {
73 SpanReader{CheckedParseHex(univalue[i].get_str())} >> txout;
74 } catch (const std::ios_base::failure&) {
75 throw std::runtime_error("Prevout invalid format");
76 }
77 prevouts.push_back(std::move(txout));
78 }
79 return prevouts;
80}
81
82CScriptWitness ScriptWitnessFromJSON(const UniValue& univalue)
83{

Callers 1

TestFunction · 0.70

Calls 4

CheckedParseHexFunction · 0.85
isArrayMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected