@@ -576,7 +576,7 @@ mod tests {
576576
577577 #[ cfg( feature = "rand-std" ) ]
578578 fn pmt_test ( tx_count : usize ) {
579- let mut rng = secp256k1:: rand:: thread_rng ( ) ;
579+ let mut rng = secp256k1:: rand:: rng ( ) ;
580580 // Create some fake tx ids
581581 let tx_ids = ( 1 ..=tx_count)
582582 . map ( |i| format ! ( "{:064x}" , i) . parse :: < Txid > ( ) . unwrap ( ) )
@@ -600,7 +600,7 @@ mod tests {
600600 // Generate `att / 2` random bits
601601 let rand_bits = match att / 2 {
602602 0 => 0 ,
603- bits => rng. gen :: < u64 > ( ) >> ( 64 - bits) ,
603+ bits => rng. random :: < u64 > ( ) >> ( 64 - bits) ,
604604 } ;
605605 let include = rand_bits == 0 ;
606606 matches[ j] = include;
@@ -748,8 +748,8 @@ mod tests {
748748 impl PartialMerkleTree {
749749 /// Flip one bit in one of the hashes - this should break the authentication
750750 fn damage ( & mut self , rng : & mut ThreadRng ) {
751- let n = rng. gen_range ( 0 ..self . hashes . len ( ) ) ;
752- let bit = rng. gen :: < u8 > ( ) ;
751+ let n = rng. random_range ( 0 ..self . hashes . len ( ) ) ;
752+ let bit = rng. random :: < u8 > ( ) ;
753753 let hashes = & mut self . hashes ;
754754 let mut hash = hashes[ n] . to_byte_array ( ) ;
755755 hash[ ( bit >> 3 ) as usize ] ^= 1 << ( bit & 7 ) ;
0 commit comments