We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 35b357d commit 464262aCopy full SHA for 464262a
crates/starknet_patricia_storage/src/map_storage.rs
@@ -219,6 +219,14 @@ impl<S: Storage> CachedStorage<S> {
219
pub fn total_writes(&self) -> u128 {
220
self.writes
221
}
222
+
223
+ pub fn flush_to_cache(&mut self, map: DbHashMap) {
224
+ let cache =
225
+ Arc::get_mut(&mut self.cache).expect("Failed to get mutable reference to cache.");
226
+ map.into_iter().for_each(|(key, value)| {
227
+ cache.put(key, Some(value));
228
+ });
229
+ }
230
231
232
impl<S: Storage> Storage for CachedStorage<S> {
0 commit comments