Implement try_mutate for storage value and storage double map (#5699)

* impl try_mutate for storage value and storage double map

* Docs + Reuse `try_mutate` in `mutate`
This commit is contained in:
Shawn Tabrizi
2020-04-20 15:05:20 +02:00
committed by GitHub
parent 319a00fb1c
commit 7d9aa81bfc
8 changed files with 116 additions and 33 deletions
+1 -5
View File
@@ -46,10 +46,6 @@ pub type DispatchResult = Result<(), sp_runtime::DispatchError>;
pub type DispatchErrorWithPostInfo =
sp_runtime::DispatchErrorWithPostInfo<crate::weights::PostDispatchInfo>;
/// A type that cannot be instantiated.
pub enum Never {}
/// Serializable version of Dispatchable.
/// This value can be used as a "function" in an extrinsic.
pub trait Callable<T> {
@@ -1316,7 +1312,7 @@ macro_rules! decl_module {
{
#[doc(hidden)]
#[codec(skip)]
__PhantomItem($crate::sp_std::marker::PhantomData<($trait_instance, $($instance)?)>, $crate::dispatch::Never),
__PhantomItem($crate::sp_std::marker::PhantomData<($trait_instance, $($instance)?)>, $crate::Never),
$( $generated_variants )*
}
};