diff --git a/core/benches/crds_gossip_pull.rs b/core/benches/crds_gossip_pull.rs index 48a8d786c1..c0b64eaf8c 100644 --- a/core/benches/crds_gossip_pull.rs +++ b/core/benches/crds_gossip_pull.rs @@ -14,7 +14,7 @@ use test::Bencher; #[bench] fn bench_hash_as_u64(bencher: &mut Bencher) { let mut rng = thread_rng(); - let hashes: Vec<_> = std::iter::repeat_with(|| Hash::new_rand(&mut rng)) + let hashes: Vec<_> = std::iter::repeat_with(|| solana_sdk::hash::new_rand(&mut rng)) .take(1000) .collect(); bencher.iter(|| { @@ -34,7 +34,7 @@ fn bench_build_crds_filters(bencher: &mut Bencher) { for _ in 0..50_000 { crds_gossip_pull .purged_values - .push_back((Hash::new_rand(&mut rng), rng.gen())); + .push_back((solana_sdk::hash::new_rand(&mut rng), rng.gen())); } let mut num_inserts = 0; for _ in 0..90_000 { diff --git a/core/src/crds_gossip_pull.rs b/core/src/crds_gossip_pull.rs index f3acad5fb2..a62d1a61c4 100644 --- a/core/src/crds_gossip_pull.rs +++ b/core/src/crds_gossip_pull.rs @@ -626,7 +626,7 @@ mod test { } let mut rng = thread_rng(); for _ in 0..100 { - let hash = Hash::new_rand(&mut rng); + let hash = solana_sdk::hash::new_rand(&mut rng); assert_eq!(CrdsFilter::hash_as_u64(&hash), hash_as_u64_bitops(&hash)); } } @@ -638,7 +638,7 @@ mod test { assert_eq!(filter.mask, mask); let mut rng = thread_rng(); for _ in 0..10 { - let hash = Hash::new_rand(&mut rng); + let hash = solana_sdk::hash::new_rand(&mut rng); assert!(filter.test_mask(&hash)); } } @@ -797,7 +797,7 @@ mod test { let mut rng = thread_rng(); let crds_filter_set = CrdsFilterSet::new(/*num_items=*/ 9672788, /*max_bytes=*/ 8196); - let hash_values: Vec<_> = std::iter::repeat_with(|| Hash::new_rand(&mut rng)) + let hash_values: Vec<_> = std::iter::repeat_with(|| solana_sdk::hash::new_rand(&mut rng)) .take(1024) .collect(); for hash_value in &hash_values { @@ -849,7 +849,7 @@ mod test { for _ in 0..10_000 { crds_gossip_pull .purged_values - .push_back((Hash::new_rand(&mut rng), rng.gen())); + .push_back((solana_sdk::hash::new_rand(&mut rng), rng.gen())); } let mut num_inserts = 0; for _ in 0..20_000 { diff --git a/runtime/benches/bloom.rs b/runtime/benches/bloom.rs index f39e0795fb..a6f06e0c1f 100644 --- a/runtime/benches/bloom.rs +++ b/runtime/benches/bloom.rs @@ -102,7 +102,7 @@ fn bench_sigs_hashmap(bencher: &mut Bencher) { #[bench] fn bench_add_hash(bencher: &mut Bencher) { let mut rng = rand::thread_rng(); - let hash_values: Vec<_> = std::iter::repeat_with(|| Hash::new_rand(&mut rng)) + let hash_values: Vec<_> = std::iter::repeat_with(|| solana_sdk::hash::new_rand(&mut rng)) .take(1200) .collect(); let mut fail = 0; @@ -122,7 +122,7 @@ fn bench_add_hash(bencher: &mut Bencher) { #[bench] fn bench_add_hash_atomic(bencher: &mut Bencher) { let mut rng = rand::thread_rng(); - let hash_values: Vec<_> = std::iter::repeat_with(|| Hash::new_rand(&mut rng)) + let hash_values: Vec<_> = std::iter::repeat_with(|| solana_sdk::hash::new_rand(&mut rng)) .take(1200) .collect(); let mut fail = 0; diff --git a/runtime/src/bloom.rs b/runtime/src/bloom.rs index 680555f016..a49ccb9bfa 100644 --- a/runtime/src/bloom.rs +++ b/runtime/src/bloom.rs @@ -264,7 +264,7 @@ mod test { #[test] fn test_atomic_bloom() { let mut rng = rand::thread_rng(); - let hash_values: Vec<_> = std::iter::repeat_with(|| Hash::new_rand(&mut rng)) + let hash_values: Vec<_> = std::iter::repeat_with(|| solana_sdk::hash::new_rand(&mut rng)) .take(1200) .collect(); let bloom: AtomicBloom<_> = Bloom::::random(1287, 0.1, 7424).into(); @@ -279,7 +279,7 @@ mod test { for hash_value in hash_values { assert!(bloom.contains(&hash_value)); } - let false_positive = std::iter::repeat_with(|| Hash::new_rand(&mut rng)) + let false_positive = std::iter::repeat_with(|| solana_sdk::hash::new_rand(&mut rng)) .take(10_000) .filter(|hash_value| bloom.contains(hash_value)) .count(); @@ -291,7 +291,7 @@ mod test { let mut rng = rand::thread_rng(); let keys: Vec<_> = std::iter::repeat_with(|| rng.gen()).take(5).collect(); let mut bloom = Bloom::::new(9731, keys.clone()); - let hash_values: Vec<_> = std::iter::repeat_with(|| Hash::new_rand(&mut rng)) + let hash_values: Vec<_> = std::iter::repeat_with(|| solana_sdk::hash::new_rand(&mut rng)) .take(1000) .collect(); for hash_value in &hash_values { @@ -318,7 +318,7 @@ mod test { assert!(bloom.contains(hash_value)); } // Round trip, inserting new hash values. - let more_hash_values: Vec<_> = std::iter::repeat_with(|| Hash::new_rand(&mut rng)) + let more_hash_values: Vec<_> = std::iter::repeat_with(|| solana_sdk::hash::new_rand(&mut rng)) .take(1000) .collect(); let bloom: AtomicBloom<_> = bloom.into(); @@ -339,7 +339,7 @@ mod test { for hash_value in &more_hash_values { assert!(bloom.contains(hash_value)); } - let false_positive = std::iter::repeat_with(|| Hash::new_rand(&mut rng)) + let false_positive = std::iter::repeat_with(|| solana_sdk::hash::new_rand(&mut rng)) .take(10_000) .filter(|hash_value| bloom.contains(hash_value)) .count();