@@ -11,7 +11,7 @@ use primitives::{
1111 transaction:: native_transaction:: NativeTransaction , Action ,
1212 SignedTransaction , Transaction ,
1313} ;
14- use rand:: { seq:: SliceRandom , thread_rng , Rng , RngCore , SeedableRng } ;
14+ use rand:: { rng , seq:: SliceRandom , Rng , RngCore , SeedableRng } ;
1515use rand_chacha:: ChaChaRng ;
1616use rand_xorshift:: XorShiftRng ;
1717use std:: {
@@ -198,7 +198,7 @@ fn test_insert_query_random() {
198198 let mut tx_vec: Vec < SignedTransaction > = vec ! [ ] ;
199199
200200 for _ in 0 ..operation_num {
201- let operation = match operation_rng. gen :: < u32 > ( ) % 4 {
201+ let operation = match operation_rng. random :: < u32 > ( ) % 4 {
202202 0 => Operation :: Len ,
203203 1 => Operation :: ContainsKey ,
204204 2 => Operation :: Insert ,
@@ -267,7 +267,7 @@ fn test_insert_remove_query_random() {
267267 let mut tx_vec: Vec < SignedTransaction > = vec ! [ ] ;
268268
269269 for _ in 0 ..operation_num {
270- let operation = match operation_rng. gen :: < u32 > ( ) % 7 {
270+ let operation = match operation_rng. random :: < u32 > ( ) % 7 {
271271 0 => Operation :: Len ,
272272 1 => Operation :: ContainsKey ,
273273 2 ..=3 => Operation :: Insert ,
@@ -391,7 +391,7 @@ fn test_apply_op_change_value() {
391391 }
392392 // Test update value
393393 let mut indicies: Vec < _ > = ( 0u32 ..200 ) . collect ( ) ;
394- indicies. shuffle ( & mut thread_rng ( ) ) ;
394+ indicies. shuffle ( & mut rng ( ) ) ;
395395 for i in indicies {
396396 let should_fail = i % 3 == 0 ;
397397 let update = |node : & mut Node < _ > | {
@@ -439,7 +439,7 @@ fn test_apply_op_change_weight() {
439439 }
440440 // Test update value
441441 let mut indicies: Vec < _ > = ( 0u32 ..200 ) . collect ( ) ;
442- indicies. shuffle ( & mut thread_rng ( ) ) ;
442+ indicies. shuffle ( & mut rng ( ) ) ;
443443 for i in indicies {
444444 let should_fail = i % 3 == 0 ;
445445 let update = |node : & mut Node < _ > | {
@@ -489,7 +489,7 @@ fn test_apply_op_change_key() {
489489 }
490490 // Test update value
491491 let mut indicies: Vec < _ > = ( 0u32 ..200 ) . collect ( ) ;
492- indicies. shuffle ( & mut thread_rng ( ) ) ;
492+ indicies. shuffle ( & mut rng ( ) ) ;
493493 for i in indicies {
494494 let should_fail = i % 3 == 0 ;
495495 let delete_item = i % 5 == 0 ;
@@ -578,7 +578,7 @@ fn test_apply_op_change_key_for_shared_key() {
578578 }
579579 // Test update value
580580 let mut indicies: Vec < _ > = ( 0u32 ..200 ) . collect ( ) ;
581- indicies. shuffle ( & mut thread_rng ( ) ) ;
581+ indicies. shuffle ( & mut rng ( ) ) ;
582582 for i in indicies {
583583 let should_fail = i % 3 == 0 ;
584584 let delete_item = i % 5 == 0 ;
0 commit comments