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