mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-10-26 13:39:50 +00:00
Avoid changing overlay committed layer. (#5839)
* Avoid changing overlay committed layer. * basic test * Add some tx in the test. * only update from backend value on missing entry in both layer. deleted entry is replace by empty vec. * test and review changes * additional test and review change * remove test on changing existing value, it does not always panic depending on existing content * Update primitives/state-machine/src/overlayed_changes.rs * Update primitives/state-machine/src/overlayed_changes.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
1 parent
71d7dc1dfc
commit
c05ec630ff
4 files changed
+139
-25
No files matched your search
@@ -262,9 +262,8 @@ impl Externalities for BasicExternalities {
|
||||
key: Vec<u8>,
|
||||
value: Vec<u8>,
|
||||
) {
|
||||
let previous = self.storage(&key).unwrap_or_default();
|
||||
let new = crate::ext::append_to_storage(previous, value).expect("Failed to append to storage");
|
||||
self.place_storage(key.clone(), Some(new));
|
||||
let previous = self.inner.top.entry(key).or_default();
|
||||
crate::ext::append_to_storage(previous, value).expect("Failed to append to storage");
|
||||
}
|
||||
|
||||
fn chain_id(&self) -> u64 { 42 }
|
||||
|
||||
Reference in new issue
Block a user