@@ -136,22 +136,22 @@ mod tests {
136136 use crate :: utils:: assert_are_close;
137137 use jormungandr_lib:: crypto:: { account:: Identifier , hash:: Hash } ;
138138 use snapshot_lib:: registration:: { Delegations , VotingRegistration } ;
139- use snapshot_lib:: { Fraction , RawSnapshot } ;
140139 use snapshot_lib:: Snapshot ;
140+ use snapshot_lib:: { Fraction , RawSnapshot } ;
141141 use test_strategy:: proptest;
142142
143- const DEFAULT_TEST_THRESHOLD : usize = 1 ;
144- const DEFAULT_SNAPSHOT_THRESHOLD : u64 = 1 ;
143+ const DEFAULT_TEST_THRESHOLD : usize = 1 ;
144+ const DEFAULT_SNAPSHOT_THRESHOLD : u64 = 1 ;
145145
146146 #[ proptest]
147147 fn test_all_active_voters ( raw_snapshot : RawSnapshot ) {
148-
149148 let snapshot = Snapshot :: from_raw_snapshot (
150149 raw_snapshot,
151150 DEFAULT_SNAPSHOT_THRESHOLD . into ( ) ,
152151 Fraction :: from ( 1 ) ,
153- & |_vk : & Identifier | String :: new ( )
154- ) . unwrap ( ) ;
152+ & |_vk : & Identifier | String :: new ( ) ,
153+ )
154+ . unwrap ( ) ;
155155
156156 let votes_count = snapshot
157157 . voting_keys ( )
@@ -169,7 +169,8 @@ mod tests {
169169 Rewards :: ONE ,
170170 )
171171 . unwrap ( ) ;
172- if number_of_voters > 0 { // number of voters always 0 ???
172+ if number_of_voters > 0 {
173+ // number of voters always 0 ???
173174 assert_are_close ( rewards. values ( ) . sum :: < Rewards > ( ) , Rewards :: ONE )
174175 } else {
175176 assert_eq ! ( rewards. len( ) , 0 ) ;
@@ -178,13 +179,13 @@ mod tests {
178179
179180 #[ proptest]
180181 fn test_all_inactive_voters ( raw_snapshot : RawSnapshot ) {
181-
182182 let snapshot = Snapshot :: from_raw_snapshot (
183183 raw_snapshot,
184184 DEFAULT_SNAPSHOT_THRESHOLD . into ( ) ,
185185 Fraction :: from ( 1 ) ,
186- & |_vk : & Identifier | String :: new ( )
187- ) . unwrap ( ) ;
186+ & |_vk : & Identifier | String :: new ( ) ,
187+ )
188+ . unwrap ( ) ;
188189
189190 let votes_count = VoteCount :: new ( ) ;
190191
@@ -201,13 +202,13 @@ mod tests {
201202
202203 #[ proptest]
203204 fn test_active_and_inactive_voters ( raw_snapshot : RawSnapshot ) {
204-
205205 let snapshot = Snapshot :: from_raw_snapshot (
206206 raw_snapshot,
207207 DEFAULT_SNAPSHOT_THRESHOLD . into ( ) ,
208208 Fraction :: from ( 1 ) ,
209- & |_vk : & Identifier | String :: new ( )
210- ) . unwrap ( ) ;
209+ & |_vk : & Identifier | String :: new ( ) ,
210+ )
211+ . unwrap ( ) ;
211212
212213 let voting_keys = snapshot. voting_keys ( ) . collect :: < Vec < _ > > ( ) ;
213214
@@ -217,7 +218,8 @@ mod tests {
217218 . map ( |( i, & key) | {
218219 (
219220 key. to_owned ( ) ,
220- if i % 2 == 0 { // generating a random set of half active & half inactive votes
221+ if i % 2 == 0 {
222+ // generating a random set of half active & half inactive votes
221223 HashSet :: from ( [ Hash :: from ( [ 0u8 ; 32 ] ) ] )
222224 } else {
223225 HashSet :: new ( )
@@ -385,13 +387,13 @@ mod tests {
385387
386388 #[ proptest]
387389 fn test_per_category_threshold ( raw_snapshot : RawSnapshot ) {
388-
389390 let snapshot = Snapshot :: from_raw_snapshot (
390391 raw_snapshot,
391392 DEFAULT_SNAPSHOT_THRESHOLD . into ( ) ,
392393 Fraction :: from ( 1 ) ,
393- & |_vk : & Identifier | String :: new ( )
394- ) . unwrap ( ) ;
394+ & |_vk : & Identifier | String :: new ( ) ,
395+ )
396+ . unwrap ( ) ;
395397
396398 use vit_servicing_station_tests:: common:: data:: ArbitrarySnapshotGenerator ;
397399
@@ -447,7 +449,12 @@ mod tests {
447449 let rewards = calc_voter_rewards (
448450 votes_count,
449451 voters. clone ( ) ,
450- Threshold :: new ( DEFAULT_TEST_THRESHOLD , per_challenge_threshold. clone ( ) , proposals. clone ( ) ) . unwrap ( ) ,
452+ Threshold :: new (
453+ DEFAULT_TEST_THRESHOLD ,
454+ per_challenge_threshold. clone ( ) ,
455+ proposals. clone ( ) ,
456+ )
457+ . unwrap ( ) ,
451458 Rewards :: ONE ,
452459 )
453460 . unwrap ( ) ;
0 commit comments