iwyu: Fix includes for test/fuzz/util/descriptor module
What changed, and why it matters
This commit is a routine code cleanup in Bitcoin Core's test-only fuzzing utilities. It adjusts which C++ header files are included in two test files and fixes two minor comment typos. There is no change to the actual Bitcoin network code, consensus logic, wallet handling, or any code that runs in production.
No security action needed. Treat as normal maintenance/cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff updates include directives in src/test/fuzz/util/descriptor.cpp and src/test/fuzz/util/descriptor.h to follow ‘include what you use’ (IWYU) practice. descriptor.cpp gains explicit includes for key.h, key_io.h, pubkey.h, and util/strencodings.h. descriptor.h replaces a broad set of includes with more specific standard-library headers (array, cinttypes, cstddef, limits, optional, span, string, string_view) and removes key_io.h, util/strencodings.h, script/descriptor.h, test/fuzz/fuzz.h, and functional. Two comment typos are corrected (‘descriptor keys’ -> ‘descriptor keys’, ‘key expressions’ -> ‘key expressions’). No functional logic is modified.
Changed components
src/test/fuzz/util/descriptor.cppsrc/test/fuzz/util/descriptor.hInspect captured patch +15 / −8
diff --git a/src/test/fuzz/util/descriptor.cpp b/src/test/fuzz/util/descriptor.cpp
index 08ab7104..1db3c2f2 100644
--- a/src/test/fuzz/util/descriptor.cpp
+++ b/src/test/fuzz/util/descriptor.cpp
@@ -4,6 +4,11 @@
#include <test/fuzz/util/descriptor.h>
+#include <key.h>
+#include <key_io.h>
+#include <pubkey.h>
+#include <util/strencodings.h>
+
#include <ranges>
#include <stack>
diff --git a/src/test/fuzz/util/descriptor.h b/src/test/fuzz/util/descriptor.h
index 82cc967c..17a91e96 100644
--- a/src/test/fuzz/util/descriptor.h
+++ b/src/test/fuzz/util/descriptor.h
@@ -5,18 +5,20 @@
#ifndef BITCOIN_TEST_FUZZ_UTIL_DESCRIPTOR_H
#define BITCOIN_TEST_FUZZ_UTIL_DESCRIPTOR_H
-#include <key_io.h>
-#include <util/strencodings.h>
-#include <script/descriptor.h>
-#include <test/fuzz/fuzz.h>
-
-#include <functional>
+#include <array>
+#include <cinttypes>
+#include <cstddef>
+#include <limits>
+#include <optional>
+#include <span>
+#include <string>
+#include <string_view>
/**
- * Converts a mocked descriptor string to a valid one. Every key in a mocked descriptor key is
+ * Converts a mocked descriptor string to a valid one. Every key in a mocked descriptor is
* represented by 2 hex characters preceded by the '%' character. We parse the two hex characters
* as an index in a list of pre-generated keys. This list contains keys of the various types
- * accepted in descriptor keys expressions.
+ * accepted in descriptor key expressions.
*/
class MockedDescriptorConverter {
private:
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.