Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
501BOOST_CHECK_EQUAL(v[1].m_base_data, 0xFF);503stream.clear();505stream << HEX(v);506BOOST_CHECK_EQUAL(stream.str(), "\x02"507"0fff");509v[0].m_base_data = 0;510v[1].m_base_data = 0;511stream >> HEX(v);512BOOST_CHECK_EQUAL(v[0].m_base_data, 0x0F);513BOOST_CHECK_EQUAL(v[1].m_base_data, 0xFF);514}516constexpr DerivedAndBaseFormat RAW_LOWER{{BaseFormat::RAW}, DerivedAndBaseFormat::DerivedFormat::LOWER};517constexpr DerivedAndBaseFormat HEX_UPPER{{BaseFormat::HEX}, DerivedAndBaseFormat::DerivedFormat::UPPER};519BOOST_AUTO_TEST_CASE(with_params_derived)520{521Derived d;522d.m_base_data = 0x0F;523d.m_derived_data = "xY";525DataStream stream;527stream << RAW_LOWER(d);529stream << HEX_UPPER(d);531BOOST_CHECK_EQUAL(stream.str(), "\x0F\x02xy"532"0f\x02XY");533}535BOOST_AUTO_TEST_SUITE_END()
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.