shelley-spec-ledger-0.1.0.0
Safe HaskellNone
LanguageHaskell98

Shelley.Spec.Ledger.OverlaySchedule

Synopsis

Overlay schedule

OBftSlot

data OBftSlot crypto Source #

Constructors

NonActiveSlot 
ActiveSlot !(KeyHash 'Genesis crypto) 

Instances

Instances details
Eq (OBftSlot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.OverlaySchedule

Methods

(==) :: OBftSlot crypto -> OBftSlot crypto -> Bool #

(/=) :: OBftSlot crypto -> OBftSlot crypto -> Bool #

Ord (OBftSlot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.OverlaySchedule

Methods

compare :: OBftSlot crypto -> OBftSlot crypto -> Ordering #

(<) :: OBftSlot crypto -> OBftSlot crypto -> Bool #

(<=) :: OBftSlot crypto -> OBftSlot crypto -> Bool #

(>) :: OBftSlot crypto -> OBftSlot crypto -> Bool #

(>=) :: OBftSlot crypto -> OBftSlot crypto -> Bool #

max :: OBftSlot crypto -> OBftSlot crypto -> OBftSlot crypto #

min :: OBftSlot crypto -> OBftSlot crypto -> OBftSlot crypto #

Show (OBftSlot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.OverlaySchedule

Methods

showsPrec :: Int -> OBftSlot crypto -> ShowS #

show :: OBftSlot crypto -> String #

showList :: [OBftSlot crypto] -> ShowS #

Generic (OBftSlot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.OverlaySchedule

Associated Types

type Rep (OBftSlot crypto) :: Type -> Type #

Methods

from :: OBftSlot crypto -> Rep (OBftSlot crypto) x #

to :: Rep (OBftSlot crypto) x -> OBftSlot crypto #

NFData (OBftSlot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.OverlaySchedule

Methods

rnf :: OBftSlot crypto -> () #

Crypto crypto => ToCBOR (OBftSlot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.OverlaySchedule

Methods

toCBOR :: OBftSlot crypto -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (OBftSlot crypto) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [OBftSlot crypto] -> Size Source #

Crypto crypto => FromCBOR (OBftSlot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.OverlaySchedule

Methods

fromCBOR :: Decoder s (OBftSlot crypto) Source #

label :: Proxy (OBftSlot crypto) -> Text Source #

NoThunks (OBftSlot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.OverlaySchedule

type Rep (OBftSlot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.OverlaySchedule

type Rep (OBftSlot crypto) = D1 ('MetaData "OBftSlot" "Shelley.Spec.Ledger.OverlaySchedule" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "NonActiveSlot" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ActiveSlot" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'Genesis crypto))))

Testing

overlaySlots :: SlotNo -> UnitInterval -> EpochSize -> [SlotNo] Source #

Return the list of overlaySlots for a given epoch. Note that this linear in the size of the epoch, and should probably only be used for testing. If something more performant is needed, we could probably use [start + floor(xd) | x <- [0 .. (spe -1)], floor(xd) < spe] but we would need to make sure that this is equivalent.