diff options
author | fanquake <fanquake@gmail.com> | 2023-07-07 10:14:54 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-07-07 10:48:09 +0100 |
commit | a9dde841e159296f311d50b1a7fefd67da3914a4 (patch) | |
tree | 79856551f478a5f4fa76bd8644220c68be44f1db /src/test/serialize_tests.cpp | |
parent | 299f17a69e1b64ebbe0f10c4d833ee14a5fb821a (diff) | |
parent | fac6af16f4a254458b8cb3522317422b40362f8d (diff) |
Merge bitcoin/bitcoin#28012: util: Allow FastRandomContext::randbytes for std::byte, Allow std::byte serialization
fac6af16f4a254458b8cb3522317422b40362f8d Allow std::byte serialization (MarcoFalke)
fade43edc4405e7c51cec9325d8502f3786f7438 Allow FastRandomContext::randbytes for all byte types (MarcoFalke)
Pull request description:
I need this for some stuff, but it should also be useful by itself for other developers that need it.
ACKs for top commit:
sipa:
utACK fac6af16f4a254458b8cb3522317422b40362f8d
dergoegge:
Code review ACK fac6af16f4a254458b8cb3522317422b40362f8d
Tree-SHA512: db4b1bbd6bf6ef6503d59b0b4ed1681db8d935d2d10f8d89f071978ea59b49a1d319bccb4e9717c0c88a4908bbeca4fd0cbff6c655d8a443554fd14146fe16de
Diffstat (limited to 'src/test/serialize_tests.cpp')
-rw-r--r-- | src/test/serialize_tests.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/serialize_tests.cpp b/src/test/serialize_tests.cpp index b445ff8ffc..2e862621bc 100644 --- a/src/test/serialize_tests.cpp +++ b/src/test/serialize_tests.cpp @@ -244,11 +244,13 @@ BOOST_AUTO_TEST_CASE(class_methods) { DataStream ds; const std::string in{"ab"}; - ds << Span{in}; + ds << Span{in} << std::byte{'c'}; std::array<std::byte, 2> out; - ds >> Span{out}; + std::byte out_3; + ds >> Span{out} >> out_3; BOOST_CHECK_EQUAL(out.at(0), std::byte{'a'}); BOOST_CHECK_EQUAL(out.at(1), std::byte{'b'}); + BOOST_CHECK_EQUAL(out_3, std::byte{'c'}); } } |