add constructor for state compressor service

This commit is contained in:
Charles Hall 2024-10-08 16:16:54 -07:00
parent c6e2f8372c
commit f702b6cccd
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
2 changed files with 15 additions and 5 deletions

View file

@ -72,6 +72,16 @@ impl CompressedStateEvent {
}
impl Service {
pub(crate) fn new(
db: &'static dyn Data,
stateinfo_cache_size: usize,
) -> Self {
Self {
db,
stateinfo_cache: Mutex::new(LruCache::new(stateinfo_cache_size)),
}
}
/// Returns a stack with info on shortstatehash, full state, added diff and
/// removed diff for the selected shortstatehash and each parent layer.
#[allow(clippy::type_complexity)]