@@ -81,7 +81,7 @@ pub fn path_join(dir: &str, path: &str) -> String {
81
81
82
82
// copy src to dest
83
83
pub fn copy_dir ( src_dir : & str , dest_dir : & str ) -> Result < ( ) , io:: Error > {
84
- eprintln ! ( "Copy directory {} to {}" , src_dir , dest_dir ) ;
84
+ eprintln ! ( "Copy directory {src_dir } to {dest_dir}" ) ;
85
85
86
86
let mut dir_queue = VecDeque :: new ( ) ;
87
87
dir_queue. push_back ( "/" . to_string ( ) ) ;
@@ -91,7 +91,7 @@ pub fn copy_dir(src_dir: &str, dest_dir: &str) -> Result<(), io::Error> {
91
91
let next_src_dir = path_join ( & src_dir, & next_dir) ;
92
92
let next_dest_dir = path_join ( & dest_dir, & next_dir) ;
93
93
94
- eprintln ! ( "mkdir {}" , & next_dest_dir ) ;
94
+ eprintln ! ( "mkdir {next_dest_dir}" ) ;
95
95
fs:: create_dir_all ( & next_dest_dir) ?;
96
96
97
97
for dirent_res in fs:: read_dir ( & next_src_dir) ? {
@@ -100,11 +100,11 @@ pub fn copy_dir(src_dir: &str, dest_dir: &str) -> Result<(), io::Error> {
100
100
let md = fs:: metadata ( & path) ?;
101
101
if md. is_dir ( ) {
102
102
let frontier = path_join ( & next_dir, & dirent. file_name ( ) . to_str ( ) . unwrap ( ) ) ;
103
- eprintln ! ( "push {}" , & frontier ) ;
103
+ eprintln ! ( "push {frontier}" ) ;
104
104
dir_queue. push_back ( frontier) ;
105
105
} else {
106
106
let dest_path = path_join ( & next_dest_dir, & dirent. file_name ( ) . to_str ( ) . unwrap ( ) ) ;
107
- eprintln ! ( "copy {} to {}" , & path. to_str( ) . unwrap( ) , & dest_path ) ;
107
+ eprintln ! ( "copy {} to {dest_path }" , & path. to_str( ) . unwrap( ) ) ;
108
108
fs:: copy ( path, dest_path) ?;
109
109
}
110
110
}
@@ -583,11 +583,10 @@ impl TestStacksNode {
583
583
) ;
584
584
585
585
test_debug ! (
586
- "Miner {}: Block commit transaction builds on {},{} (parent snapshot is {:?})" ,
586
+ "Miner {}: Block commit transaction builds on {},{} (parent snapshot is {parent_block_snapshot_opt :?})" ,
587
587
miner. id,
588
588
block_commit_op. parent_block_ptr,
589
- block_commit_op. parent_vtxindex,
590
- & parent_block_snapshot_opt
589
+ block_commit_op. parent_vtxindex
591
590
) ;
592
591
self . commit_ops . insert (
593
592
block_commit_op. block_header_hash . clone ( ) ,
@@ -767,16 +766,15 @@ pub fn preprocess_stacks_block_data(
767
766
{
768
767
Some ( sn) => sn,
769
768
None => {
770
- test_debug ! ( "Block commit did not win sorition: {:?}" , block_commit_op ) ;
769
+ test_debug ! ( "Block commit did not win sorition: {block_commit_op :?}" ) ;
771
770
return None ;
772
771
}
773
772
} ;
774
773
775
774
// "discover" this stacks block
776
775
test_debug ! (
777
- "\n \n Preprocess Stacks block {}/{} ({})" ,
776
+ "\n \n Preprocess Stacks block {}/{block_hash } ({})" ,
778
777
& commit_snapshot. consensus_hash,
779
- & block_hash,
780
778
StacksBlockHeader :: make_index_block_hash( & commit_snapshot. consensus_hash, & block_hash)
781
779
) ;
782
780
let block_res = node
@@ -793,8 +791,7 @@ pub fn preprocess_stacks_block_data(
793
791
// "discover" this stacks microblock stream
794
792
for mblock in stacks_microblocks. iter ( ) {
795
793
test_debug ! (
796
- "Preprocess Stacks microblock {}-{} (seq {})" ,
797
- & block_hash,
794
+ "Preprocess Stacks microblock {block_hash}-{} (seq {})" ,
798
795
mblock. block_hash( ) ,
799
796
mblock. header. sequence
800
797
) ;
@@ -828,11 +825,9 @@ pub fn check_block_state_index_root(
828
825
. read_block_root_hash ( & index_block_hash)
829
826
. unwrap ( ) ;
830
827
test_debug ! (
831
- "checking {}/{} state root: expecting {}, got {}" ,
832
- consensus_hash,
828
+ "checking {consensus_hash}/{} state root: expecting {}, got {state_root}" ,
833
829
& stacks_header. block_hash( ) ,
834
- & stacks_header. state_index_root,
835
- & state_root
830
+ & stacks_header. state_index_root
836
831
) ;
837
832
state_root == stacks_header. state_index_root
838
833
}
@@ -888,9 +883,8 @@ pub fn check_mining_reward(
888
883
889
884
let mut total: u128 = 10_000_000_000 - spent_total;
890
885
test_debug ! (
891
- "Miner {} has spent {} in total so far" ,
892
- & miner. origin_address( ) . unwrap( ) ,
893
- spent_total
886
+ "Miner {} has spent {spent_total} in total so far" ,
887
+ & miner. origin_address( ) . unwrap( )
894
888
) ;
895
889
896
890
if block_height >= MINER_REWARD_MATURITY {
@@ -908,23 +902,19 @@ pub fn check_mining_reward(
908
902
let reward = recipient. coinbase + anchored + ( 3 * streamed / 5 ) ;
909
903
910
904
test_debug ! (
911
- "Miner {} received a reward {} = {} + {} + {} at block {}" ,
905
+ "Miner {} received a reward {reward } = {} + {anchored } + {} at block {i }" ,
912
906
& recipient. address. to_string( ) ,
913
- reward,
914
907
recipient. coinbase,
915
- anchored,
916
908
( 3 * streamed / 5 ) ,
917
- i
918
909
) ;
919
910
total += reward;
920
911
found = true ;
921
912
}
922
913
}
923
914
if !found {
924
915
test_debug ! (
925
- "Miner {} received no reward at block {}" ,
926
- miner. origin_address( ) . unwrap( ) ,
927
- i
916
+ "Miner {} received no reward at block {i}" ,
917
+ miner. origin_address( ) . unwrap( )
928
918
) ;
929
919
}
930
920
}
@@ -945,11 +935,9 @@ pub fn check_mining_reward(
945
935
& parent_reward. block_hash ,
946
936
) ;
947
937
test_debug ! (
948
- "Miner {} received a produced-stream reward {} from {} confirmed at {}" ,
938
+ "Miner {} received a produced-stream reward {parent_streamed } from {} confirmed at {confirmed_block_height }" ,
949
939
miner. origin_address( ) . unwrap( ) . to_string( ) ,
950
- parent_streamed,
951
- heights. get( & parent_ibh) . unwrap( ) ,
952
- confirmed_block_height
940
+ heights. get( & parent_ibh) . unwrap( )
953
941
) ;
954
942
total += parent_streamed;
955
943
}
@@ -967,7 +955,7 @@ pub fn check_mining_reward(
967
955
return total == 0 ;
968
956
} else {
969
957
if amount != total {
970
- test_debug ! ( "Amount {} != {}" , amount , total ) ;
958
+ test_debug ! ( "Amount {amount } != {total}" ) ;
971
959
return false ;
972
960
}
973
961
return true ;
@@ -1091,16 +1079,14 @@ pub fn make_smart_contract_with_version(
1091
1079
(begin (var-set bar (/ x y)) (ok (var-get bar))))" ;
1092
1080
1093
1081
test_debug ! (
1094
- "Make smart contract block at hello-world-{}-{}" ,
1095
- burnchain_height,
1096
- stacks_block_height
1082
+ "Make smart contract block at hello-world-{burnchain_height}-{stacks_block_height}"
1097
1083
) ;
1098
1084
1099
1085
let mut tx_contract = StacksTransaction :: new (
1100
1086
TransactionVersion :: Testnet ,
1101
1087
miner. as_transaction_auth ( ) . unwrap ( ) ,
1102
1088
TransactionPayload :: new_smart_contract (
1103
- & format ! ( "hello-world-{}-{}" , burnchain_height , stacks_block_height ) ,
1089
+ & format ! ( "hello-world-{burnchain_height }-{stacks_block_height}" ) ,
1104
1090
& contract. to_string ( ) ,
1105
1091
version,
1106
1092
)
@@ -1140,7 +1126,7 @@ pub fn make_contract_call(
1140
1126
miner. as_transaction_auth ( ) . unwrap ( ) ,
1141
1127
TransactionPayload :: new_contract_call (
1142
1128
addr. clone ( ) ,
1143
- & format ! ( "hello-world-{}-{}" , burnchain_height , stacks_block_height ) ,
1129
+ & format ! ( "hello-world-{burnchain_height }-{stacks_block_height}" ) ,
1144
1130
"set-bar" ,
1145
1131
vec ! [ Value :: Int ( arg1) , Value :: Int ( arg2) ] ,
1146
1132
)
0 commit comments