Bitcoin Core 31.99.0
P2P Digital Currency
serialize_tests.cpp
Go to the documentation of this file.
1// Copyright (c) 2012-present 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 <hash.h>
6#include <serialize.h>
7#include <streams.h>
8#include <test/util/common.h>
10#include <util/strencodings.h>
11
12#include <algorithm>
13#include <cstdint>
14#include <string>
15
16#include <boost/test/unit_test.hpp>
17
19
20// For testing move-semantics, declare a version of datastream that can be moved
21// but is not copyable.
23{
24public:
28 UncopyableStream(UncopyableStream&&) noexcept = default;
29 UncopyableStream& operator=(UncopyableStream&&) noexcept = default;
30};
31
33{
34protected:
35 int intval;
36 bool boolval;
37 std::string stringval;
38 char charstrval[16];
40public:
42 CSerializeMethodsTestSingle(int intvalin, bool boolvalin, std::string stringvalin, const uint8_t* charstrvalin, const CTransactionRef& txvalin) : intval(intvalin), boolval(boolvalin), stringval(std::move(stringvalin)), txval(txvalin)
43 {
44 memcpy(charstrval, charstrvalin, sizeof(charstrval));
45 }
46
48 {
49 READWRITE(obj.intval);
50 READWRITE(obj.boolval);
51 READWRITE(obj.stringval);
52 READWRITE(obj.charstrval);
53 READWRITE(TX_WITH_WITNESS(obj.txval));
54 }
55
57 {
58 return intval == rhs.intval &&
59 boolval == rhs.boolval &&
60 stringval == rhs.stringval &&
61 strcmp(charstrval, rhs.charstrval) == 0 &&
62 *txval == *rhs.txval;
63 }
64};
65
67{
68public:
70
72 {
73 READWRITE(obj.intval, obj.boolval, obj.stringval, obj.charstrval, TX_WITH_WITNESS(obj.txval));
74 }
75};
76
78{
79 BOOST_CHECK_EQUAL(sizeof(unsigned char), GetSerializeSize((unsigned char)0));
80 BOOST_CHECK_EQUAL(sizeof(int8_t), GetSerializeSize(int8_t(0)));
81 BOOST_CHECK_EQUAL(sizeof(uint8_t), GetSerializeSize(uint8_t(0)));
82 BOOST_CHECK_EQUAL(sizeof(int16_t), GetSerializeSize(int16_t(0)));
83 BOOST_CHECK_EQUAL(sizeof(uint16_t), GetSerializeSize(uint16_t(0)));
84 BOOST_CHECK_EQUAL(sizeof(int32_t), GetSerializeSize(int32_t(0)));
85 BOOST_CHECK_EQUAL(sizeof(uint32_t), GetSerializeSize(uint32_t(0)));
86 BOOST_CHECK_EQUAL(sizeof(int64_t), GetSerializeSize(int64_t(0)));
87 BOOST_CHECK_EQUAL(sizeof(uint64_t), GetSerializeSize(uint64_t(0)));
88 // Bool is serialized as uint8_t
89 BOOST_CHECK_EQUAL(sizeof(uint8_t), GetSerializeSize(bool(0)));
90
91 // Sanity-check GetSerializeSize and c++ type matching
92 BOOST_CHECK_EQUAL(GetSerializeSize((unsigned char)0), 1U);
93 BOOST_CHECK_EQUAL(GetSerializeSize(int8_t(0)), 1U);
94 BOOST_CHECK_EQUAL(GetSerializeSize(uint8_t(0)), 1U);
95 BOOST_CHECK_EQUAL(GetSerializeSize(int16_t(0)), 2U);
96 BOOST_CHECK_EQUAL(GetSerializeSize(uint16_t(0)), 2U);
97 BOOST_CHECK_EQUAL(GetSerializeSize(int32_t(0)), 4U);
98 BOOST_CHECK_EQUAL(GetSerializeSize(uint32_t(0)), 4U);
99 BOOST_CHECK_EQUAL(GetSerializeSize(int64_t(0)), 8U);
100 BOOST_CHECK_EQUAL(GetSerializeSize(uint64_t(0)), 8U);
102 BOOST_CHECK_EQUAL(GetSerializeSize(std::array<uint8_t, 1>{0}), 1U);
103 BOOST_CHECK_EQUAL(GetSerializeSize(std::array<uint8_t, 2>{0, 0}), 2U);
104}
105
107{
108 // encode
109
110 DataStream ss{};
111 DataStream::size_type size = 0;
112 for (int i = 0; i < 100000; i++) {
115 BOOST_CHECK(size == ss.size());
116 }
117
118 for (uint64_t i = 0; i < 100000000000ULL; i += 999999937) {
119 ss << VARINT(i);
120 size += ::GetSerializeSize(VARINT(i));
121 BOOST_CHECK(size == ss.size());
122 }
123
124 // decode
125 for (int i = 0; i < 100000; i++) {
126 int j = -1;
128 BOOST_CHECK_MESSAGE(i == j, "decoded:" << j << " expected:" << i);
129 }
130
131 for (uint64_t i = 0; i < 100000000000ULL; i += 999999937) {
132 uint64_t j = std::numeric_limits<uint64_t>::max();
133 ss >> VARINT(j);
134 BOOST_CHECK_MESSAGE(i == j, "decoded:" << j << " expected:" << i);
135 }
136}
137
138BOOST_AUTO_TEST_CASE(varints_bitpatterns)
139{
140 DataStream ss{};
141 ss << VARINT_MODE(0, VarIntMode::NONNEGATIVE_SIGNED); BOOST_CHECK_EQUAL(HexStr(ss), "00"); ss.clear();
142 ss << VARINT_MODE(0x7f, VarIntMode::NONNEGATIVE_SIGNED); BOOST_CHECK_EQUAL(HexStr(ss), "7f"); ss.clear();
143 ss << VARINT_MODE(int8_t{0x7f}, VarIntMode::NONNEGATIVE_SIGNED); BOOST_CHECK_EQUAL(HexStr(ss), "7f"); ss.clear();
144 ss << VARINT_MODE(0x80, VarIntMode::NONNEGATIVE_SIGNED); BOOST_CHECK_EQUAL(HexStr(ss), "8000"); ss.clear();
145 ss << VARINT(uint8_t{0x80}); BOOST_CHECK_EQUAL(HexStr(ss), "8000"); ss.clear();
146 ss << VARINT_MODE(0x1234, VarIntMode::NONNEGATIVE_SIGNED); BOOST_CHECK_EQUAL(HexStr(ss), "a334"); ss.clear();
147 ss << VARINT_MODE(int16_t{0x1234}, VarIntMode::NONNEGATIVE_SIGNED); BOOST_CHECK_EQUAL(HexStr(ss), "a334"); ss.clear();
148 ss << VARINT_MODE(0xffff, VarIntMode::NONNEGATIVE_SIGNED); BOOST_CHECK_EQUAL(HexStr(ss), "82fe7f"); ss.clear();
149 ss << VARINT(uint16_t{0xffff}); BOOST_CHECK_EQUAL(HexStr(ss), "82fe7f"); ss.clear();
150 ss << VARINT_MODE(0x123456, VarIntMode::NONNEGATIVE_SIGNED); BOOST_CHECK_EQUAL(HexStr(ss), "c7e756"); ss.clear();
151 ss << VARINT_MODE(int32_t{0x123456}, VarIntMode::NONNEGATIVE_SIGNED); BOOST_CHECK_EQUAL(HexStr(ss), "c7e756"); ss.clear();
152 ss << VARINT(0x80123456U); BOOST_CHECK_EQUAL(HexStr(ss), "86ffc7e756"); ss.clear();
153 ss << VARINT(uint32_t{0x80123456U}); BOOST_CHECK_EQUAL(HexStr(ss), "86ffc7e756"); ss.clear();
154 ss << VARINT(0xffffffff); BOOST_CHECK_EQUAL(HexStr(ss), "8efefefe7f"); ss.clear();
155 ss << VARINT_MODE(0x7fffffffffffffffLL, VarIntMode::NONNEGATIVE_SIGNED); BOOST_CHECK_EQUAL(HexStr(ss), "fefefefefefefefe7f"); ss.clear();
156 ss << VARINT(0xffffffffffffffffULL); BOOST_CHECK_EQUAL(HexStr(ss), "80fefefefefefefefe7f"); ss.clear();
157}
158
160{
161 DataStream ss{};
162 std::vector<char>::size_type i, j;
163
164 for (i = 1; i <= MAX_SIZE; i *= 2)
165 {
166 WriteCompactSize(ss, i-1);
167 WriteCompactSize(ss, i);
168 }
169 for (i = 1; i <= MAX_SIZE; i *= 2)
170 {
171 j = ReadCompactSize(ss);
172 BOOST_CHECK_MESSAGE((i-1) == j, "decoded:" << j << " expected:" << (i-1));
173 j = ReadCompactSize(ss);
174 BOOST_CHECK_MESSAGE(i == j, "decoded:" << j << " expected:" << i);
175 }
176}
177
178static bool isCanonicalException(const std::ios_base::failure& ex)
179{
180 std::ios_base::failure expectedException("non-canonical ReadCompactSize()");
181
182 // The string returned by what() can be different for different platforms.
183 // Instead of directly comparing the ex.what() with an expected string,
184 // create an instance of exception to see if ex.what() matches
185 // the expected explanatory string returned by the exception instance.
186 return strcmp(expectedException.what(), ex.what()) == 0;
187}
188
190{
191 std::vector<uint8_t> vec1{1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1};
192 std::vector<bool> vec2{1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1};
193
194 BOOST_CHECK(vec1 == std::vector<uint8_t>(vec2.begin(), vec2.end()));
195 BOOST_CHECK((HashWriter{} << vec1).GetHash() == (HashWriter{} << vec2).GetHash());
196}
197
199{
200 std::array<uint8_t, 32> array1{1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1};
201 DataStream ds;
202 ds << array1;
203 std::array<uint8_t, 32> array2;
204 ds >> array2;
205 BOOST_CHECK(array1 == array2);
206}
207
209{
210 // Write some non-canonical CompactSize encodings, and
211 // make sure an exception is thrown when read back.
212 DataStream ss{};
213 std::vector<char>::size_type n;
214
215 // zero encoded with three bytes:
216 ss << std::span{"\xfd\x00\x00"}.first(3);
217 BOOST_CHECK_EXCEPTION(ReadCompactSize(ss), std::ios_base::failure, isCanonicalException);
218
219 // 0xfc encoded with three bytes:
220 ss << std::span{"\xfd\xfc\x00"}.first(3);
221 BOOST_CHECK_EXCEPTION(ReadCompactSize(ss), std::ios_base::failure, isCanonicalException);
222
223 // 0xfd encoded with three bytes is OK:
224 ss << std::span{"\xfd\xfd\x00"}.first(3);
225 n = ReadCompactSize(ss);
226 BOOST_CHECK(n == 0xfd);
227
228 // zero encoded with five bytes:
229 ss << std::span{"\xfe\x00\x00\x00\x00"}.first(5);
230 BOOST_CHECK_EXCEPTION(ReadCompactSize(ss), std::ios_base::failure, isCanonicalException);
231
232 // 0xffff encoded with five bytes:
233 ss << std::span{"\xfe\xff\xff\x00\x00"}.first(5);
234 BOOST_CHECK_EXCEPTION(ReadCompactSize(ss), std::ios_base::failure, isCanonicalException);
235
236 // zero encoded with nine bytes:
237 ss << std::span{"\xff\x00\x00\x00\x00\x00\x00\x00\x00"}.first(9);
238 BOOST_CHECK_EXCEPTION(ReadCompactSize(ss), std::ios_base::failure, isCanonicalException);
239
240 // 0x01ffffff encoded with nine bytes:
241 ss << std::span{"\xff\xff\xff\xff\x01\x00\x00\x00\x00"}.first(9);
242 BOOST_CHECK_EXCEPTION(ReadCompactSize(ss), std::ios_base::failure, isCanonicalException);
243}
244
246{
247 const std::string_view sv{"hello, world"};
248 DataStream ss;
249 ss << sv;
250 std::string s;
251 ss >> s;
252 BOOST_CHECK_EQUAL(sv, s);
253}
254
255BOOST_AUTO_TEST_CASE(limited_vector)
256{
257 const std::vector<int> v = {1,2,3,4,-5,-6,-7,-8,-9,-10,10000,20000,-30000};
258
259 auto check = [&]<size_t N>() {
260 DataStream ss;
261 ss << v;
262 try {
263 std::vector<int> r;
264 ss >> LIMITED_VECTOR(r, N);
265 BOOST_CHECK_LE(r.size(), N);
266 BOOST_CHECK(std::ranges::equal(r, v));
267 } catch (const std::ios_base::failure&) {
268 BOOST_CHECK_GT(v.size(), N);
269 }
270 };
271 check.operator()<0>();
272 check.operator()<10>();
273 check.operator()<12>();
274 check.operator()<13>();
275 check.operator()<14>();
276 check.operator()<100>();
277}
278
280{
281 int intval(100);
282 bool boolval(true);
283 std::string stringval("testing");
284 const uint8_t charstrval[16]{"testing charstr"};
286 CTransactionRef tx_ref{MakeTransactionRef(txval)};
287 CSerializeMethodsTestSingle methodtest1(intval, boolval, stringval, charstrval, tx_ref);
288 CSerializeMethodsTestMany methodtest2(intval, boolval, stringval, charstrval, tx_ref);
289 CSerializeMethodsTestSingle methodtest3;
290 CSerializeMethodsTestMany methodtest4;
291 DataStream ss;
292 BOOST_CHECK(methodtest1 == methodtest2);
293 ss << methodtest1;
294 ss >> methodtest4;
295 ss << methodtest2;
296 ss >> methodtest3;
297 BOOST_CHECK(methodtest1 == methodtest2);
298 BOOST_CHECK(methodtest2 == methodtest3);
299 BOOST_CHECK(methodtest3 == methodtest4);
300
301 DataStream ss2;
302 ss2 << intval << boolval << stringval << charstrval << TX_WITH_WITNESS(txval);
303 ss2 >> methodtest3;
304 BOOST_CHECK(methodtest3 == methodtest4);
305 {
306 DataStream ds;
307 const std::string in{"ab"};
308 ds << std::span{in} << std::byte{'c'};
309 std::array<std::byte, 2> out;
310 std::byte out_3;
311 ds >> std::span{out} >> out_3;
312 BOOST_CHECK_EQUAL(out.at(0), std::byte{'a'});
313 BOOST_CHECK_EQUAL(out.at(1), std::byte{'b'});
314 BOOST_CHECK_EQUAL(out_3, std::byte{'c'});
315 }
316}
317
319 const enum {
324};
327
329class Base
330{
331public:
332 uint8_t m_base_data;
333
334 Base() : m_base_data(17) {}
335 explicit Base(uint8_t data) : m_base_data(data) {}
336
337 template <typename Stream>
338 void Serialize(Stream& s) const
339 {
340 if (s.template GetParams<BaseFormat>().m_base_format == BaseFormat::RAW) {
341 s << m_base_data;
342 } else {
343 s << std::span<const char>{HexStr(std::span{&m_base_data, 1})};
344 }
345 }
346
347 template <typename Stream>
348 void Unserialize(Stream& s)
349 {
350 if (s.template GetParams<BaseFormat>().m_base_format == BaseFormat::RAW) {
351 s >> m_base_data;
352 } else {
353 std::string hex{"aa"};
354 s >> std::span{hex}.first(hex.size());
355 m_base_data = TryParseHex<uint8_t>(hex).value().at(0);
356 }
357 }
358};
359
361{
362public:
364
365 enum class DerivedFormat {
366 LOWER,
367 UPPER,
369
371};
372
373class Derived : public Base
374{
375public:
376 std::string m_derived_data;
377
379 {
380 auto& fmt = SER_PARAMS(DerivedAndBaseFormat);
381 READWRITE(fmt.m_base_format(AsBase<Base>(obj)));
382
383 if (ser_action.ForRead()) {
384 std::string str;
385 s >> str;
386 SER_READ(obj, obj.m_derived_data = str);
387 } else {
388 s << (fmt.m_derived_format == DerivedAndBaseFormat::DerivedFormat::LOWER ?
389 ToLower(obj.m_derived_data) :
390 ToUpper(obj.m_derived_data));
391 }
392 }
393};
394
396 uint8_t param;
398};
399
404{
405public:
406 template <typename Stream>
407 void Serialize(Stream& s) const
408 {
409 const uint8_t param = s.template GetParams<OtherParam>().param;
410 s << param;
411 }
412
413 template <typename Stream>
414 void Unserialize(Stream& s) const
415 {
416 const uint8_t param = s.template GetParams<OtherParam>().param;
417 uint8_t value;
418 s >> value;
419 BOOST_CHECK_EQUAL(value, param);
420 }
421};
422
430BOOST_AUTO_TEST_CASE(with_params_multi)
431{
432 const OtherParam other_param_used{.param = 0x10};
433 const OtherParam other_param_ignored{.param = 0x11};
434 const OtherParam other_param_override{.param = 0x12};
436 DataStream stream;
437 ParamsStream pstream{stream, RAW, other_param_used, other_param_ignored};
438
439 Base base1{0x20};
440 pstream << base1 << check << other_param_override(check);
441 BOOST_CHECK_EQUAL(stream.str(), "\x20\x10\x12");
442
443 Base base2;
444 pstream >> base2 >> check >> other_param_override(check);
445 BOOST_CHECK_EQUAL(base2.m_base_data, 0x20);
446}
447
449BOOST_AUTO_TEST_CASE(with_params_move)
450{
451 UncopyableStream stream{MakeByteSpan(std::string_view{"abc"})};
452 ParamsStream pstream{std::move(stream), RAW, HEX, RAW};
453 BOOST_CHECK_EQUAL(pstream.GetStream().str(), "abc");
454 pstream.GetStream().clear();
455
456 Base base1{0x20};
457 pstream << base1;
458 BOOST_CHECK_EQUAL(pstream.GetStream().str(), "\x20");
459
460 Base base2;
461 pstream >> base2;
462 BOOST_CHECK_EQUAL(base2.m_base_data, 0x20);
463}
464
465BOOST_AUTO_TEST_CASE(with_params_base)
466{
467 Base b{0x0F};
468
469 DataStream stream;
470
471 stream << RAW(b);
472 BOOST_CHECK_EQUAL(stream.str(), "\x0F");
473
474 b.m_base_data = 0;
475 stream >> RAW(b);
476 BOOST_CHECK_EQUAL(b.m_base_data, 0x0F);
477
478 stream.clear();
479
480 stream << HEX(b);
481 BOOST_CHECK_EQUAL(stream.str(), "0f");
482
483 b.m_base_data = 0;
484 stream >> HEX(b);
485 BOOST_CHECK_EQUAL(b.m_base_data, 0x0F);
486}
487
488BOOST_AUTO_TEST_CASE(with_params_vector_of_base)
489{
490 std::vector<Base> v{Base{0x0F}, Base{0xFF}};
491
492 DataStream stream;
493
494 stream << RAW(v);
495 BOOST_CHECK_EQUAL(stream.str(), "\x02\x0F\xFF");
496
497 v[0].m_base_data = 0;
498 v[1].m_base_data = 0;
499 stream >> RAW(v);
500 BOOST_CHECK_EQUAL(v[0].m_base_data, 0x0F);
501 BOOST_CHECK_EQUAL(v[1].m_base_data, 0xFF);
502
503 stream.clear();
504
505 stream << HEX(v);
506 BOOST_CHECK_EQUAL(stream.str(), "\x02"
507 "0fff");
508
509 v[0].m_base_data = 0;
510 v[1].m_base_data = 0;
511 stream >> HEX(v);
512 BOOST_CHECK_EQUAL(v[0].m_base_data, 0x0F);
513 BOOST_CHECK_EQUAL(v[1].m_base_data, 0xFF);
514}
515
518
519BOOST_AUTO_TEST_CASE(with_params_derived)
520{
521 Derived d;
522 d.m_base_data = 0x0F;
523 d.m_derived_data = "xY";
524
525 DataStream stream;
526
527 stream << RAW_LOWER(d);
528
529 stream << HEX_UPPER(d);
530
531 BOOST_CHECK_EQUAL(stream.str(), "\x0F\x02xy"
532 "0f\x02XY");
533}
534
(Un)serialize a number as raw byte or 2 hexadecimal chars.
uint8_t m_base_data
void Unserialize(Stream &s)
void Serialize(Stream &s) const
Base(uint8_t data)
SERIALIZE_METHODS(CSerializeMethodsTestMany, obj)
CSerializeMethodsTestSingle(int intvalin, bool boolvalin, std::string stringvalin, const uint8_t *charstrvalin, const CTransactionRef &txvalin)
SERIALIZE_METHODS(CSerializeMethodsTestSingle, obj)
bool operator==(const CSerializeMethodsTestSingle &rhs) const
Double ended buffer combining vector and stream-like interfaces.
Definition: streams.h:165
vector_type::size_type size_type
Definition: streams.h:173
std::string str() const
Definition: streams.h:186
void clear()
Definition: streams.h:204
DataStream()=default
enum DerivedAndBaseFormat::DerivedFormat m_derived_format
std::string m_derived_data
SERIALIZE_METHODS(Derived, obj)
A writer stream (for serialization) that computes a 256-bit hash.
Definition: hash.h:109
Checker for value of OtherParam.
void Unserialize(Stream &s) const
void Serialize(Stream &s) const
Wrapper that overrides the GetParams() function of a stream.
Definition: serialize.h:1169
UncopyableStream & operator=(const UncopyableStream &)=delete
UncopyableStream(const UncopyableStream &)=delete
UncopyableStream(UncopyableStream &&) noexcept=default
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
std::string HexStr(const std::span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
Definition: hex_base.cpp:30
BOOST_CHECK_GT(excessive_headers.size(), MAX_HEADERS_SIZE)
BOOST_CHECK_EQUAL(headers.FindFirst("key"), "value")
BOOST_CHECK_EXCEPTION(HTTPHeaders{}.Read(reader), std::runtime_error, HasReason{"Empty HTTP header name"})
T check(T ptr)
#define BOOST_CHECK(expr)
Definition: object.cpp:16
static constexpr TransactionSerParams TX_WITH_WITNESS
Definition: transaction.h:180
static CTransactionRef MakeTransactionRef(Tx &&txIn)
Definition: transaction.h:404
std::shared_ptr< const CTransaction > CTransactionRef
Definition: transaction.h:403
#define VARINT(obj)
Definition: serialize.h:494
#define VARINT_MODE(obj, mode)
Definition: serialize.h:493
#define SER_PARAMS(type)
Formatter methods can retrieve parameters attached to a stream using the SER_PARAMS(type) macro as lo...
Definition: serialize.h:209
@ NONNEGATIVE_SIGNED
static constexpr uint64_t MAX_SIZE
The maximum size of a serialized object in bytes or number of elements (for eg vectors) when the size...
Definition: serialize.h:35
#define LIMITED_VECTOR(obj, n)
Definition: serialize.h:497
void WriteCompactSize(SizeComputer &os, uint64_t nSize)
Definition: serialize.h:1151
#define SER_READ(obj, code)
Definition: serialize.h:149
#define SER_PARAMS_OPFUNC
Helper macro for SerParams structs.
Definition: serialize.h:1274
uint64_t ReadCompactSize(Stream &is, bool range_check=true)
Decode a CompactSize-encoded variable-length integer.
Definition: serialize.h:333
uint64_t GetSerializeSize(const T &t)
Definition: serialize.h:1157
#define READWRITE(...)
Definition: serialize.h:148
constexpr DerivedAndBaseFormat HEX_UPPER
constexpr BaseFormat RAW
constexpr DerivedAndBaseFormat RAW_LOWER
constexpr BaseFormat HEX
static bool isCanonicalException(const std::ios_base::failure &ex)
BOOST_AUTO_TEST_CASE(sizes)
auto MakeByteSpan(const V &v) noexcept
Definition: span.h:84
enum BaseFormat::@14 m_base_format
Basic testing setup.
Definition: setup_common.h:58
A mutable version of CTransaction.
Definition: transaction.h:358
std::string ToUpper(std::string_view str)
Returns the uppercase equivalent of the given string.
std::string ToLower(std::string_view str)
Returns the lowercase equivalent of the given string.