reth_optimism_storage/
lib.rs

1//! Standalone crate for Optimism-Storage Reth.
2
3#![doc(
4    html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
5    html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
6    issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
7)]
8#![cfg_attr(docsrs, feature(doc_cfg))]
9#![cfg_attr(not(feature = "std"), no_std)]
10#![cfg_attr(not(test), warn(unused_crate_dependencies))]
11
12mod chain;
13pub use chain::OpStorage;
14
15#[cfg(test)]
16mod tests {
17    use reth_codecs::{test_utils::UnusedBits, validate_bitflag_backwards_compat};
18
19    use reth_prune_types::{PruneCheckpoint, PruneMode, PruneSegment};
20
21    #[test]
22    fn test_ensure_backwards_compatibility() {
23        assert_eq!(PruneMode::bitflag_encoded_bytes(), 1);
24        assert_eq!(PruneSegment::bitflag_encoded_bytes(), 1);
25
26        // In case of failure, refer to the documentation of the
27        // [`validate_bitflag_backwards_compat`] macro for detailed instructions on handling
28        // it.
29
30        validate_bitflag_backwards_compat!(PruneCheckpoint, UnusedBits::NotZero);
31        validate_bitflag_backwards_compat!(PruneMode, UnusedBits::Zero);
32        validate_bitflag_backwards_compat!(PruneSegment, UnusedBits::Zero);
33    }
34}