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
@@ -245,9 +245,11 @@ pub mod pallet {
let sender = ensure_signed(origin)?;
let transactions = <Transactions<T>>::get(block).ok_or(Error::<T>::RenewedNotFound)?;
let info = transactions.get(index as usize).ok_or(Error::<T>::RenewedNotFound)?;
let extrinsic_index =
<frame_system::Pallet<T>>::extrinsic_index().ok_or(Error::<T>::BadContext)?;
Self::apply_fee(sender, info.size)?;
let extrinsic_index = <frame_system::Pallet<T>>::extrinsic_index().unwrap();
sp_io::transaction_index::renew(extrinsic_index, info.content_hash.into());
let mut index = 0;