@@ -72,4 +72,42 @@ BOOST_AUTO_TEST_CASE(hex_reader__copy__genesis_header__expected)
7272 BOOST_REQUIRE (header == genesis ().header ());
7373}
7474
75+ // verify seek using full tx parse (scripts use position/skip/rewind/peek).
76+
77+ static const data_slice hex
78+ {
79+ " 0100000000000000000000000000000000000000000000000000000000000000"
80+ " 000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa"
81+ " 4b1e5e4a29ab5f49ffff001d1dac2b7c01010000000100000000000000000000"
82+ " 00000000000000000000000000000000000000000000ffffffff4d04ffff001d"
83+ " 0104455468652054696d65732030332f4a616e2f32303039204368616e63656c"
84+ " 6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f75742066"
85+ " 6f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe554827"
86+ " 1967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4"
87+ " f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"
88+ };
89+
90+ BOOST_AUTO_TEST_CASE (hex_reader__fast_stream__genesis_block__expected)
91+ {
92+ stream::in::fast source{ hex };
93+ read::base16::fast hexer{ source };
94+ const chain::block block{ hexer, true };
95+ BOOST_REQUIRE (block == genesis ());
96+ }
97+
98+ BOOST_AUTO_TEST_CASE (hex_reader__copy_stream__genesis_block__expected)
99+ {
100+ read::base16::copy hexer{ hex };
101+ const chain::block block{ hexer, true };
102+ BOOST_REQUIRE (block == genesis ());
103+ }
104+
105+ BOOST_AUTO_TEST_CASE (hex_reader__istream_stream__genesis_block__expected)
106+ {
107+ std::istringstream stream{ hex.to_string () };
108+ read::base16::istream hexer{ stream };
109+ const chain::block block{ hexer, true };
110+ BOOST_REQUIRE (block == genesis ());
111+ }
112+
75113BOOST_AUTO_TEST_SUITE_END ()
0 commit comments