19
19
#include < validationinterface.h>
20
20
#include < version.h>
21
21
22
- #include < algorithm>
23
22
#include < atomic>
24
23
#include < cassert>
25
24
#include < chrono>
26
25
#include < cstdint>
27
26
#include < iosfwd>
28
27
#include < iostream>
29
- #include < map>
30
28
#include < memory>
31
- #include < set>
32
29
#include < string>
33
30
#include < vector>
34
31
@@ -44,19 +41,6 @@ const std::string LIMIT_TO_MESSAGE_TYPE{TO_STRING(MESSAGE_TYPE)};
44
41
const std::string LIMIT_TO_MESSAGE_TYPE;
45
42
#endif
46
43
47
- const std::map<std::string, std::set<std::string>> EXPECTED_DESERIALIZATION_EXCEPTIONS = {
48
- {" CDataStream::read(): end of data: iostream error" , {" addr" , " block" , " blocktxn" , " cmpctblock" , " feefilter" , " filteradd" , " filterload" , " getblocks" , " getblocktxn" , " getdata" , " getheaders" , " headers" , " inv" , " notfound" , " ping" , " sendcmpct" , " tx" }},
49
- {" CompactSize exceeds limit of type: iostream error" , {" cmpctblock" }},
50
- {" differential value overflow: iostream error" , {" getblocktxn" }},
51
- {" index overflowed 16 bits: iostream error" , {" getblocktxn" }},
52
- {" index overflowed 16-bits: iostream error" , {" cmpctblock" }},
53
- {" indexes overflowed 16 bits: iostream error" , {" getblocktxn" }},
54
- {" non-canonical ReadCompactSize(): iostream error" , {" addr" , " block" , " blocktxn" , " cmpctblock" , " filteradd" , " filterload" , " getblocks" , " getblocktxn" , " getdata" , " getheaders" , " headers" , " inv" , " notfound" , " tx" }},
55
- {" ReadCompactSize(): size too large: iostream error" , {" addr" , " block" , " blocktxn" , " cmpctblock" , " filteradd" , " filterload" , " getblocks" , " getblocktxn" , " getdata" , " getheaders" , " headers" , " inv" , " notfound" , " tx" }},
56
- {" Superfluous witness record: iostream error" , {" block" , " blocktxn" , " cmpctblock" , " tx" }},
57
- {" Unknown transaction optional data: iostream error" , {" block" , " blocktxn" , " cmpctblock" , " tx" }},
58
- };
59
-
60
44
const TestingSetup* g_setup;
61
45
} // namespace
62
46
@@ -91,13 +75,7 @@ void test_one_input(const std::vector<uint8_t>& buffer)
91
75
g_setup->m_node .peer_logic ->InitializeNode (&p2p_node);
92
76
try {
93
77
(void )ProcessMessage (&p2p_node, random_message_type, random_bytes_data_stream, GetTimeMillis (), Params (), *g_setup->m_node .mempool , g_setup->m_node .connman .get (), g_setup->m_node .banman .get (), std::atomic<bool >{false });
94
- } catch (const std::ios_base::failure& e) {
95
- const std::string exception_message{e.what ()};
96
- const auto p = EXPECTED_DESERIALIZATION_EXCEPTIONS.find (exception_message);
97
- if (p == EXPECTED_DESERIALIZATION_EXCEPTIONS.cend () || p->second .count (random_message_type) == 0 ) {
98
- std::cout << " Unexpected exception when processing message type \" " << random_message_type << " \" : " << exception_message << std::endl;
99
- assert (false );
100
- }
78
+ } catch (const std::ios_base::failure&) {
101
79
}
102
80
SyncWithValidationInterfaceQueue ();
103
81
}
0 commit comments