@@ -428,6 +428,12 @@ BOOST_AUTO_TEST_CASE(query_archive_read__get_tx_position__confirmed__expected)
428428 BOOST_REQUIRE (query.get_tx_position (out, 4 ));
429429 BOOST_REQUIRE_EQUAL (out, 0u );
430430 BOOST_REQUIRE (!query.get_tx_position (out, 5 ));
431+
432+ BOOST_REQUIRE_EQUAL (query.get_position_tx (0 , 0 ), 0u );
433+ BOOST_REQUIRE_EQUAL (query.get_position_tx (1 , 0 ), 1u );
434+ BOOST_REQUIRE_EQUAL (query.get_position_tx (2 , 0 ), 2u );
435+ BOOST_REQUIRE_EQUAL (query.get_position_tx (2 , 1 ), 3u );
436+ BOOST_REQUIRE_EQUAL (query.get_position_tx (3 , 0 ), 4u );
431437}
432438
433439BOOST_AUTO_TEST_CASE (query_archive_read__get_tx_position__always__expected)
@@ -474,6 +480,27 @@ BOOST_AUTO_TEST_CASE(query_archive_read__get_tx_position__always__expected)
474480 BOOST_REQUIRE (!query.get_tx_position (out, 5 ));
475481}
476482
483+
484+ BOOST_AUTO_TEST_CASE (query_archive_read__get_position_tx__always__expected)
485+ {
486+ settings settings{};
487+ settings.path = TEST_DIRECTORY;
488+ test::chunk_store store{ settings };
489+ test::query_accessor query{ store };
490+ BOOST_REQUIRE (!store.create (events_handler));
491+ BOOST_REQUIRE (query.initialize (test::genesis));
492+ BOOST_REQUIRE (query.set (test::block1a, context{ 0 , 1 , 0 }, false , false ));
493+ BOOST_REQUIRE (query.set (test::block2a, context{ 0 , 2 , 0 }, false , false ));
494+ BOOST_REQUIRE (query.set (test::block3a, context{ 0 , 3 , 0 }, false , false ));
495+
496+ BOOST_REQUIRE_EQUAL (query.get_position_tx (0 , 0 ), 0u );
497+ BOOST_REQUIRE_EQUAL (query.get_position_tx (1 , 0 ), 1u );
498+ BOOST_REQUIRE_EQUAL (query.get_position_tx (2 , 0 ), 2u );
499+ BOOST_REQUIRE_EQUAL (query.get_position_tx (2 , 1 ), 3u );
500+ BOOST_REQUIRE_EQUAL (query.get_position_tx (3 , 0 ), 4u );
501+ BOOST_REQUIRE (query.get_position_tx (3 , 1 ).is_terminal ());
502+ }
503+
477504BOOST_AUTO_TEST_CASE (query_archive_read__get_tx_sizes__coinbase__204)
478505{
479506 settings settings{};
0 commit comments