transactional: Wrap pallet::calls directly in storage layers (#11927)

* transactional: Wrap `pallet::calls` directly in storage layers

Before this pr we only wrapped `pallet::calls` into storage layers when executing the calls with
`dispatch`. This pr is solving that by wrapping each call function inside a storage layer.

* Teach `BasicExternalities` transactions support

* Fix crates

* FMT

* Fix benchmarking tests

* Use correct span

* Support old decl macros

* Fix test

* Apply suggestions from code review

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/state-trie-migration/src/lib.rs

* Update frame/state-trie-migration/src/lib.rs

* Update frame/state-trie-migration/src/lib.rs

* Feedback

* Apply suggestions from code review

Co-authored-by: cheme <emericchevalier.pro@gmail.com>

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: cheme <emericchevalier.pro@gmail.com>
This commit is contained in:
Bastian Köcher
2022-08-10 22:27:01 +02:00
committed by GitHub
parent 043b1697c7
commit aa5f68a827
10 changed files with 316 additions and 294 deletions
@@ -638,6 +638,21 @@ impl OverlayedChanges {
}
}
#[cfg(feature = "std")]
impl From<sp_core::storage::Storage> for OverlayedChanges {
fn from(storage: sp_core::storage::Storage) -> Self {
Self {
top: storage.top.into(),
children: storage
.children_default
.into_iter()
.map(|(k, v)| (k, (v.data.into(), v.child_info)))
.collect(),
..Default::default()
}
}
}
#[cfg(feature = "std")]
fn retain_map<K, V, F>(map: &mut Map<K, V>, f: F)
where