File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ FUZZ_TARGETS = \
49
49
test/fuzz/transaction \
50
50
test/fuzz/tx_in \
51
51
test/fuzz/tx_in_deserialize \
52
+ test/fuzz/tx_out \
52
53
test/fuzz/txoutcompressor_deserialize \
53
54
test/fuzz/txundo_deserialize
54
55
@@ -504,6 +505,12 @@ test_fuzz_tx_in_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
504
505
test_fuzz_tx_in_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
505
506
test_fuzz_tx_in_LDADD = $(FUZZ_SUITE_LD_COMMON)
506
507
508
+ test_fuzz_tx_out_SOURCES = $(FUZZ_SUITE) test/fuzz/tx_out.cpp
509
+ test_fuzz_tx_out_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
510
+ test_fuzz_tx_out_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
511
+ test_fuzz_tx_out_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
512
+ test_fuzz_tx_out_LDADD = $(FUZZ_SUITE_LD_COMMON)
513
+
507
514
endif # ENABLE_FUZZ
508
515
509
516
nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2019 The Bitcoin Core developers
2
+ // Distributed under the MIT software license, see the accompanying
3
+ // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
+
5
+ #include < consensus/validation.h>
6
+ #include < core_memusage.h>
7
+ #include < policy/policy.h>
8
+ #include < primitives/transaction.h>
9
+ #include < streams.h>
10
+ #include < test/fuzz/fuzz.h>
11
+ #include < version.h>
12
+
13
+ void test_one_input (const std::vector<uint8_t >& buffer)
14
+ {
15
+ CDataStream ds (buffer, SER_NETWORK, INIT_PROTO_VERSION);
16
+ CTxOut tx_out;
17
+ try {
18
+ int version;
19
+ ds >> version;
20
+ ds.SetVersion (version);
21
+ ds >> tx_out;
22
+ } catch (const std::ios_base::failure&) {
23
+ return ;
24
+ }
25
+
26
+ const CFeeRate dust_relay_fee{DUST_RELAY_TX_FEE};
27
+ (void )GetDustThreshold (tx_out, dust_relay_fee);
28
+ (void )IsDust (tx_out, dust_relay_fee);
29
+ (void )RecursiveDynamicUsage (tx_out);
30
+
31
+ (void )tx_out.ToString ();
32
+ (void )tx_out.IsNull ();
33
+ tx_out.SetNull ();
34
+ assert (tx_out.IsNull ());
35
+ }
You can’t perform that action at this time.
0 commit comments