@@ -484,12 +484,13 @@ BOOST_AUTO_TEST_CASE(query_confirm__block_confirmable__null_points__success)
484484 BOOST_REQUIRE (query.set (test::block2, context{ bip68 }, false , false ));
485485 BOOST_REQUIRE (query.set (test::block3, context{ bip68 }, false , false ));
486486
487+ // ALL COINBASE TXS
487488 // block1/2/3 at links 1/2/3 confirming at heights 1/2/3.
488489 // blocks have only coinbase txs, all txs should be set strong before calling
489490 // confirmable, but these are bip30 default configuration.
490- BOOST_REQUIRE (! query.block_confirmable (1 ));
491- BOOST_REQUIRE (! query.block_confirmable (2 ));
492- BOOST_REQUIRE (! query.block_confirmable (3 ));
491+ BOOST_REQUIRE_EQUAL ( query.block_confirmable (1 ), error::success );
492+ BOOST_REQUIRE_EQUAL ( query.block_confirmable (2 ), error::success );
493+ BOOST_REQUIRE_EQUAL ( query.block_confirmable (3 ), error::success );
493494}
494495
495496BOOST_AUTO_TEST_CASE (query_confirm__block_confirmable__missing_prevouts__integrity)
@@ -502,9 +503,10 @@ BOOST_AUTO_TEST_CASE(query_confirm__block_confirmable__missing_prevouts__integri
502503 BOOST_REQUIRE (query.initialize (test::genesis));
503504 BOOST_REQUIRE (query.set (test::block1a, context{ bip68, 1 , 0 }, false , false ));
504505
506+ // ONLY COINBASE TXS
505507 // block1a is missing all three input prevouts.
506508 BOOST_REQUIRE (query.set_strong (1 ));
507- BOOST_REQUIRE (! query.block_confirmable (1 ));
509+ BOOST_REQUIRE_EQUAL ( query.block_confirmable (1 ), error::success );
508510}
509511
510512BOOST_AUTO_TEST_CASE (query_confirm__block_confirmable__spend_gensis__coinbase_maturity)
@@ -520,8 +522,9 @@ BOOST_AUTO_TEST_CASE(query_confirm__block_confirmable__spend_gensis__coinbase_ma
520522 BOOST_REQUIRE (query.set (test::block_spend_genesis, context{ 0 , 101 , 0 }, false , false ));
521523 BOOST_REQUIRE (query.set_strong (1 ));
522524
525+ // COINBASE TX
523526 // 1 + 100 = 101 (maturity, except genesis)
524- BOOST_REQUIRE (! query.block_confirmable (1 ));
527+ BOOST_REQUIRE_EQUAL ( query.block_confirmable (1 ), error::success );
525528}
526529
527530BOOST_AUTO_TEST_CASE (query_confirm__block_confirmable__immature_prevouts__coinbase_maturity)
@@ -536,12 +539,13 @@ BOOST_AUTO_TEST_CASE(query_confirm__block_confirmable__immature_prevouts__coinba
536539 // block1b has only a coinbase tx.
537540 BOOST_REQUIRE (query.set (test::block1b, context{ bip68, 1 , 0 }, false , false ));
538541 BOOST_REQUIRE (query.set_strong (1 ));
539- BOOST_REQUIRE (! query.block_confirmable (1 ));
542+ BOOST_REQUIRE_EQUAL ( query.block_confirmable (1 ), error::success );
540543
544+ // COINBASE TX
541545 // block2b prematurely spends block1b's coinbase outputs.
542546 BOOST_REQUIRE (query.set (test::block2b, context{ 0 , 100 , 0 }, false , false ));
543547 BOOST_REQUIRE (query.set_strong (2 ));
544- BOOST_REQUIRE (! query.block_confirmable (2 ));
548+ BOOST_REQUIRE_EQUAL ( query.block_confirmable (2 ), error::success );
545549}
546550
547551BOOST_AUTO_TEST_CASE (query_confirm__block_confirmable__mature_prevouts__success)
@@ -556,12 +560,13 @@ BOOST_AUTO_TEST_CASE(query_confirm__block_confirmable__mature_prevouts__success)
556560 // block1b has only a coinbase tx.
557561 BOOST_REQUIRE (query.set (test::block1b, context{ bip68, 1 , 0 }, false , false ));
558562 BOOST_REQUIRE (query.set_strong (1 ));
559- BOOST_REQUIRE (! query.block_confirmable (1 ));
563+ BOOST_REQUIRE_EQUAL ( query.block_confirmable (1 ), error::success );
560564
565+ // COINBASE TX
561566 // block2b spends block1b's coinbase outputs.
562567 BOOST_REQUIRE (query.set (test::block2b, context{ 0 , 101 , 0 }, false , false ));
563568 BOOST_REQUIRE (query.set_strong (2 ));
564- BOOST_REQUIRE (! query.block_confirmable (2 ));
569+ BOOST_REQUIRE_EQUAL ( query.block_confirmable (2 ), error::success );
565570}
566571
567572BOOST_AUTO_TEST_CASE (query_confirm__block_confirmable__spend_non_coinbase__success)
@@ -581,8 +586,9 @@ BOOST_AUTO_TEST_CASE(query_confirm__block_confirmable__spend_non_coinbase__succe
581586 BOOST_REQUIRE (query.set (test::block_spend_1a, context{ 0 , 2 , 0 }, false , false ));
582587 BOOST_REQUIRE (query.set_strong (2 ));
583588
589+ // COINBASE TX
584590 // Maturity applies only to coinbase prevouts.
585- BOOST_REQUIRE (! query.block_confirmable (2 ));
591+ BOOST_REQUIRE_EQUAL ( query.block_confirmable (2 ), error::success );
586592}
587593
588594// These pas but test vectors need to be updated to create clear test conditions.
@@ -608,7 +614,7 @@ BOOST_AUTO_TEST_CASE(query_confirm__block_confirmable__spend_non_coinbase__succe
608614// // BOOST_REQUIRE(query.set_strong(2));
609615// //
610616// // // Not confirmable because lack of maturity.
611- // // BOOST_REQUIRE (!query.block_confirmable(2));
617+ // // BOOST_REQUIRE_EQUAL (!query.block_confirmable(2), error::success );
612618// //}
613619// //
614620// //BOOST_AUTO_TEST_CASE(query_confirm__block_confirmable__spend_coinbase_and_internal_mature__success)
@@ -635,7 +641,7 @@ BOOST_AUTO_TEST_CASE(query_confirm__block_confirmable__spend_non_coinbase__succe
635641// // // It spends only its first own output (coinbase) and that can never be mature.
636642// // // But spend target is not stored as coinbase because it's not a null point.
637643// // BOOST_REQUIRE(query.set_strong(2));
638- // // BOOST_REQUIRE (!query.block_confirmable(2));
644+ // // BOOST_REQUIRE_EQUAL (!query.block_confirmable(2), error::success );
639645// //}
640646// //
641647// //BOOST_AUTO_TEST_CASE(query_confirm__block_confirmable__confirmed_double_spend__confirmed_double_spend)
@@ -660,7 +666,7 @@ BOOST_AUTO_TEST_CASE(query_confirm__block_confirmable__spend_non_coinbase__succe
660666// // BOOST_REQUIRE(query.set_strong(3));
661667// //
662668// // // Not confirmable because of intervening block2a implies double spend.
663- // // BOOST_REQUIRE (!query.block_confirmable(3));
669+ // // BOOST_REQUIRE_EQUAL (!query.block_confirmable(3), error::success );
664670// //}
665671// //
666672// //BOOST_AUTO_TEST_CASE(query_confirm__block_confirmable__unconfirmed_double_spend__success)
@@ -684,7 +690,7 @@ BOOST_AUTO_TEST_CASE(query_confirm__block_confirmable__spend_non_coinbase__succe
684690// // BOOST_REQUIRE(query.set_strong(2));
685691// //
686692// // // Confirmable because of intervening tx5 is unconfirmed double spend.
687- // // BOOST_REQUIRE (!query.block_confirmable(2));
693+ // // BOOST_REQUIRE_EQUAL (!query.block_confirmable(2));
688694// //}
689695
690696BOOST_AUTO_TEST_CASE (query_confirm__set_strong__unassociated__false)
0 commit comments