Merge #21553: fuzz: Misc refactor

fa4926cca6 fuzz: [refactor] Use IsValidFlagCombination in signature_checker fuzz target (MarcoFalke)
eeee8f5be1 fuzz: Removed unused try-catch in coins_view (MarcoFalke)
fa98f3f66e fuzz: [refactor] Use ConsumeScript in signature_checker fuzz target (MarcoFalke)

Pull request description:

  Some small refactors to remove unused and redundant fuzz code

ACKs for top commit:
  practicalswift:
    cr re-ACK fa4926cca6

Tree-SHA512: eb07a2140caad7b31495b76385fc7634cf5b6daa4947f430ebb127eb1375583dc11e541a0a42d0e5d93d430480b8a815b93974450fd5ed897528a2d47c752f86
This commit is contained in:
MarcoFalke
2021-03-30 20:07:04 +02:00
7 changed files with 28 additions and 26 deletions

13
src/test/util/script.cpp Normal file
View File

@@ -0,0 +1,13 @@
// Copyright (c) 2021 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <script/interpreter.h>
#include <test/util/script.h>
bool IsValidFlagCombination(unsigned flags)
{
if (flags & SCRIPT_VERIFY_CLEANSTACK && ~flags & (SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS)) return false;
if (flags & SCRIPT_VERIFY_WITNESS && ~flags & SCRIPT_VERIFY_P2SH) return false;
return true;
}

View File

@@ -18,4 +18,7 @@ static const CScript P2WSH_OP_TRUE{
return hash;
}())};
/** Flags that are not forbidden by an assert in script validation */
bool IsValidFlagCombination(unsigned flags);
#endif // BITCOIN_TEST_UTIL_SCRIPT_H