mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 15:11:03 +00:00
reset cache when storage possibly change (fix init of tests). (#9665)
* reset cache when storage possibly change (fix init of tests). * remove backend_storage_mut * fix warn * remove remaining backend_storage_mut
This commit is contained in:
@@ -74,8 +74,9 @@ where
|
||||
|
||||
/// Apply the given transaction to this backend and set the root to the given value.
|
||||
pub fn apply_transaction(&mut self, root: H::Out, transaction: MemoryDB<H>) {
|
||||
self.backend_storage_mut().consolidate(transaction);
|
||||
self.essence.set_root(root);
|
||||
let mut storage = sp_std::mem::take(self).into_storage();
|
||||
storage.consolidate(transaction);
|
||||
*self = TrieBackend::new(storage, root);
|
||||
}
|
||||
|
||||
/// Compare with another in-memory backend.
|
||||
|
||||
Reference in New Issue
Block a user