Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
sp-core: impl serde for some offchain types (paritytech#11512)
Browse files Browse the repository at this point in the history
* sp-core: impl serde for some offchain types

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

Co-authored-by: Bastian Köcher <[email protected]>

* remove serde impls from OpaqueNetworkState/OpaqueMultiaddr

* derive default

Co-authored-by: Bastian Köcher <[email protected]>
  • Loading branch information
2 people authored and DaviRain-Su committed Aug 23, 2022
1 parent 9cb6c09 commit c38ced9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions primitives/core/src/offchain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c38ced9

Please sign in to comment.