|
12 | 12 | #include <test/ipc_test.capnp.proxy.h> |
13 | 13 | #include <test/ipc_test.h> |
14 | 14 | #include <tinyformat.h> |
| 15 | +#include <validation.h> |
15 | 16 |
|
16 | 17 | #include <future> |
17 | 18 | #include <thread> |
@@ -101,6 +102,25 @@ void IpcPipeTest() |
101 | 102 | std::vector<char> vec2{foo->passVectorChar(vec1)}; |
102 | 103 | BOOST_CHECK_EQUAL(std::string_view(vec1.begin(), vec1.end()), std::string_view(vec2.begin(), vec2.end())); |
103 | 104 |
|
| 105 | + BlockValidationState bs1; |
| 106 | + bs1.Invalid(BlockValidationResult::BLOCK_CHECKPOINT, "reject reason", "debug message"); |
| 107 | + BlockValidationState bs2{foo->passBlockState(bs1)}; |
| 108 | + BOOST_CHECK_EQUAL(bs1.IsValid(), bs2.IsValid()); |
| 109 | + BOOST_CHECK_EQUAL(bs1.IsError(), bs2.IsError()); |
| 110 | + BOOST_CHECK_EQUAL(bs1.IsInvalid(), bs2.IsInvalid()); |
| 111 | + BOOST_CHECK_EQUAL(static_cast<int>(bs1.GetResult()), static_cast<int>(bs2.GetResult())); |
| 112 | + BOOST_CHECK_EQUAL(bs1.GetRejectReason(), bs2.GetRejectReason()); |
| 113 | + BOOST_CHECK_EQUAL(bs1.GetDebugMessage(), bs2.GetDebugMessage()); |
| 114 | + |
| 115 | + BlockValidationState bs3; |
| 116 | + BlockValidationState bs4{foo->passBlockState(bs3)}; |
| 117 | + BOOST_CHECK_EQUAL(bs3.IsValid(), bs4.IsValid()); |
| 118 | + BOOST_CHECK_EQUAL(bs3.IsError(), bs4.IsError()); |
| 119 | + BOOST_CHECK_EQUAL(bs3.IsInvalid(), bs4.IsInvalid()); |
| 120 | + BOOST_CHECK_EQUAL(static_cast<int>(bs3.GetResult()), static_cast<int>(bs4.GetResult())); |
| 121 | + BOOST_CHECK_EQUAL(bs3.GetRejectReason(), bs4.GetRejectReason()); |
| 122 | + BOOST_CHECK_EQUAL(bs3.GetDebugMessage(), bs4.GetDebugMessage()); |
| 123 | + |
104 | 124 | // Test cleanup: disconnect pipe and join thread |
105 | 125 | disconnect_client(); |
106 | 126 | thread.join(); |
|
0 commit comments