From c2b4dd698c4eb254a6865b3777d099d55b4ad51e Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 9 Mar 2020 11:19:27 -0400 Subject: [PATCH] Merge #18292: fuzz: Add assert(script == decompressed_script) fab0e5ba7f2777b86f1487234ed7cc4be9f72ea8 fuzz: Add assert(script == decompressed_script) (MarcoFalke) Pull request description: Presumably an oversight in https://github.com/bitcoin/bitcoin/pull/17926#discussion_r389262151 ACKs for top commit: practicalswift: Tested ACK fab0e5ba7f2777b86f1487234ed7cc4be9f72ea8 Tree-SHA512: 6dcec06169df497a540fd6ebbcd89f5db22257241b2bbe756de868742f9bc324b80d38dbababfa07e5f3a830aaae9fc6d168dcc2ca5d75da437bdf4dc4e0f370 --- src/test/fuzz/script.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/fuzz/script.cpp b/src/test/fuzz/script.cpp index fee9583b06..8a6c5added 100644 --- a/src/test/fuzz/script.cpp +++ b/src/test/fuzz/script.cpp @@ -46,10 +46,12 @@ FUZZ_TARGET_INIT(script, initialize_script) CompressedScript compressed; if (CompressScript(script, compressed)) { const unsigned int size = compressed[0]; + compressed.erase(compressed.begin()); assert(size <= 5); CScript decompressed_script; const bool ok = DecompressScript(decompressed_script, size, compressed); assert(ok); + assert(script == decompressed_script); } CTxDestination address;