MCPcopy Create free account
hub / github.com/ElementsProject/elements / UnserializeFromVector

Function UnserializeFromVector

src/psbt.h:149–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147// Takes a stream and multiple arguments and unserializes them first as a vector then each object individually in the order provided in the arguments
148template<typename Stream, typename... X>
149void UnserializeFromVector(Stream& s, X&... args)
150{
151 size_t expected_size = ReadCompactSize(s);
152 if (!expected_size) {
153 return; /* Zero size = no data to read */
154 }
155 size_t remaining_before = s.size();
156 UnserializeMany(s, args...);
157 size_t remaining_after = s.size();
158 if (remaining_after + expected_size != remaining_before) {
159 throw std::ios_base::failure("Size of value was not the stated size");
160 }
161}
162
163// Deserialize an individual HD keypath to a stream
164template<typename Stream>

Callers 3

UnserializeMethod · 0.85
UnserializeMethod · 0.85
UnserializeMethod · 0.85

Calls 3

ReadCompactSizeFunction · 0.85
UnserializeManyFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected