diff options
Diffstat (limited to 'src/test/fuzz/util/descriptor.h')
-rw-r--r-- | src/test/fuzz/util/descriptor.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/fuzz/util/descriptor.h b/src/test/fuzz/util/descriptor.h index 6289b91b07..cd41dbafa3 100644 --- a/src/test/fuzz/util/descriptor.h +++ b/src/test/fuzz/util/descriptor.h @@ -8,6 +8,7 @@ #include <key_io.h> #include <util/strencodings.h> #include <script/descriptor.h> +#include <test/fuzz/fuzz.h> #include <functional> @@ -45,4 +46,13 @@ public: std::optional<std::string> GetDescriptor(std::string_view mocked_desc) const; }; +//! Default maximum number of derivation indexes in a single derivation path when limiting its depth. +constexpr int MAX_DEPTH{2}; + +/** + * Whether the buffer, if it represents a valid descriptor, contains a derivation path deeper than + * a given maximum depth. Note this may also be hit for deriv paths in origins. + */ +bool HasDeepDerivPath(const FuzzBufferType& buff, const int max_depth = MAX_DEPTH); + #endif // BITCOIN_TEST_FUZZ_UTIL_DESCRIPTOR_H |