13 #include <boost/test/unit_test.hpp> 21 template<
typename SetType>
22 void TestDepGraphSerialization(
const Cluster<SetType>& cluster,
const std::string& hexenc)
27 VerifyDepGraphFromCluster(cluster, depgraph);
31 std::vector<unsigned char> encoding;
33 writer << Using<DepGraphFormatter>(depgraph);
40 reader >> Using<DepGraphFormatter>(depgraph_read);
49 TestDepGraphSerialization<TestBitSet>(
54 TestDepGraphSerialization<TestBitSet>(
62 TestDepGraphSerialization<TestBitSet>(
63 {{{42, 11}, {}}, {{-13, 7}, {0}}},
74 TestDepGraphSerialization<TestBitSet>(
75 {{{64, 128}, {}}, {{128, 256}, {}}, {{1, 1}, {0, 1}}},
91 TestDepGraphSerialization<TestBitSet>(
92 {{{57, 114}, {1}}, {{-57, 113}, {}}, {{-58, 115}, {1}}, {{58, 116}, {2}}},
112 TestDepGraphSerialization<TestBitSet>(
113 {{{1, 3}, {1, 2}}, {{1, 2}, {}}, {{3, 1}, {}}, {{1, 1}, {0}}, {{2, 1}, {1}}},
Minimal stream for reading from an existing byte array by Span.
BOOST_AUTO_TEST_CASE(depgraph_ser_tests)
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK_EQUAL(v1, v2)
Data structure that holds a transaction graph's preprocessed data (fee, size, ancestors, descendants).
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
std::vector< std::pair< FeeFrac, SetType > > Cluster
Data type to represent cluster input.
#define BOOST_CHECK(expr)