Merge bitcoin/bitcoin#35127: fuzz: remove redundant CScript method calls from script harness

c9d8582235 fuzz: remove redundant CScript method calls from script harness (Bruno Garcia)

Pull request description:

  The script harness was calling `GetSigOpCount`, `HasValidOps`, `IsPayToAnchor`, `IsPayToScriptHash`, `IsPayToWitnessScriptHash`, and `IsPushOnly` on the fuzzed CScript. All of these are already covered by the `script_ops` harness, which is the dedicated harness for CScript member methods. Also, add the missing `IsPayToAnchor` call to `script_ops` so the move preserves coverage.

ACKs for top commit:
  maflcko:
    lgtm ACK c9d8582235

Tree-SHA512: f69c9f217b5422e24714f985a8c0f7fcfb2c1b1e9117a0e54e7d31139bedfec9279a756ceb9b8860f7574b7cf59fb17c1063596176de8de4800824dc7866f33c
This commit is contained in:
merge-script
2026-04-21 10:25:11 +01:00
2 changed files with 1 additions and 7 deletions

View File

@@ -93,13 +93,6 @@ FUZZ_TARGET(script, .init = initialize_script)
std::vector<std::vector<unsigned char>> solutions;
(void)Solver(script, solutions);
(void)script.HasValidOps();
(void)script.IsPayToAnchor();
(void)script.IsPayToScriptHash();
(void)script.IsPayToWitnessScriptHash();
(void)script.IsPushOnly();
(void)script.GetSigOpCount(/* fAccurate= */ false);
{
const std::vector<uint8_t> bytes = ConsumeRandomLengthByteVector(fuzzed_data_provider);
CompressedScript compressed_script;

View File

@@ -48,6 +48,7 @@ FUZZ_TARGET(script_ops)
(void)script.GetSigOpCount(script);
(void)script.HasValidOps();
(void)script.IsPayToScriptHash();
(void)script.IsPayToAnchor();
(void)script.IsPayToWitnessScriptHash();
(void)script.IsPushOnly();
(void)script.IsUnspendable();