From c9d8582235acf966e7e7bd47483624b4fc028cdd Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Thu, 16 Apr 2026 09:53:25 -0300 Subject: [PATCH] fuzz: remove redundant CScript method calls from script harness 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. --- src/test/fuzz/script.cpp | 7 ------- src/test/fuzz/script_ops.cpp | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/test/fuzz/script.cpp b/src/test/fuzz/script.cpp index 8d2d0e2c012..0017af380ae 100644 --- a/src/test/fuzz/script.cpp +++ b/src/test/fuzz/script.cpp @@ -93,13 +93,6 @@ FUZZ_TARGET(script, .init = initialize_script) std::vector> 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 bytes = ConsumeRandomLengthByteVector(fuzzed_data_provider); CompressedScript compressed_script; diff --git a/src/test/fuzz/script_ops.cpp b/src/test/fuzz/script_ops.cpp index 2e84038d3b1..5c5f60f2e31 100644 --- a/src/test/fuzz/script_ops.cpp +++ b/src/test/fuzz/script_ops.cpp @@ -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();