foundry_evm_core/backend/snapshot.rs
1//! Snapshot retention policy.
2
3/// What to do when reverting a state snapshot.
4///
5/// Whether to remove the state snapshot or keep it.
6#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
7pub enum RevertStateSnapshotAction {
8 /// Remove the state snapshot after reverting.
9 #[default]
10 RevertRemove,
11 /// Keep the state snapshot after reverting.
12 RevertKeep,
13}
14
15impl RevertStateSnapshotAction {
16 /// Returns `true` if the action is to keep the state snapshot.
17 pub const fn is_keep(&self) -> bool {
18 matches!(self, Self::RevertKeep)
19 }
20}