@@ -28,9 +28,7 @@ static_assert(is_same_type<database::context::flag_t::integer, decltype(system::
2828// nop event handler.
2929const auto events_handler = [](auto , auto ) {};
3030
31- // ----------------------------------------------------------------------------
32-
33- // archive_write (foreign-keyed)
31+ // is_coinbase
3432
3533BOOST_AUTO_TEST_CASE (query_archive_read__is_coinbase__coinbase__true)
3634{
@@ -67,6 +65,40 @@ BOOST_AUTO_TEST_CASE(query_archive_read__is_coinbase__non_coinbase__false)
6765 BOOST_REQUIRE (!query.is_coinbase (42 ));
6866}
6967
68+ // is_tx_segregated
69+
70+ BOOST_AUTO_TEST_CASE (query_archive_read__is_tx_segregated__always__expected)
71+ {
72+ settings settings{};
73+ settings.path = TEST_DIRECTORY;
74+ test::chunk_store store{ settings };
75+ test::query_accessor query{ store };
76+ BOOST_REQUIRE_EQUAL (store.create (events_handler), error::success);
77+ BOOST_REQUIRE (query.initialize (test::genesis));
78+ BOOST_REQUIRE (query.set (test::block1a, context{}, false , false ));
79+ BOOST_REQUIRE (!query.is_tx_segregated (0 ));
80+ BOOST_REQUIRE ( query.is_tx_segregated (1 ));
81+ BOOST_REQUIRE (!query.is_tx_segregated (2 ));
82+ }
83+
84+ // is_block_segregated
85+
86+ BOOST_AUTO_TEST_CASE (query_archive_read__is_block_segregated__always__expected)
87+ {
88+ settings settings{};
89+ settings.path = TEST_DIRECTORY;
90+ test::chunk_store store{ settings };
91+ test::query_accessor query{ store };
92+ BOOST_REQUIRE_EQUAL (store.create (events_handler), error::success);
93+ BOOST_REQUIRE (query.initialize (test::genesis));
94+ BOOST_REQUIRE (query.set (test::block1a, context{}, false , false ));
95+ BOOST_REQUIRE (!query.is_block_segregated (0 ));
96+ BOOST_REQUIRE ( query.is_block_segregated (1 ));
97+ BOOST_REQUIRE (!query.is_block_segregated (2 ));
98+ }
99+
100+ // is_milestone
101+
70102BOOST_AUTO_TEST_CASE (query_archive_read__is_milestone__genesis__false)
71103{
72104 settings settings{};
@@ -252,17 +284,17 @@ BOOST_AUTO_TEST_CASE(query_archive_read__get_point_key__always__expected)
252284 // tx4/5 prevouts are all block1a.tx1.
253285 BOOST_REQUIRE (query.set (test::tx4));
254286 BOOST_REQUIRE (query.set (test::tx5));
255- // // BOOST_REQUIRE_EQUAL(query.get_point_hash(0), test::block1a.transactions_ptr()->front()->hash(false));
287+ // // BOOST_REQUIRE_EQUAL(query.get_point_hash(0), test::block1a.transactions_ptr()->front()->hash(false));
256288 BOOST_REQUIRE_EQUAL (query.get_point_hash (1 ), test::block1a.transactions_ptr ()->front ()->hash (false ));
257289 BOOST_REQUIRE_EQUAL (query.get_point_hash (2 ), test::block1a.transactions_ptr ()->front ()->hash (false ));
258- // // BOOST_REQUIRE_EQUAL(query.get_point_hash(3), system::null_hash);
290+ // // BOOST_REQUIRE_EQUAL(query.get_point_hash(3), system::null_hash);
259291
260292 // block1a adds three prevouts of two txs.
261293 BOOST_REQUIRE (query.set (test::block1a, context{}, false , false ));
262- // // BOOST_REQUIRE_EQUAL(query.get_point_hash(3), system::one_hash);
294+ // // BOOST_REQUIRE_EQUAL(query.get_point_hash(3), system::one_hash);
263295 BOOST_REQUIRE_EQUAL (query.get_point_hash (4 ), system::one_hash);
264- // // BOOST_REQUIRE_EQUAL(query.get_point_hash(5), test::two_hash);
265- // // BOOST_REQUIRE_EQUAL(query.get_point_hash(6), system::null_hash);
296+ // // BOOST_REQUIRE_EQUAL(query.get_point_hash(5), test::two_hash);
297+ // // BOOST_REQUIRE_EQUAL(query.get_point_hash(6), system::null_hash);
266298}
267299
268300BOOST_AUTO_TEST_CASE (query_archive_read__get_tx_key__always__expected)
@@ -656,28 +688,28 @@ BOOST_AUTO_TEST_CASE(query_archive_read__get_spenders__unspent_or_not_found__exp
656688
657689 // Caller should always test for nullptr.
658690 BOOST_REQUIRE (query.get_spenders (output_link::terminal, true )->empty ());
659- // BOOST_REQUIRE(query.get_spenders_index(tx_link::terminal, 0, true)->empty());
660- // BOOST_REQUIRE(query.get_spenders_index(tx_link::terminal, 1, true)->empty());
691+ // // BOOST_REQUIRE(query.get_spenders_index(tx_link::terminal, 0, true)->empty());
692+ // // BOOST_REQUIRE(query.get_spenders_index(tx_link::terminal, 1, true)->empty());
661693
662694 BOOST_REQUIRE (query.get_spenders (query.to_output (0 , 0 ), true )->empty ());
663695 BOOST_REQUIRE (query.get_spenders (query.to_output (0 , 1 ), true )->empty ());
664- // BOOST_REQUIRE(query.get_spenders_index(0, 0, true)->empty());
665- // BOOST_REQUIRE(query.get_spenders_index(0, 1, true)->empty());
696+ // / BOOST_REQUIRE(query.get_spenders_index(0, 0, true)->empty());
697+ // // BOOST_REQUIRE(query.get_spenders_index(0, 1, true)->empty());
666698
667699 BOOST_REQUIRE (query.get_spenders (query.to_output (1 , 0 ), true )->empty ());
668700 BOOST_REQUIRE (query.get_spenders (query.to_output (1 , 1 ), true )->empty ());
669- // BOOST_REQUIRE(query.get_spenders_index(1, 0, true)->empty());
670- // BOOST_REQUIRE(query.get_spenders_index(1, 1, true)->empty());
701+ // // BOOST_REQUIRE(query.get_spenders_index(1, 0, true)->empty());
702+ // // BOOST_REQUIRE(query.get_spenders_index(1, 1, true)->empty());
671703
672704 BOOST_REQUIRE (query.get_spenders (query.to_output (2 , 0 ), true )->empty ());
673705 BOOST_REQUIRE (query.get_spenders (query.to_output (2 , 1 ), true )->empty ());
674- // BOOST_REQUIRE(query.get_spenders_index(2, 0, true)->empty());
675- // BOOST_REQUIRE(query.get_spenders_index(2, 1, true)->empty());
706+ // // BOOST_REQUIRE(query.get_spenders_index(2, 0, true)->empty());
707+ // // BOOST_REQUIRE(query.get_spenders_index(2, 1, true)->empty());
676708
677709 BOOST_REQUIRE (query.get_spenders (query.to_output (3 , 0 ), true )->empty ());
678710 BOOST_REQUIRE (query.get_spenders (query.to_output (3 , 1 ), true )->empty ());
679- // BOOST_REQUIRE(query.get_spenders_index(3, 0, true)->empty());
680- // BOOST_REQUIRE(query.get_spenders_index(3, 1, true)->empty());
711+ // // BOOST_REQUIRE(query.get_spenders_index(3, 0, true)->empty());
712+ // // BOOST_REQUIRE(query.get_spenders_index(3, 1, true)->empty());
681713}
682714
683715// //BOOST_AUTO_TEST_CASE(query_archive_read__get_spenders__found_and_spent__expected)
0 commit comments