snops_checkpoint/
lib.rs

1use std::{
2    fmt::Display,
3    path::{Path, PathBuf},
4};
5
6#[cfg(test)]
7mod retention_tests;
8
9pub mod errors;
10mod header;
11mod manager;
12mod retention;
13
14pub use header::*;
15pub use manager::*;
16pub use retention::*;
17
18#[cfg(feature = "write")]
19pub(crate) mod aleo;
20#[cfg(feature = "write")]
21mod checkpoint;
22#[cfg(feature = "write")]
23mod content;
24#[cfg(feature = "write")]
25mod ledger;
26#[cfg(feature = "write")]
27pub use checkpoint::*;
28#[cfg(feature = "write")]
29pub use content::*;
30
31pub fn path_from_height<D: Display>(path: &Path, height: D) -> Option<PathBuf> {
32    path.parent()
33        .map(|p| p.join(format!("{height}.checkpoint")))
34}