fuzz, refactor: Remove `Serialize` overload
What changed, and why it matters
This is a small code cleanup in a fuzz test file. It removes a helper function and changes one call site to use the standard serialization pattern instead. There is no security issue here.
No action needed. This is a benign refactoring change in test code.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit removes a local Serialize overload in src/test/fuzz/deserialize.cpp that took an object and a parameter wrapper, and instead calls the existing Serialize(params(obj)) pattern used elsewhere in the codebase. This is a refactoring change in test-only fuzzing code. No deserialization logic, consensus code, or production serialization behavior is modified.
Changed components
src/test/fuzz/deserialize.cppInspect captured patch +1 / −9
diff --git a/src/test/fuzz/deserialize.cpp b/src/test/fuzz/deserialize.cpp
index 63db20b6..046bfca5 100644
--- a/src/test/fuzz/deserialize.cpp
+++ b/src/test/fuzz/deserialize.cpp
@@ -57,14 +57,6 @@ namespace {
struct invalid_fuzzing_input_exception : public std::exception {
};
-template <typename T, typename P>
-DataStream Serialize(const T& obj, const P& params)
-{
- DataStream ds{};
- ds << params(obj);
- return ds;
-}
-
template <typename T, typename P>
T Deserialize(DataStream&& ds, const P& params)
{
@@ -116,7 +108,7 @@ T DeserializeConstructFromFuzzingInput(FuzzBufferType buffer)
template <typename T, typename P>
void AssertEqualAfterSerializeDeserialize(const T& obj, const P& params)
{
- assert(Deserialize<T>(Serialize(obj, params), params) == obj);
+ assert(Deserialize<T>(Serialize(params(obj)), params) == obj);
}
template <typename T>
void AssertEqualAfterSerializeDeserialize(const T& obj)
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.