Changeset View
Changeset View
Standalone View
Standalone View
src/test/fuzz/script.cpp
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | if (!script_opt) { | ||||
return; | return; | ||||
} | } | ||||
const CScript script{*script_opt}; | const CScript script{*script_opt}; | ||||
std::vector<uint8_t> compressed; | std::vector<uint8_t> compressed; | ||||
if (CompressScript(script, compressed)) { | if (CompressScript(script, compressed)) { | ||||
const unsigned int size = compressed[0]; | const unsigned int size = compressed[0]; | ||||
compressed.erase(compressed.begin()); | compressed.erase(compressed.begin()); | ||||
assert(size >= 0 && size <= 5); | assert(size <= 5); | ||||
CScript decompressed_script; | CScript decompressed_script; | ||||
const bool ok = DecompressScript(decompressed_script, size, compressed); | const bool ok = DecompressScript(decompressed_script, size, compressed); | ||||
assert(ok); | assert(ok); | ||||
assert(script == decompressed_script); | assert(script == decompressed_script); | ||||
} | } | ||||
CTxDestination address; | CTxDestination address; | ||||
(void)ExtractDestination(script, address); | (void)ExtractDestination(script, address); | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |