@@ -233,7 +233,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
233
233
}
234
234
}
235
235
236
- pub fn wait_for_registered ( & mut self ) {
236
+ pub fn wait_for_registered ( & self ) {
237
237
let mut finished_signers = HashSet :: new ( ) ;
238
238
wait_for ( 120 , || {
239
239
self . send_status_request ( & finished_signers) ;
@@ -253,7 +253,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
253
253
}
254
254
255
255
/// Send a status request to the signers to ensure they are registered for both reward cycles.
256
- pub fn wait_for_registered_both_reward_cycles ( & mut self ) {
256
+ pub fn wait_for_registered_both_reward_cycles ( & self ) {
257
257
let mut finished_signers = HashSet :: new ( ) ;
258
258
wait_for ( 120 , || {
259
259
self . send_status_request ( & finished_signers) ;
@@ -279,7 +279,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
279
279
. expect ( "Timed out while waiting for the signers to be registered for both reward cycles" ) ;
280
280
}
281
281
282
- pub fn wait_for_cycle ( & mut self , timeout_secs : u64 , reward_cycle : u64 ) {
282
+ pub fn wait_for_cycle ( & self , timeout_secs : u64 , reward_cycle : u64 ) {
283
283
let mut finished_signers = HashSet :: new ( ) ;
284
284
wait_for ( timeout_secs, || {
285
285
self . send_status_request ( & finished_signers) ;
@@ -299,9 +299,9 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
299
299
} ) . unwrap ( ) ;
300
300
}
301
301
302
- pub fn mine_bitcoin_block ( & mut self ) {
302
+ pub fn mine_bitcoin_block ( & self ) {
303
303
let info = self . get_peer_info ( ) ;
304
- next_block_and ( & mut self . running_nodes . btc_regtest_controller , 60 , || {
304
+ next_block_and ( & self . running_nodes . btc_regtest_controller , 60 , || {
305
305
Ok ( get_chain_info ( & self . running_nodes . conf ) . burn_block_height > info. burn_block_height )
306
306
} )
307
307
. unwrap ( ) ;
@@ -314,7 +314,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
314
314
/// 1. Having a valid sortition
315
315
/// 2. The active miner is the winner of that sortition
316
316
/// 3. The active miner is building off of the prior tenure
317
- pub fn check_signer_states_normal ( & mut self ) {
317
+ pub fn check_signer_states_normal ( & self ) {
318
318
let ( state_machines, info_cur) = self . get_burn_updated_states ( ) ;
319
319
320
320
let sortition_latest =
@@ -375,7 +375,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
375
375
/// latest burn block:
376
376
/// 1. Having an invalid miner
377
377
/// 2. The active miner is the winner of the prior sortition
378
- pub fn check_signer_states_revert_to_prior ( & mut self ) {
378
+ pub fn check_signer_states_revert_to_prior ( & self ) {
379
379
let ( state_machines, info_cur) = self . get_burn_updated_states ( ) ;
380
380
381
381
let sortition_latest =
@@ -431,7 +431,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
431
431
432
432
/// Submit a stacks transfer just to trigger block production
433
433
pub fn submit_transfer_tx (
434
- & mut self ,
434
+ & self ,
435
435
sender_sk : & StacksPrivateKey ,
436
436
send_fee : u64 ,
437
437
send_amt : u64 ,
@@ -454,7 +454,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
454
454
/// Submit a burn block dependent contract for publishing
455
455
/// and wait until it is included in a block
456
456
pub fn submit_burn_block_contract_and_wait (
457
- & mut self ,
457
+ & self ,
458
458
sender_sk : & StacksPrivateKey ,
459
459
) -> Result < String , String > {
460
460
let http_origin = format ! ( "http://{}" , & self . running_nodes. conf. node. rpc_bind) ;
@@ -485,7 +485,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
485
485
/// Submit a burn block dependent contract-call
486
486
/// and wait until it is included in a block
487
487
pub fn submit_burn_block_call_and_wait (
488
- & mut self ,
488
+ & self ,
489
489
sender_sk : & StacksPrivateKey ,
490
490
) -> Result < String , String > {
491
491
let http_origin = format ! ( "http://{}" , & self . running_nodes. conf. node. rpc_bind) ;
@@ -582,7 +582,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
582
582
/// 1. Not having a sortition!
583
583
/// 2. The active miner is the winner of the last sortition
584
584
/// 3. The active miner is building off of the prior tenure
585
- pub fn check_signer_states_normal_missed_sortition ( & mut self ) {
585
+ pub fn check_signer_states_normal_missed_sortition ( & self ) {
586
586
let ( state_machines, info_cur) = self . get_burn_updated_states ( ) ;
587
587
let non_sortition_latest =
588
588
get_sortition_info_ch ( & self . running_nodes . conf , & info_cur. pox_consensus ) ;
@@ -653,7 +653,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
653
653
/// 2. The active miner is the winner of that sortition
654
654
/// 3. The active miner is building off of the prior tenure
655
655
pub fn check_signer_states_reorg (
656
- & mut self ,
656
+ & self ,
657
657
accepting_reorg : & [ StacksPublicKey ] ,
658
658
rejecting_reorg : & [ StacksPublicKey ] ,
659
659
) {
@@ -841,15 +841,15 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
841
841
}
842
842
843
843
fn mine_block_wait_on_processing (
844
- & mut self ,
844
+ & self ,
845
845
node_confs : & [ & NeonConfig ] ,
846
846
node_counters : & [ & Counters ] ,
847
847
timeout : Duration ,
848
848
) {
849
849
let blocks_len = test_observer:: get_blocks ( ) . len ( ) ;
850
850
let mined_block_time = Instant :: now ( ) ;
851
851
next_block_and_wait_for_commits (
852
- & mut self . running_nodes . btc_regtest_controller ,
852
+ & self . running_nodes . btc_regtest_controller ,
853
853
timeout. as_secs ( ) ,
854
854
node_confs,
855
855
node_counters,
@@ -872,7 +872,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
872
872
/// Chain information is captured before `f` is called, and then again after `f`
873
873
/// to ensure that the block was mined.
874
874
/// Note: this function does _not_ mine a BTC block.
875
- fn wait_for_nakamoto_block ( & mut self , timeout_secs : u64 , f : impl FnOnce ( ) -> ( ) ) {
875
+ fn wait_for_nakamoto_block ( & self , timeout_secs : u64 , f : impl FnOnce ( ) -> ( ) ) {
876
876
let blocks_before = self . running_nodes . counters . naka_mined_blocks . get ( ) ;
877
877
let info_before = self . get_peer_info ( ) ;
878
878
@@ -891,7 +891,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
891
891
/// Wait for a confirmed block and return a list of individual
892
892
/// signer signatures
893
893
fn wait_for_confirmed_block_v0 (
894
- & mut self ,
894
+ & self ,
895
895
block_signer_sighash : & Sha512Trunc256Sum ,
896
896
timeout : Duration ,
897
897
) -> Vec < MessageSignature > {
@@ -911,7 +911,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
911
911
/// Wait for a confirmed block and return a list of individual
912
912
/// signer signatures
913
913
fn wait_for_confirmed_block_with_hash (
914
- & mut self ,
914
+ & self ,
915
915
block_signer_sighash : & Sha512Trunc256Sum ,
916
916
timeout : Duration ,
917
917
) -> serde_json:: Map < String , serde_json:: Value > {
@@ -938,7 +938,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
938
938
panic ! ( "Timed out while waiting for confirmation of block with signer sighash = {block_signer_sighash}" )
939
939
}
940
940
941
- fn wait_for_validate_ok_response ( & mut self , timeout : Duration ) -> BlockValidateOk {
941
+ fn wait_for_validate_ok_response ( & self , timeout : Duration ) -> BlockValidateOk {
942
942
// Wait for the block to show up in the test observer
943
943
let t_start = Instant :: now ( ) ;
944
944
loop {
@@ -958,7 +958,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
958
958
}
959
959
960
960
fn wait_for_validate_reject_response (
961
- & mut self ,
961
+ & self ,
962
962
timeout : Duration ,
963
963
signer_signature_hash : Sha512Trunc256Sum ,
964
964
) -> BlockValidateReject {
@@ -983,14 +983,14 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
983
983
}
984
984
985
985
// Must be called AFTER booting the chainstate
986
- fn run_until_epoch_3_boundary ( & mut self ) {
986
+ fn run_until_epoch_3_boundary ( & self ) {
987
987
let epochs = self . running_nodes . conf . burnchain . epochs . clone ( ) . unwrap ( ) ;
988
988
let epoch_3 = & epochs[ StacksEpochId :: Epoch30 ] ;
989
989
990
990
let epoch_30_boundary = epoch_3. start_height - 1 ;
991
991
// advance to epoch 3.0 and trigger a sign round (cannot vote on blocks in pre epoch 3.0)
992
992
run_until_burnchain_height (
993
- & mut self . running_nodes . btc_regtest_controller ,
993
+ & self . running_nodes . btc_regtest_controller ,
994
994
& self . running_nodes . counters . blocks_processed ,
995
995
epoch_30_boundary,
996
996
& self . running_nodes . conf ,
0 commit comments