1use std::slice;
23use cuprate_helper::network::Network;
45/// The hashes of the compiled in fast sync file.
6///
7/// See `build.rs` for how this file is generated.
8static FAST_SYNC_HASHES: &[[u8; 32]] = &include!(concat!(env!("OUT_DIR"), "/fast_sync_hashes.rs"));
910/// Set the fast-sync hashes according to the provided values.
11pub fn set_fast_sync_hashes(fast_sync: bool, network: Network) {
12 cuprate_fast_sync::set_fast_sync_hashes(if fast_sync && network == Network::Mainnet {
13 FAST_SYNC_HASHES
14 } else {
15&[]
16 });
17}
1819#[cfg(test)]
20mod test {
21use super::*;
2223/// Sanity check the fast sync hashes array.
24#[test]
25fn length() {
26assert!(FAST_SYNC_HASHES.len() > 6642);
27 }
28}