From a5ead122fe060e7e582914dcb7acfaeee7a8ac48 Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Wed, 16 Jul 2025 11:24:58 +1000 Subject: [PATCH] script/interpreter: introduce script_verify_flags typename Previously the SCRIPT_VERIFY_* flags were specified as either uint32_t, unsigned int, or unsigned. This converts them to a common type alias in preparation for changing the underlying type. --- src/bench/verify_script.cpp | 2 +- src/consensus/params.h | 3 +- src/consensus/tx_verify.cpp | 2 +- src/consensus/tx_verify.h | 3 +- src/policy/policy.h | 6 ++-- src/script/interpreter.cpp | 26 +++++++-------- src/script/interpreter.h | 13 ++++---- src/script/verify_flags.h | 13 ++++++++ src/signet.cpp | 2 +- src/test/fuzz/eval_script.cpp | 2 +- src/test/fuzz/script.cpp | 2 +- .../fuzz/script_assets_test_minimizer.cpp | 30 ++++++++--------- src/test/fuzz/script_flags.cpp | 4 +-- src/test/fuzz/signature_checker.cpp | 2 +- src/test/multisig_tests.cpp | 2 +- src/test/script_assets_tests.cpp | 12 +++---- src/test/script_tests.cpp | 12 +++---- src/test/sigopcount_tests.cpp | 4 +-- src/test/transaction_tests.cpp | 32 +++++++++---------- src/test/txvalidationcache_tests.cpp | 6 ++-- src/test/util/script.cpp | 2 +- src/test/util/script.h | 3 +- src/validation.cpp | 18 +++++------ src/validation.h | 9 +++--- 24 files changed, 114 insertions(+), 96 deletions(-) create mode 100644 src/script/verify_flags.h diff --git a/src/bench/verify_script.cpp b/src/bench/verify_script.cpp index 8d7e92a0556..062f9a01dc2 100644 --- a/src/bench/verify_script.cpp +++ b/src/bench/verify_script.cpp @@ -24,7 +24,7 @@ static void VerifyScriptBench(benchmark::Bench& bench) { ECC_Context ecc_context{}; - const uint32_t flags{SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH}; + const script_verify_flags flags{SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH}; const int witnessversion = 0; // Key pair. diff --git a/src/consensus/params.h b/src/consensus/params.h index 6344349b866..f33ff15fbfe 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -6,6 +6,7 @@ #ifndef BITCOIN_CONSENSUS_PARAMS_H #define BITCOIN_CONSENSUS_PARAMS_H +#include