Skip to content

Commit 4331ca0

Browse files
yjhmelodybkchr
authored andcommitted
sp-core: impl serde for some offchain types (paritytech#11512)
* 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]>
1 parent f92f5f7 commit 4331ca0

File tree

1 file changed

+2
-0
lines changed
  • primitives/core/src/offchain

1 file changed

+2
-0
lines changed

primitives/core/src/offchain/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,14 @@ impl OpaqueMultiaddr {
208208
#[derive(
209209
Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Default, RuntimeDebug, PassByInner, Encode, Decode,
210210
)]
211+
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
211212
pub struct Timestamp(u64);
212213

213214
/// Duration type
214215
#[derive(
215216
Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Default, RuntimeDebug, PassByInner, Encode, Decode,
216217
)]
218+
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
217219
pub struct Duration(u64);
218220

219221
impl Duration {

0 commit comments

Comments
 (0)