diff --git a/include/bitcoin/database/impl/query/archive_write.ipp b/include/bitcoin/database/impl/query/archive_write.ipp index bb645741..a4bbb6a1 100644 --- a/include/bitcoin/database/impl/query/archive_write.ipp +++ b/include/bitcoin/database/impl/query/archive_write.ipp @@ -65,10 +65,11 @@ bool CLASS::set(const transaction& tx) NOEXCEPT } TEMPLATE -bool CLASS::set(const block& block, bool strong, bool bypass) NOEXCEPT +bool CLASS::set(const block& block, bool strong, bool bypass, + size_t height) NOEXCEPT { // This sets only the txs of a block with header/context already archived. - return !set_code(block, strong, bypass); + return !set_code(block, strong, bypass, height); } // set transaction @@ -338,7 +339,8 @@ code CLASS::set_code(header_link& out_fk, const block& block, const context& ctx, bool milestone, bool strong) NOEXCEPT { const auto ec = set_code(out_fk, block.header(), ctx, milestone); - return ec ? ec : set_code(block, out_fk, strong, strong || milestone); + return ec ? ec : set_code(block, out_fk, strong, strong || milestone, + ctx.height); } // set txs from block @@ -348,26 +350,27 @@ code CLASS::set_code(header_link& out_fk, const block& block, // releases all memory for parts of itself, due to the custom allocator. TEMPLATE -code CLASS::set_code(const block& block, bool strong, bool bypass) NOEXCEPT +code CLASS::set_code(const block& block, bool strong, bool bypass, + size_t height) NOEXCEPT { header_link unused{}; - return set_code(unused, block, strong, bypass); + return set_code(unused, block, strong, bypass, height); } TEMPLATE code CLASS::set_code(header_link& out_fk, const block& block, bool strong, - bool bypass) NOEXCEPT + bool bypass, size_t height) NOEXCEPT { out_fk = to_header(block.get_hash()); if (out_fk.is_terminal()) return error::txs_header; - return set_code(block, out_fk, strong, bypass); + return set_code(block, out_fk, strong, bypass, height); } TEMPLATE code CLASS::set_code(const block& block, const header_link& key, - bool strong, bool bypass) NOEXCEPT + bool strong, bool bypass, size_t /* height */) NOEXCEPT { using namespace system; if (key.is_terminal()) @@ -392,6 +395,13 @@ code CLASS::set_code(const block& block, const header_link& key, const auto size = block.serialized_size(true); const auto wire = possible_narrow_cast(size); + // TODO: compute and set interval hash for interval blocks as configured. + // TODO: create query to walk header.parent across full interval to collect + // TODO: merkle leaves and compute intermediate merkle root. This requires + // TODO: header.parent link traversal only, with read of hash for each. The + // TODO: full interval of hashes (e.g. 2048) is preallocated to a vector. + std::optional interval{}; + // ======================================================================== const auto scope = store_.get_transactor(); constexpr auto positive = true; @@ -407,7 +417,8 @@ code CLASS::set_code(const block& block, const header_link& key, {}, wire, count, - tx_fks + tx_fks, + std::move(interval) }) ? error::success : error::txs_txs_put; // ======================================================================== } diff --git a/include/bitcoin/database/query.hpp b/include/bitcoin/database/query.hpp index 7edab789..aafe1cde 100644 --- a/include/bitcoin/database/query.hpp +++ b/include/bitcoin/database/query.hpp @@ -412,7 +412,8 @@ class query bool set(const block& block, const context& ctx, bool milestone, bool strong) NOEXCEPT; bool set(const transaction& tx) NOEXCEPT; - bool set(const block& block, bool strong, bool bypass) NOEXCEPT; + bool set(const block& block, bool strong, bool bypass, + size_t height) NOEXCEPT; /// Set transaction. code set_code(const transaction& tx) NOEXCEPT; @@ -438,11 +439,12 @@ class query const chain_context& ctx, bool milestone, bool strong) NOEXCEPT; /// Set block.txs (headers-first). - code set_code(const block& block, bool strong, bool bypass) NOEXCEPT; + code set_code(const block& block, bool strong, bool bypass, + size_t height) NOEXCEPT; code set_code(header_link& out_fk, const block& block, bool strong, - bool bypass) NOEXCEPT; + bool bypass, size_t height) NOEXCEPT; code set_code(const block& block, const header_link& key, bool strong, - bool bypass) NOEXCEPT; + bool bypass, size_t height) NOEXCEPT; /// Context. /// ----------------------------------------------------------------------- diff --git a/include/bitcoin/database/tables/archives/input.hpp b/include/bitcoin/database/tables/archives/input.hpp index 2731341c..8432a7d1 100644 --- a/include/bitcoin/database/tables/archives/input.hpp +++ b/include/bitcoin/database/tables/archives/input.hpp @@ -79,7 +79,7 @@ struct input struct get_ptrs : public schema::input { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; @@ -103,7 +103,7 @@ struct input struct get_script : public schema::input { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; @@ -122,7 +122,7 @@ struct input struct get_witness : public schema::input { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; diff --git a/include/bitcoin/database/tables/archives/ins.hpp b/include/bitcoin/database/tables/archives/ins.hpp index 1581ef4c..55673a10 100644 --- a/include/bitcoin/database/tables/archives/ins.hpp +++ b/include/bitcoin/database/tables/archives/ins.hpp @@ -101,7 +101,7 @@ struct ins struct put_ref : public schema::ins { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { return system::possible_narrow_cast(tx_.inputs()); } diff --git a/include/bitcoin/database/tables/archives/output.hpp b/include/bitcoin/database/tables/archives/output.hpp index 3fa8642e..43cba2ef 100644 --- a/include/bitcoin/database/tables/archives/output.hpp +++ b/include/bitcoin/database/tables/archives/output.hpp @@ -87,7 +87,7 @@ struct output struct only : public schema::output { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; @@ -115,7 +115,7 @@ struct output struct get_script : public schema::output { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; @@ -136,7 +136,7 @@ struct output struct get_parent_value : public schema::output { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; @@ -156,7 +156,7 @@ struct output struct get_parent : public schema::output { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; @@ -174,7 +174,7 @@ struct output struct get_value : public schema::output { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; diff --git a/include/bitcoin/database/tables/archives/outs.hpp b/include/bitcoin/database/tables/archives/outs.hpp index b7a9063e..0d5060de 100644 --- a/include/bitcoin/database/tables/archives/outs.hpp +++ b/include/bitcoin/database/tables/archives/outs.hpp @@ -42,7 +42,7 @@ struct outs struct record : public schema::outs { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { return system::possible_narrow_cast(out_fks.size()); } @@ -80,7 +80,7 @@ struct outs struct get_output : public schema::outs { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { return 1; } @@ -97,7 +97,7 @@ struct outs struct put_ref : public schema::outs { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { return system::possible_narrow_cast(tx_.outputs()); } diff --git a/include/bitcoin/database/tables/archives/txs.hpp b/include/bitcoin/database/tables/archives/txs.hpp index ad61f7b5..834367e3 100644 --- a/include/bitcoin/database/tables/archives/txs.hpp +++ b/include/bitcoin/database/tables/archives/txs.hpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -38,63 +39,86 @@ struct txs using ct = linkage; using tx = schema::transaction::link; using keys = std::vector; - using bytes = linkage; + using bytes = linkage; + using hash = std::optional; using array_map::arraymap; + static constexpr auto offset = bytes::bits; + static_assert(offset < to_bits(bytes::size)); + static constexpr bytes::integer merge(bool interval, + bytes::integer wire) NOEXCEPT + { + using namespace system; + BC_ASSERT_MSG(!get_right(wire, offset), "overflow"); + return set_right(wire, offset, interval); + } + + // Intervals are set only if non-zero in database.interval. struct slab : public schema::txs { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { return system::possible_narrow_cast(ct::size + - bytes::size + tx::size * tx_fks.size()); + bytes::size + tx::size * tx_fks.size() + + (interval.has_value() ? schema::hash : zero)); } inline bool from_data(reader& source) NOEXCEPT { + using namespace system; tx_fks.resize(source.read_little_endian()); - wire = source.read_little_endian(); + const auto flaged = source.read_little_endian(); + wire = set_right(flaged, offset, false); std::for_each(tx_fks.begin(), tx_fks.end(), [&](auto& fk) NOEXCEPT { fk = source.read_little_endian(); }); + if (get_right(flaged, offset)) interval = source.read_hash(); BC_ASSERT(!source || source.get_read_position() == count()); return source; } inline bool to_data(finalizer& sink) const NOEXCEPT { - BC_ASSERT(tx_fks.size() < system::power2(to_bits(ct::size))); - const auto fks = system::possible_narrow_cast(tx_fks.size()); + using namespace system; + BC_ASSERT(tx_fks.size() < power2(to_bits(ct::size))); - sink.write_little_endian(fks); - sink.write_little_endian(wire); - std::for_each(tx_fks.begin(), tx_fks.end(), [&](const auto& fk) NOEXCEPT - { - sink.write_little_endian(fk); - }); + const auto flag = interval.has_value(); + const auto flaged = merge(flag, wire); + const auto fks = possible_narrow_cast(tx_fks.size()); + sink.write_little_endian(fks); + sink.write_little_endian(flaged); + std::for_each(tx_fks.begin(), tx_fks.end(), + [&](const auto& fk) NOEXCEPT + { + sink.write_little_endian(fk); + }); + + if (flag) sink.write_bytes(interval.value()); BC_ASSERT(!sink || sink.get_write_position() == count()); return sink; } inline bool operator==(const slab& other) const NOEXCEPT { - return tx_fks == other.tx_fks; + return wire == other.wire + && tx_fks == other.tx_fks + && interval == other.interval; } - // block.serialized_size(true) bytes::integer wire{}; keys tx_fks{}; + hash interval{}; }; // put a contiguous set of tx identifiers. - // TODO: this could be collapsed to a count and first using a sentinel. struct put_group : public schema::txs { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { return system::possible_narrow_cast(ct::size + bytes::size + tx::size * number); @@ -103,27 +127,32 @@ struct txs inline bool to_data(finalizer& sink) const NOEXCEPT { BC_ASSERT(number < system::power2(to_bits(ct::size))); + const auto flag = interval.has_value(); sink.write_little_endian(number); - sink.write_little_endian(wire); + sink.write_little_endian( + merge(flag, wire)); + // TODO: this can instead be stored as a count and coinbase fk, + // TODO: but will need to be disambiguated from compact blocks. for (auto fk = tx_fk; fk < (tx_fk + number); ++fk) sink.write_little_endian(fk); + if (flag) sink.write_bytes(interval.value()); BC_ASSERT(!sink || sink.get_write_position() == count()); return sink; } - // block.serialized_size(true) bytes::integer wire{}; ct::integer number{}; tx::integer tx_fk{}; + hash interval{}; }; struct get_position : public schema::txs { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; @@ -148,7 +177,7 @@ struct txs struct get_coinbase : public schema::txs { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; @@ -174,7 +203,7 @@ struct txs struct get_tx : public schema::txs { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; @@ -202,7 +231,7 @@ struct txs struct get_block_size : public schema::txs { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; @@ -211,7 +240,8 @@ struct txs inline bool from_data(reader& source) NOEXCEPT { source.skip_bytes(ct::size); - wire = source.read_little_endian(); + wire = system::set_right(source.read_little_endian< + bytes::integer, bytes::size>(), offset, false); return source; } @@ -221,7 +251,7 @@ struct txs struct get_associated : public schema::txs { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; @@ -239,7 +269,7 @@ struct txs struct get_txs : public schema::txs { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; @@ -263,7 +293,7 @@ struct txs struct get_spending_txs : public schema::txs { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; @@ -291,7 +321,7 @@ struct txs struct get_tx_quantity : public schema::txs { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; @@ -309,7 +339,7 @@ struct txs struct get_coinbase_and_count : public schema::txs { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; diff --git a/include/bitcoin/database/tables/caches/prevout.hpp b/include/bitcoin/database/tables/caches/prevout.hpp index a62f41a7..f593e426 100644 --- a/include/bitcoin/database/tables/caches/prevout.hpp +++ b/include/bitcoin/database/tables/caches/prevout.hpp @@ -38,7 +38,7 @@ struct prevout using tx = schema::transaction::link; using header = schema::header::link; using array_map::arraymap; - static constexpr size_t offset = tx::bits; + static constexpr auto offset = tx::bits; static_assert(offset < to_bits(tx::size)); // The below implementation overloads tx-sized record count with sequences. diff --git a/include/bitcoin/database/tables/caches/validated_bk.hpp b/include/bitcoin/database/tables/caches/validated_bk.hpp index 780129af..284446f3 100644 --- a/include/bitcoin/database/tables/caches/validated_bk.hpp +++ b/include/bitcoin/database/tables/caches/validated_bk.hpp @@ -38,7 +38,7 @@ struct validated_bk struct slab : public schema::validated_bk { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { using namespace system; return possible_narrow_cast(coding::size + @@ -74,7 +74,7 @@ struct validated_bk struct slab_get_code : public schema::validated_bk { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; diff --git a/include/bitcoin/database/tables/caches/validated_tx.hpp b/include/bitcoin/database/tables/caches/validated_tx.hpp index d6d36ac8..89c06ca1 100644 --- a/include/bitcoin/database/tables/caches/validated_tx.hpp +++ b/include/bitcoin/database/tables/caches/validated_tx.hpp @@ -41,7 +41,7 @@ struct validated_tx struct slab : public schema::validated_tx { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { using namespace system; return possible_narrow_cast(pk + sk + @@ -89,7 +89,7 @@ struct validated_tx struct slab_get_code : public schema::validated_tx { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { BC_ASSERT(false); return {}; diff --git a/include/bitcoin/database/tables/indexes/strong_tx.hpp b/include/bitcoin/database/tables/indexes/strong_tx.hpp index 592bf459..c143f405 100644 --- a/include/bitcoin/database/tables/indexes/strong_tx.hpp +++ b/include/bitcoin/database/tables/indexes/strong_tx.hpp @@ -50,24 +50,24 @@ struct strong_tx { inline bool positive() const NOEXCEPT { - return system::get_right(block_fk, offset); + return system::get_right(signed_block_fk, offset); } inline header::integer header_fk() const NOEXCEPT { - return system::set_right(block_fk, offset, false); + return system::set_right(signed_block_fk, offset, false); } inline bool from_data(reader& source) NOEXCEPT { - block_fk = source.read_little_endian(); + signed_block_fk = source.read_little_endian(); BC_ASSERT(!source || source.get_read_position() == minrow); return source; } inline bool to_data(finalizer& sink) const NOEXCEPT { - sink.write_little_endian(block_fk); + sink.write_little_endian(signed_block_fk); BC_ASSERT(!sink || sink.get_write_position() == minrow); return sink; } @@ -78,7 +78,7 @@ struct strong_tx && header_fk() == other.header_fk(); } - header::integer block_fk{}; + header::integer signed_block_fk{}; }; }; diff --git a/include/bitcoin/database/tables/optionals/filter_tx.hpp b/include/bitcoin/database/tables/optionals/filter_tx.hpp index 78d92df7..cc548677 100644 --- a/include/bitcoin/database/tables/optionals/filter_tx.hpp +++ b/include/bitcoin/database/tables/optionals/filter_tx.hpp @@ -37,7 +37,7 @@ struct filter_tx struct get_filter : public schema::filter_tx { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { return system::possible_narrow_cast( variable_size(filter.size()) + filter.size()); @@ -56,7 +56,7 @@ struct filter_tx struct put_ref : public schema::filter_tx { - link count() const NOEXCEPT + inline link count() const NOEXCEPT { return system::possible_narrow_cast( variable_size(filter.size()) + filter.size()); diff --git a/include/bitcoin/database/tables/schema.hpp b/include/bitcoin/database/tables/schema.hpp index dbecf34d..49ed4960 100644 --- a/include/bitcoin/database/tables/schema.hpp +++ b/include/bitcoin/database/tables/schema.hpp @@ -40,7 +40,7 @@ constexpr size_t hash = system::hash_size; /// Primary keys. /// ----------------------------------------------------------------------- -constexpr size_t dup = 2; // ->duplicate +constexpr size_t dup = 2; // ->duplicate [TODO: increase to 3] constexpr size_t put = 5; // ->input/output slab. constexpr size_t ins_ = 4; // ->point|ins record. constexpr size_t outs_ = 4; // ->outs (puts) record. @@ -208,6 +208,8 @@ struct txs count_ + // txs schema::size + // block.serialized_size(true) schema::transaction::pk;// coinbase tx + ////schema::bit + // is interval - merged bit into schema::size. + ////0 | schema::hash + // electrum interval hash (each 2048th block). static constexpr size_t minrow = minsize; static constexpr size_t size = max_size_t; static_assert(minsize == 10u); @@ -216,7 +218,7 @@ struct txs }; /// Index tables. -/// ----------------------------------------------------------------------- +/// --------------------------------------------------------------------------- // candidate and confirmed arrays struct height @@ -254,7 +256,7 @@ struct strong_tx }; /// Cache tables. -/// ----------------------------------------------------------------------- +/// --------------------------------------------------------------------------- // record hashmap struct duplicate @@ -333,7 +335,7 @@ struct validated_tx }; /// Optional tables. -/// ----------------------------------------------------------------------- +/// --------------------------------------------------------------------------- // TODO: modest (sk:4) record multimap, with high multiple rate. // large (sk:32) record multimap, with high multiple rate. diff --git a/test/query/archive_write.cpp b/test/query/archive_write.cpp index 5fa4a9cb..5842dcc6 100644 --- a/test/query/archive_write.cpp +++ b/test/query/archive_write.cpp @@ -705,7 +705,7 @@ BOOST_AUTO_TEST_CASE(query_archive_write__set_block_txs__get_block__expected) BOOST_REQUIRE(!query.is_block(test::genesis.hash())); BOOST_REQUIRE(query.set(test::genesis.header(), test::context, milestone)); BOOST_REQUIRE(!query.is_associated(0)); - BOOST_REQUIRE(query.set(test::genesis, false, false)); + BOOST_REQUIRE(query.set(test::genesis, false, false, zero)); BOOST_REQUIRE(query.is_block(test::genesis.hash())); BOOST_REQUIRE(query.is_associated(0)); diff --git a/test/query/initialize.cpp b/test/query/initialize.cpp index 3d1264d7..c0285abe 100644 --- a/test/query/initialize.cpp +++ b/test/query/initialize.cpp @@ -415,17 +415,17 @@ BOOST_AUTO_TEST_CASE(query_initialize__get_unassociated_above__gapped_candidate_ BOOST_REQUIRE_EQUAL(unassociated3.size(), 0u); // There are two unassociated blocks above block 1 (new fork point). - BOOST_REQUIRE(query.set(test::block1, false, false)); + BOOST_REQUIRE(query.set(test::block1, false, false, zero)); BOOST_REQUIRE(query.push_confirmed(query.to_header(test::block1.hash()), false)); BOOST_REQUIRE_EQUAL(query.get_all_unassociated().size(), 2u); // There is one unassociated block above block 2 (new fork point). - BOOST_REQUIRE(query.set(test::block2, false, false)); + BOOST_REQUIRE(query.set(test::block2, false, false, zero)); BOOST_REQUIRE(query.push_confirmed(query.to_header(test::block2.hash()), false)); BOOST_REQUIRE_EQUAL(query.get_all_unassociated().size(), 1u); // There are no unassociated blocks above block 3 (new fork point). - BOOST_REQUIRE(query.set(test::block3, false, false)); + BOOST_REQUIRE(query.set(test::block3, false, false, zero)); BOOST_REQUIRE(query.push_confirmed(query.to_header(test::block3.hash()), false)); BOOST_REQUIRE_EQUAL(query.get_all_unassociated().size(), 0u); } @@ -482,7 +482,7 @@ BOOST_AUTO_TEST_CASE(query_initialize__get_unassociated_count_above__gapped_cand BOOST_REQUIRE_EQUAL(query.get_unassociated_count_above(3, 1), 0u); // There is one unassociated block at block 2. - BOOST_REQUIRE(query.set(test::block3, false, false)); // associated + BOOST_REQUIRE(query.set(test::block3, false, false, zero)); // associated BOOST_REQUIRE_EQUAL(query.get_unassociated_count(), 1u); BOOST_REQUIRE_EQUAL(query.get_unassociated_count_above(0), 1u); BOOST_REQUIRE_EQUAL(query.get_unassociated_count_above(1), 1u); @@ -490,7 +490,7 @@ BOOST_AUTO_TEST_CASE(query_initialize__get_unassociated_count_above__gapped_cand BOOST_REQUIRE_EQUAL(query.get_unassociated_count_above(3), 0u); // There are no unassociated blocks. - BOOST_REQUIRE(query.set(test::block2, false, false)); // associated + BOOST_REQUIRE(query.set(test::block2, false, false, zero)); // associated BOOST_REQUIRE_EQUAL(query.get_unassociated_count(), 0u); BOOST_REQUIRE_EQUAL(query.get_unassociated_count_above(0), 0u); BOOST_REQUIRE_EQUAL(query.get_unassociated_count_above(1), 0u); diff --git a/test/tables/archives/txs.cpp b/test/tables/archives/txs.cpp index 5cb8773e..37713464 100644 --- a/test/tables/archives/txs.cpp +++ b/test/tables/archives/txs.cpp @@ -52,7 +52,7 @@ const table::txs::slab slab2 const table::txs::slab slab3 { {}, // schema::txs [all const static members] - 0xa0000b, + 0x09000b, std::vector { 0x56341231_u32, @@ -98,8 +98,8 @@ const data_chunk expected3 // slab3 (count) [3] 0x03, 0x00, 0x00, - // slab3 (wire) [0xa0000b] - 0x0b, 0x00, 0xa0, + // slab3 (wire) [0x09000b] + 0x0b, 0x00, 0x09, // slab3 0x31, 0x12, 0x34, 0x56, diff --git a/test/tables/indexes/strong_tx.cpp b/test/tables/indexes/strong_tx.cpp index cac53466..9018780d 100644 --- a/test/tables/indexes/strong_tx.cpp +++ b/test/tables/indexes/strong_tx.cpp @@ -97,12 +97,12 @@ BOOST_AUTO_TEST_CASE(strong_tx__get__two__expected) BOOST_REQUIRE(instance.get(0u, out)); BOOST_REQUIRE_EQUAL(out.header_fk(), strong1.header_fk()); BOOST_REQUIRE_EQUAL(out.positive(), strong1.positive()); - BOOST_REQUIRE_EQUAL(out.block_fk, bit_or(0x0078f87fu, 0x00800000u)); + BOOST_REQUIRE_EQUAL(out.signed_block_fk, bit_or(0x0078f87fu, 0x00800000u)); BOOST_REQUIRE(instance.get(1u, out)); BOOST_REQUIRE_EQUAL(out.header_fk(), strong2.header_fk()); BOOST_REQUIRE_EQUAL(out.positive(), strong2.positive()); - BOOST_REQUIRE_EQUAL(out.block_fk, bit_or(0x0078f87fu, 0x00000000u)); + BOOST_REQUIRE_EQUAL(out.signed_block_fk, bit_or(0x0078f87fu, 0x00000000u)); } BOOST_AUTO_TEST_SUITE_END()