mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 01:27:56 +00:00
State machine local child root cache. (#9107)
* cache root for child api. * minimal testing * Reset cache on test 'set_root'. * Update primitives/state-machine/src/trie_backend_essence.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update primitives/state-machine/src/trie_backend_essence.rs * Update primitives/state-machine/src/trie_backend_essence.rs * Renaming to 'reset_cache'. * correct rust fmt Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -326,6 +326,22 @@ pub mod tests {
|
||||
.unwrap(),
|
||||
Some(vec![142u8]),
|
||||
);
|
||||
// Change cache entry to check that caching is active.
|
||||
test_trie
|
||||
.essence
|
||||
.cache
|
||||
.write()
|
||||
.child_root
|
||||
.entry(b"sub1".to_vec())
|
||||
.and_modify(|value| {
|
||||
*value = None;
|
||||
});
|
||||
assert_eq!(
|
||||
test_trie
|
||||
.child_storage(&ChildInfo::new_default(CHILD_KEY_1), b"value3")
|
||||
.unwrap(),
|
||||
None,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user