Skip to content

Commit

Permalink
Derive MaxEncodedLen on SlotDuration (paritytech#2484)
Browse files Browse the repository at this point in the history
# Description

Needed this in my code as part of the larger data structure.

---------

Co-authored-by: command-bot <>
  • Loading branch information
nazar-pc authored Nov 24, 2023
1 parent a9ead8b commit cdfbb86
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion substrate/primitives/consensus/slots/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,20 @@ impl From<Slot> for u64 {
}

/// A slot duration defined in milliseconds.
#[derive(Clone, Copy, Debug, Encode, Decode, Hash, PartialOrd, Ord, PartialEq, Eq, TypeInfo)]
#[derive(
Clone,
Copy,
Debug,
Encode,
Decode,
MaxEncodedLen,
Hash,
PartialOrd,
Ord,
PartialEq,
Eq,
TypeInfo,
)]
pub struct SlotDuration(u64);

impl SlotDuration {
Expand Down

0 comments on commit cdfbb86

Please sign in to comment.