transactional: Fix some nitpicks (#11163)

* transactional: Fix some nitpicks

This fixes some nitpicks related to the transactional storage stuff from me. As everything was
merged too fast, here are some nitpicks from me. First, the entire functionality is moved into its
own file to have a clear separation. Secondly I changed the `set_transactional_level` to not take
`Layer` by reference. Besides that I have added some docs etc.

* Add some comment

* Move tests

* 🤦
This commit is contained in:
Bastian Köcher
2022-04-04 22:28:57 +02:00
committed by GitHub
parent d3d3df5bfb
commit 9090c01ee7
3 changed files with 242 additions and 204 deletions
@@ -49,7 +49,7 @@ pub fn require_transactional(_attr: TokenStream, input: TokenStream) -> Result<T
let output = quote! {
#(#attrs)*
#vis #sig {
if !#crate_::storage::is_transactional() {
if !#crate_::storage::transactional::is_transactional() {
return Err(#crate_::sp_runtime::TransactionalError::NoLayer.into());
}
#block