mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 01:01:04 +00:00
Make trie-cache resettable from backend (#14516)
* Add ability to reset trie-cache * comment * Update client/db/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> --------- Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -1124,6 +1124,13 @@ impl<Block: BlockT> Backend<Block> {
|
|||||||
Self::from_database(db as Arc<_>, canonicalization_delay, &db_config, needs_init)
|
Self::from_database(db as Arc<_>, canonicalization_delay, &db_config, needs_init)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Reset the shared trie cache.
|
||||||
|
pub fn reset_trie_cache(&self) {
|
||||||
|
if let Some(cache) = &self.shared_trie_cache {
|
||||||
|
cache.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Create new memory-backed client backend for tests.
|
/// Create new memory-backed client backend for tests.
|
||||||
#[cfg(any(test, feature = "test-helpers"))]
|
#[cfg(any(test, feature = "test-helpers"))]
|
||||||
pub fn new_test(blocks_pruning: u32, canonicalization_delay: u64) -> Self {
|
pub fn new_test(blocks_pruning: u32, canonicalization_delay: u64) -> Self {
|
||||||
|
|||||||
Reference in New Issue
Block a user