@@ -6793,6 +6793,7 @@ pub fn pox_4_scenario_test_setup_nakamoto<'a>(
6793
6793
pox_constants. pox_3_activation_height = 26 ;
6794
6794
pox_constants. v3_unlock_height = 27 ;
6795
6795
pox_constants. pox_4_activation_height = 41 ;
6796
+ pox_constants. prepare_length = 5 ;
6796
6797
let mut boot_plan = NakamotoBootPlan :: new ( test_name)
6797
6798
. with_test_stackers ( test_stackers)
6798
6799
. with_test_signers ( test_signers. clone ( ) )
@@ -6807,6 +6808,8 @@ pub fn pox_4_scenario_test_setup_nakamoto<'a>(
6807
6808
boot_plan. initial_balances = initial_balances;
6808
6809
boot_plan. pox_constants = pox_constants. clone ( ) ;
6809
6810
burnchain. pox_constants = pox_constants. clone ( ) ;
6811
+ peer_config. burnchain = burnchain. clone ( ) ;
6812
+ peer_config. test_signers = Some ( test_signers. clone ( ) ) ;
6810
6813
6811
6814
info ! ( "---- Booting into Nakamoto Peer ----" ) ;
6812
6815
let mut peer = boot_plan. boot_into_nakamoto_peer ( vec ! [ ] , Some ( observer) ) ;
@@ -8873,6 +8876,7 @@ pub fn prepare_pox4_test<'a>(
8873
8876
pox_constants. pox_3_activation_height = 26 ;
8874
8877
pox_constants. v3_unlock_height = 27 ;
8875
8878
pox_constants. pox_4_activation_height = 41 ;
8879
+ pox_constants. prepare_length = 5 ;
8876
8880
let mut boot_plan = NakamotoBootPlan :: new ( test_name)
8877
8881
. with_test_stackers ( test_stackers)
8878
8882
. with_test_signers ( test_signers. clone ( ) )
@@ -9427,6 +9431,17 @@ fn test_scenario_five(use_nakamoto: bool) {
9427
9431
use_nakamoto,
9428
9432
) ;
9429
9433
9434
+ // Add to test signers
9435
+ if let Some ( ref mut test_signers) = test_signers. as_mut ( ) {
9436
+ test_signers. signer_keys . extend ( vec ! [
9437
+ alice. private_key. clone( ) ,
9438
+ bob. private_key. clone( ) ,
9439
+ carl. private_key. clone( ) ,
9440
+ david. private_key. clone( ) ,
9441
+ eve. private_key. clone( ) ,
9442
+ ] ) ;
9443
+ }
9444
+
9430
9445
// Lock periods for each stacker
9431
9446
let carl_lock_period = 3 ;
9432
9447
let frank_lock_period = 1 ;
@@ -9684,6 +9699,12 @@ fn test_scenario_five(use_nakamoto: bool) {
9684
9699
. reward_cycle_to_block_height ( next_reward_cycle as u64 )
9685
9700
. saturating_sub ( peer_config. burnchain . pox_constants . prepare_length as u64 )
9686
9701
. wrapping_add ( 2 ) ;
9702
+ info ! (
9703
+ "Scenario five: submitting stacking txs." ;
9704
+ "target_height" => target_height,
9705
+ "next_reward_cycle" => next_reward_cycle,
9706
+ "prepare_length" => peer_config. burnchain. pox_constants. prepare_length,
9707
+ ) ;
9687
9708
let ( latest_block, tx_block, _receipts) = advance_to_block_height (
9688
9709
& mut peer,
9689
9710
& observer,
@@ -9765,12 +9786,15 @@ fn test_scenario_five(use_nakamoto: bool) {
9765
9786
alice. nonce += 1 ;
9766
9787
bob. nonce += 1 ;
9767
9788
carl. nonce += 1 ;
9768
-
9769
9789
// Mine vote txs & advance to the reward set calculation of the next reward cycle
9770
9790
let target_height = peer
9771
9791
. config
9772
9792
. burnchain
9773
9793
. reward_cycle_to_block_height ( next_reward_cycle as u64 ) ;
9794
+ info ! (
9795
+ "Scenario five: submitting votes. Target height: {}" ,
9796
+ target_height
9797
+ ) ;
9774
9798
let ( latest_block, tx_block, _receipts) = advance_to_block_height (
9775
9799
& mut peer,
9776
9800
& observer,
@@ -9878,7 +9902,11 @@ fn test_scenario_five(use_nakamoto: bool) {
9878
9902
. reward_cycle_to_block_height ( next_reward_cycle as u64 )
9879
9903
. saturating_sub ( peer_config. burnchain . pox_constants . prepare_length as u64 )
9880
9904
. wrapping_add ( 2 ) ;
9881
- let ( latest_block, tx_block, _receipts) = advance_to_block_height (
9905
+ info ! (
9906
+ "Scenario five: submitting extend and aggregate commit txs. Target height: {}" ,
9907
+ target_height
9908
+ ) ;
9909
+ let ( latest_block, tx_block, receipts) = advance_to_block_height (
9882
9910
& mut peer,
9883
9911
& observer,
9884
9912
& txs,
@@ -9888,17 +9916,19 @@ fn test_scenario_five(use_nakamoto: bool) {
9888
9916
) ;
9889
9917
9890
9918
// Check that all of David's stackers are stacked
9891
- for ( stacker, stacker_lock_period) in davids_stackers {
9919
+ for ( idx , ( stacker, stacker_lock_period) ) in davids_stackers. iter ( ) . enumerate ( ) {
9892
9920
let ( pox_address, first_reward_cycle, lock_period, _indices) =
9893
- get_stacker_info_pox_4 ( & mut peer, & stacker. principal ) . expect ( "Failed to find stacker" ) ;
9921
+ get_stacker_info_pox_4 ( & mut peer, & stacker. principal )
9922
+ . expect ( format ! ( "Failed to find stacker {}" , idx) . as_str ( ) ) ;
9894
9923
assert_eq ! ( first_reward_cycle, reward_cycle) ;
9895
9924
assert_eq ! ( pox_address, david. pox_address) ;
9896
9925
assert_eq ! ( lock_period, * stacker_lock_period) ;
9897
9926
}
9898
9927
// Check that all of Eve's stackers are stacked
9899
- for ( stacker, stacker_lock_period) in eves_stackers {
9928
+ for ( idx , ( stacker, stacker_lock_period) ) in eves_stackers. iter ( ) . enumerate ( ) {
9900
9929
let ( pox_address, first_reward_cycle, lock_period, _indices) =
9901
- get_stacker_info_pox_4 ( & mut peer, & stacker. principal ) . expect ( "Failed to find stacker" ) ;
9930
+ get_stacker_info_pox_4 ( & mut peer, & stacker. principal )
9931
+ . expect ( format ! ( "Failed to find stacker {}" , idx) . as_str ( ) ) ;
9902
9932
assert_eq ! ( first_reward_cycle, reward_cycle) ;
9903
9933
assert_eq ! ( pox_address, eve. pox_address) ;
9904
9934
assert_eq ! ( lock_period, * stacker_lock_period) ;
@@ -9970,6 +10000,10 @@ fn test_scenario_five(use_nakamoto: bool) {
9970
10000
. burnchain
9971
10001
. reward_cycle_to_block_height ( next_reward_cycle as u64 ) ;
9972
10002
// Submit vote transactions
10003
+ info ! (
10004
+ "Scenario five: submitting votes. Target height: {}" ,
10005
+ target_height
10006
+ ) ;
9973
10007
let ( latest_block, tx_block, _receipts) = advance_to_block_height (
9974
10008
& mut peer,
9975
10009
& observer,
@@ -10085,7 +10119,8 @@ fn test_scenario_five(use_nakamoto: bool) {
10085
10119
( heidi. clone ( ) , heidi_lock_period) ,
10086
10120
] ;
10087
10121
10088
- let ( latest_block, tx_block, _receipts) = advance_to_block_height (
10122
+ info ! ( "Scenario five: submitting increase and aggregate-commit txs" ) ;
10123
+ let ( latest_block, tx_block, receipts) = advance_to_block_height (
10089
10124
& mut peer,
10090
10125
& observer,
10091
10126
& txs,
@@ -10116,6 +10151,6 @@ fn test_scenario_five(use_nakamoto: bool) {
10116
10151
assert_eq ! ( pox_address, carl. pox_address) ;
10117
10152
10118
10153
// Assert that carl's error is err(40)
10119
- let carl_increase_err = tx_block . receipts [ 1 ] . clone ( ) . result ;
10154
+ let carl_increase_err = receipts[ 1 ] . clone ( ) . result ;
10120
10155
assert_eq ! ( carl_increase_err, Value :: error( Value :: Int ( 40 ) ) . unwrap( ) ) ;
10121
10156
}
0 commit comments