mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 09:21:05 +00:00
Make New Storage Layer Truly Default (#11918)
* with storage layer truly default * fmt Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -29,8 +29,7 @@ pub use crate::{
|
||||
result,
|
||||
},
|
||||
traits::{
|
||||
CallMetadata, DispatchableWithStorageLayer, GetCallMetadata, GetCallName,
|
||||
GetStorageVersion, UnfilteredDispatchable,
|
||||
CallMetadata, GetCallMetadata, GetCallName, GetStorageVersion, UnfilteredDispatchable,
|
||||
},
|
||||
weights::{
|
||||
ClassifyDispatch, DispatchInfo, GetDispatchInfo, PaysFee, PostDispatchInfo,
|
||||
@@ -1473,9 +1472,9 @@ macro_rules! decl_module {
|
||||
$ignore:ident
|
||||
$mod_type:ident<$trait_instance:ident $(, $instance:ident)?> $fn_name:ident $origin:ident $system:ident [ $( $param_name:ident),* ]
|
||||
) => {
|
||||
// We execute all dispatchable in at least one storage layer, allowing them
|
||||
// We execute all dispatchable in a new storage layer, allowing them
|
||||
// to return an error at any point, and undoing any storage changes.
|
||||
$crate::storage::in_storage_layer(|| {
|
||||
$crate::storage::with_storage_layer(|| {
|
||||
<$mod_type<$trait_instance $(, $instance)?>>::$fn_name( $origin $(, $param_name )* ).map(Into::into).map_err(Into::into)
|
||||
})
|
||||
};
|
||||
|
||||
@@ -96,9 +96,8 @@ mod dispatch;
|
||||
#[allow(deprecated)]
|
||||
pub use dispatch::EnsureOneOf;
|
||||
pub use dispatch::{
|
||||
AsEnsureOriginWithArg, DispatchableWithStorageLayer, EitherOf, EitherOfDiverse, EnsureOrigin,
|
||||
EnsureOriginWithArg, MapSuccess, NeverEnsureOrigin, OriginTrait, TryMapSuccess,
|
||||
UnfilteredDispatchable,
|
||||
AsEnsureOriginWithArg, EitherOf, EitherOfDiverse, EnsureOrigin, EnsureOriginWithArg,
|
||||
MapSuccess, NeverEnsureOrigin, OriginTrait, TryMapSuccess, UnfilteredDispatchable,
|
||||
};
|
||||
|
||||
mod voting;
|
||||
|
||||
@@ -236,23 +236,6 @@ pub trait UnfilteredDispatchable {
|
||||
fn dispatch_bypass_filter(self, origin: Self::Origin) -> DispatchResultWithPostInfo;
|
||||
}
|
||||
|
||||
/// Type that can be dispatched with an additional storage layer which is used to execute the call.
|
||||
pub trait DispatchableWithStorageLayer {
|
||||
/// The origin type of the runtime, (i.e. `frame_system::Config::Origin`).
|
||||
type Origin;
|
||||
|
||||
/// Same as `dispatch` from the [`frame_support::dispatch::Dispatchable`] trait, but
|
||||
/// specifically spawns a new storage layer to execute the call inside of.
|
||||
fn dispatch_with_storage_layer(self, origin: Self::Origin) -> DispatchResultWithPostInfo;
|
||||
|
||||
/// Same as `dispatch_bypass_filter` from the [`UnfilteredDispatchable`] trait, but specifically
|
||||
/// spawns a new storage layer to execute the call inside of.
|
||||
fn dispatch_bypass_filter_with_storage_layer(
|
||||
self,
|
||||
origin: Self::Origin,
|
||||
) -> DispatchResultWithPostInfo;
|
||||
}
|
||||
|
||||
/// Methods available on `frame_system::Config::Origin`.
|
||||
pub trait OriginTrait: Sized {
|
||||
/// Runtime call type, as in `frame_system::Config::Call`
|
||||
|
||||
Reference in New Issue
Block a user