sp-core: impl serde for some offchain types (#11512)

* sp-core: impl serde for some offchain types

* Update primitives/core/src/offchain/mod.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* remove serde impls from OpaqueNetworkState/OpaqueMultiaddr

* derive default

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
yjh
2022-05-31 15:25:52 +08:00
committed by GitHub
parent 96809dcac7
commit c808340d9a
@@ -208,12 +208,14 @@ impl OpaqueMultiaddr {
#[derive(
Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Default, RuntimeDebug, PassByInner, Encode, Decode,
)]
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
pub struct Timestamp(u64);
/// Duration type
#[derive(
Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Default, RuntimeDebug, PassByInner, Encode, Decode,
)]
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
pub struct Duration(u64);
impl Duration {