aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/deserialize.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/fuzz/deserialize.cpp')
-rw-r--r--src/test/fuzz/deserialize.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/test/fuzz/deserialize.cpp b/src/test/fuzz/deserialize.cpp
index 9364ac4a32..bcd8691359 100644
--- a/src/test/fuzz/deserialize.cpp
+++ b/src/test/fuzz/deserialize.cpp
@@ -12,6 +12,7 @@
#include <net.h>
#include <primitives/block.h>
#include <protocol.h>
+#include <pubkey.h>
#include <streams.h>
#include <undo.h>
#include <version.h>
@@ -23,7 +24,13 @@
#include <test/fuzz/fuzz.h>
-void test_one_input(std::vector<uint8_t> buffer)
+void initialize()
+{
+ // Fuzzers using pubkey must hold an ECCVerifyHandle.
+ static const auto verify_handle = MakeUnique<ECCVerifyHandle>();
+}
+
+void test_one_input(const std::vector<uint8_t>& buffer)
{
CDataStream ds(buffer, SER_NETWORK, INIT_PROTO_VERSION);
try {
@@ -40,11 +47,6 @@ void test_one_input(std::vector<uint8_t> buffer)
CBlock block;
ds >> block;
} catch (const std::ios_base::failure& e) {return;}
-#elif TRANSACTION_DESERIALIZE
- try
- {
- CTransaction tx(deserialize, ds);
- } catch (const std::ios_base::failure& e) {return;}
#elif BLOCKLOCATOR_DESERIALIZE
try
{