@@ -462,11 +462,15 @@ fn make_genesis_block_with_recipients(
462462 builder. epoch_finish ( epoch_tx) ;
463463
464464 let commit_outs = if let Some ( recipients) = recipients {
465- recipients
465+ let mut commit_outs = recipients
466466 . recipients
467467 . iter ( )
468468 . map ( |( a, _) | a. clone ( ) )
469- . collect ( )
469+ . collect :: < Vec < StacksAddress > > ( ) ;
470+ if commit_outs. len ( ) == 1 {
471+ commit_outs. push ( StacksAddress :: burn_address ( false ) )
472+ }
473+ commit_outs
470474 } else {
471475 vec ! [ ]
472476 } ;
@@ -668,11 +672,16 @@ fn make_stacks_block_with_input(
668672 builder. epoch_finish ( epoch_tx) ;
669673
670674 let commit_outs = if let Some ( recipients) = recipients {
671- recipients
675+ let mut commit_outs = recipients
672676 . recipients
673677 . iter ( )
674678 . map ( |( a, _) | a. clone ( ) )
675- . collect ( )
679+ . collect :: < Vec < StacksAddress > > ( ) ;
680+ if commit_outs. len ( ) == 1 {
681+ // Padding with burn address if required
682+ commit_outs. push ( StacksAddress :: burn_address ( false ) )
683+ }
684+ commit_outs
676685 } else if post_sunset_burn || burnchain. is_in_prepare_phase ( parent_height + 1 ) {
677686 test_debug ! ( "block-commit in {} will burn" , parent_height + 1 ) ;
678687 vec ! [ StacksAddress :: burn_address( false ) ]
@@ -992,7 +1001,7 @@ fn missed_block_commits() {
9921001 let ic = sort_db. index_handle_at_tip ( ) ;
9931002 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
9941003 assert_eq ! ( & pox_id. to_string( ) ,
995- "11111111111 " ,
1004+ "111111111111 " ,
9961005 "PoX ID should reflect the 5 reward cycles _with_ a known anchor block, plus the 'initial' known reward cycle at genesis" ) ;
9971006 }
9981007}
@@ -1152,7 +1161,7 @@ fn test_simple_setup() {
11521161 let ic = sort_db. index_handle_at_tip ( ) ;
11531162 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
11541163 assert_eq ! ( & pox_id. to_string( ) ,
1155- "11111111111 " ,
1164+ "111111111111 " ,
11561165 "PoX ID should reflect the 10 reward cycles _with_ a known anchor block, plus the 'initial' known reward cycle at genesis" ) ;
11571166 }
11581167
@@ -1161,7 +1170,7 @@ fn test_simple_setup() {
11611170 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
11621171 assert_eq ! (
11631172 & pox_id. to_string( ) ,
1164- "10000000000 " ,
1173+ "110000000000 " ,
11651174 "PoX ID should reflect the initial 'known' reward cycle at genesis"
11661175 ) ;
11671176 }
@@ -1189,10 +1198,11 @@ fn test_simple_setup() {
11891198 pox_id_string. push ( '1' ) ;
11901199 }
11911200
1201+ println ! ( "=> {}" , pox_id_string) ;
11921202 assert_eq ! (
11931203 pox_id_at_tip. to_string( ) ,
11941204 // right-pad pox_id_string to 11 characters
1195- format!( "{:0<11}" , pox_id_string)
1205+ format!( "1 {:0<11}" , pox_id_string)
11961206 ) ;
11971207 }
11981208}
@@ -1449,7 +1459,7 @@ fn test_sortition_with_reward_set() {
14491459 let ic = sort_db. index_handle_at_tip ( ) ;
14501460 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
14511461 assert_eq ! ( & pox_id. to_string( ) ,
1452- "11111111111 " ,
1462+ "111111111111 " ,
14531463 "PoX ID should reflect the 10 reward cycles _with_ a known anchor block, plus the 'initial' known reward cycle at genesis" ) ;
14541464 }
14551465}
@@ -1680,7 +1690,7 @@ fn test_sortition_with_burner_reward_set() {
16801690 let ic = sort_db. index_handle_at_tip ( ) ;
16811691 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
16821692 assert_eq ! ( & pox_id. to_string( ) ,
1683- "11111111111 " ,
1693+ "111111111111 " ,
16841694 "PoX ID should reflect the 10 reward cycles _with_ a known anchor block, plus the 'initial' known reward cycle at genesis" ) ;
16851695 }
16861696}
@@ -1940,7 +1950,7 @@ fn test_pox_btc_ops() {
19401950 let ic = sort_db. index_handle_at_tip ( ) ;
19411951 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
19421952 assert_eq ! ( & pox_id. to_string( ) ,
1943- "11111111111 " ,
1953+ "111111111111 " ,
19441954 "PoX ID should reflect the 5 reward cycles _with_ a known anchor block, plus the 'initial' known reward cycle at genesis" ) ;
19451955 }
19461956}
@@ -2236,7 +2246,7 @@ fn test_stx_transfer_btc_ops() {
22362246 let ic = sort_db. index_handle_at_tip ( ) ;
22372247 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
22382248 assert_eq ! ( & pox_id. to_string( ) ,
2239- "11111111111 " ,
2249+ "111111111111 " ,
22402250 "PoX ID should reflect the 5 reward cycles _with_ a known anchor block, plus the 'initial' known reward cycle at genesis" ) ;
22412251 }
22422252}
@@ -2724,7 +2734,7 @@ fn test_sortition_with_sunset() {
27242734 let ic = sort_db. index_handle_at_tip ( ) ;
27252735 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
27262736 assert_eq ! ( & pox_id. to_string( ) ,
2727- "11111111111111111 " ,
2737+ "111111111111111111 " ,
27282738 "PoX ID should reflect the 10 reward cycles _with_ a known anchor block, plus the 'initial' known reward cycle at genesis" ) ;
27292739 }
27302740}
@@ -3159,13 +3169,13 @@ fn test_pox_no_anchor_selected() {
31593169 {
31603170 let ic = sort_db. index_handle_at_tip ( ) ;
31613171 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
3162- assert_eq ! ( & pox_id. to_string( ) , "111 " ) ;
3172+ assert_eq ! ( & pox_id. to_string( ) , "1111 " ) ;
31633173 }
31643174
31653175 {
31663176 let ic = sort_db_blind. index_handle_at_tip ( ) ;
31673177 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
3168- assert_eq ! ( & pox_id. to_string( ) , "101 " ) ;
3178+ assert_eq ! ( & pox_id. to_string( ) , "1101 " ) ;
31693179 }
31703180
31713181 for ( sort_id, block) in stacks_blocks. iter ( ) {
@@ -3181,7 +3191,7 @@ fn test_pox_no_anchor_selected() {
31813191 {
31823192 let ic = sort_db_blind. index_handle_at_tip ( ) ;
31833193 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
3184- assert_eq ! ( & pox_id. to_string( ) , "111 " ) ;
3194+ assert_eq ! ( & pox_id. to_string( ) , "1111 " ) ;
31853195 }
31863196
31873197 let block_height = eval_at_chain_tip ( path_blinded, & sort_db_blind, "block-height" ) ;
@@ -3357,13 +3367,13 @@ fn test_pox_fork_out_of_order() {
33573367 {
33583368 let ic = sort_db. index_handle_at_tip ( ) ;
33593369 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
3360- assert_eq ! ( & pox_id. to_string( ) , "1111 " ) ;
3370+ assert_eq ! ( & pox_id. to_string( ) , "11111 " ) ;
33613371 }
33623372
33633373 {
33643374 let ic = sort_db_blind. index_handle_at_tip ( ) ;
33653375 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
3366- assert_eq ! ( & pox_id. to_string( ) , "1000 " ) ;
3376+ assert_eq ! ( & pox_id. to_string( ) , "11000 " ) ;
33673377 }
33683378
33693379 // now, we reveal to the blinded coordinator, but out of order.
@@ -3386,7 +3396,7 @@ fn test_pox_fork_out_of_order() {
33863396 {
33873397 let ic = sort_db_blind. index_handle_at_tip ( ) ;
33883398 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
3389- assert_eq ! ( & pox_id. to_string( ) , "1110 " ) ;
3399+ assert_eq ! ( & pox_id. to_string( ) , "11110 " ) ;
33903400 }
33913401
33923402 let block_height = eval_at_chain_tip ( path_blinded, & sort_db_blind, "block-height" ) ;
@@ -3417,7 +3427,7 @@ fn test_pox_fork_out_of_order() {
34173427 {
34183428 let ic = sort_db_blind. index_handle_at_tip ( ) ;
34193429 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
3420- assert_eq ! ( & pox_id. to_string( ) , "1110 " ) ;
3430+ assert_eq ! ( & pox_id. to_string( ) , "11110 " ) ;
34213431 }
34223432
34233433 let block_height = eval_at_chain_tip ( path_blinded, & sort_db_blind, "block-height" ) ;
@@ -3478,7 +3488,7 @@ fn test_pox_fork_out_of_order() {
34783488 {
34793489 let ic = sort_db_blind. index_handle_at_tip ( ) ;
34803490 let pox_id = ic. get_pox_id ( ) . unwrap ( ) ;
3481- assert_eq ! ( & pox_id. to_string( ) , "1111 " ) ;
3491+ assert_eq ! ( & pox_id. to_string( ) , "11111 " ) ;
34823492 }
34833493
34843494 let block_height = eval_at_chain_tip ( path_blinded, & sort_db_blind, "block-height" ) ;
0 commit comments