diff --git a/core/src/buffer.rs b/core/src/buffer.rs index 88b83b7675d..41c31c47c2b 100644 --- a/core/src/buffer.rs +++ b/core/src/buffer.rs @@ -35,7 +35,7 @@ use scale_info::{ /// `E` is overflow error type. /// `N` is max len which a vector can have. #[derive(Clone, Default, Eq, Hash, Ord, PartialEq, PartialOrd, Decode, Encode, TypeInfo)] -#[cfg_attr(feature = "std", derive(serde::Serialize))] +#[cfg_attr(feature = "std", derive(serde::Serialize, serde:Deserialize))] pub struct LimitedVec(Vec, PhantomData); /// Formatter for [`LimitedVec`] will print to precision of 8 by default, to print the whole data, use `{:+}`. diff --git a/core/src/message/common.rs b/core/src/message/common.rs index d769d543b06..a6057c3d267 100644 --- a/core/src/message/common.rs +++ b/core/src/message/common.rs @@ -179,7 +179,7 @@ impl Message { TypeInfo, derive_more::From, )] -#[cfg_attr(feature = "std", derive(serde::Serialize))] +#[cfg_attr(feature = "std", derive(serde::Serialize, serde:Deserialize))] pub enum MessageDetails { /// Reply details. Reply(ReplyDetails), @@ -229,7 +229,7 @@ impl MessageDetails { #[derive( Clone, Copy, Default, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Decode, Encode, TypeInfo, )] -#[cfg_attr(feature = "std", derive(serde::Serialize))] +#[cfg_attr(feature = "std", derive(serde::Serialize, serde:Deserialize))] pub struct ReplyDetails { /// Message id, this message replies on. to: MessageId, @@ -263,7 +263,7 @@ impl ReplyDetails { #[derive( Clone, Copy, Default, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Decode, Encode, TypeInfo, )] -#[cfg_attr(feature = "std", derive(serde::Serialize))] +#[cfg_attr(feature = "std", derive(serde::Serialize, serde:Deserialize))] pub struct SignalDetails { /// Message id, which issues signal. to: MessageId, diff --git a/core/src/message/context.rs b/core/src/message/context.rs index 93bb4befb93..242a7edcbb8 100644 --- a/core/src/message/context.rs +++ b/core/src/message/context.rs @@ -144,7 +144,7 @@ impl ContextOutcome { /// Store of previous message execution context. #[derive(Clone, Default, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Decode, Encode, TypeInfo)] -#[cfg_attr(feature = "std", derive(serde::Serialize))] +#[cfg_attr(feature = "std", derive(serde::Serialize, serde:Deserialize))] pub struct ContextStore { outgoing: BTreeMap>, reply: Option, diff --git a/core/src/message/mod.rs b/core/src/message/mod.rs index 1bacc55d63a..fa42f44ddbc 100644 --- a/core/src/message/mod.rs +++ b/core/src/message/mod.rs @@ -60,7 +60,7 @@ const _: () = assert!(MAX_PAYLOAD_SIZE <= u32::MAX as usize); #[derive( Clone, Copy, Default, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Decode, Encode, TypeInfo, )] -#[cfg_attr(feature = "std", derive(serde::Serialize))] +#[cfg_attr(feature = "std", derive(serde::Serialize, serde:Deserialize))] pub struct PayloadSizeError; impl From for &str { @@ -114,7 +114,7 @@ pub enum MessageWaitedType { #[derive( Copy, Clone, Default, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Decode, Encode, TypeInfo, )] -#[cfg_attr(feature = "std", derive(serde::Serialize))] +#[cfg_attr(feature = "std", derive(serde::Serialize, serde:Deserialize))] pub enum DispatchKind { /// Initialization. Init, diff --git a/core/src/pages.rs b/core/src/pages.rs index c1a04873b33..23c44aef103 100644 --- a/core/src/pages.rs +++ b/core/src/pages.rs @@ -195,7 +195,7 @@ impl PartialOrd> for Page { Default, derive_more::Into, )] -#[cfg_attr(feature = "std", derive(serde::Serialize))] +#[cfg_attr(feature = "std", derive(serde::Serialize, serde:Deserialize))] pub struct Page(u32); impl Page { diff --git a/core/src/program.rs b/core/src/program.rs index 3e4225bbc14..2255177a92d 100644 --- a/core/src/program.rs +++ b/core/src/program.rs @@ -124,7 +124,7 @@ pub enum ProgramState { /// Struct defines infix of memory pages storage. #[derive(Clone, Copy, Debug, Default, Decode, Encode, PartialEq, Eq, TypeInfo)] -#[cfg_attr(feature = "std", derive(serde::Serialize))] +#[cfg_attr(feature = "std", derive(serde::Serialize, serde:Deserialize))] pub struct MemoryInfix(u32); impl MemoryInfix { diff --git a/core/src/reservation.rs b/core/src/reservation.rs index 50299d21233..4c434f0836f 100644 --- a/core/src/reservation.rs +++ b/core/src/reservation.rs @@ -40,7 +40,7 @@ use scale_info::{ #[derive( Clone, Copy, Default, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Decode, Encode, TypeInfo, )] -#[cfg_attr(feature = "std", derive(serde::Serialize))] +#[cfg_attr(feature = "std", derive(serde::Serialize, serde:Deserialize))] pub struct ReservationNonce(u64); impl From<&InnerNonce> for ReservationNonce {