@@ -576,7 +576,7 @@ mod tests {
576
576
577
577
#[ cfg( feature = "rand-std" ) ]
578
578
fn pmt_test ( tx_count : usize ) {
579
- let mut rng = secp256k1:: rand:: thread_rng ( ) ;
579
+ let mut rng = secp256k1:: rand:: rng ( ) ;
580
580
// Create some fake tx ids
581
581
let tx_ids = ( 1 ..=tx_count)
582
582
. map ( |i| format ! ( "{:064x}" , i) . parse :: < Txid > ( ) . unwrap ( ) )
@@ -600,7 +600,7 @@ mod tests {
600
600
// Generate `att / 2` random bits
601
601
let rand_bits = match att / 2 {
602
602
0 => 0 ,
603
- bits => rng. gen :: < u64 > ( ) >> ( 64 - bits) ,
603
+ bits => rng. random :: < u64 > ( ) >> ( 64 - bits) ,
604
604
} ;
605
605
let include = rand_bits == 0 ;
606
606
matches[ j] = include;
@@ -748,8 +748,8 @@ mod tests {
748
748
impl PartialMerkleTree {
749
749
/// Flip one bit in one of the hashes - this should break the authentication
750
750
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 > ( ) ;
753
753
let hashes = & mut self . hashes ;
754
754
let mut hash = hashes[ n] . to_byte_array ( ) ;
755
755
hash[ ( bit >> 3 ) as usize ] ^= 1 << ( bit & 7 ) ;
0 commit comments