mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 02:17:58 +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:
@@ -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