Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Block.Abstract
Synopsis
- type family BlockProtocol blk
- data family BlockConfig blk
- data family CodecConfig blk
- data family StorageConfig blk
- class (HasHeader blk, GetHeader blk) ⇒ GetPrevHash blk where
- headerPrevHash ∷ Header blk → ChainHash blk
- blockPrevHash ∷ GetPrevHash blk ⇒ blk → ChainHash blk
- class HasHeader (Header blk) ⇒ GetHeader blk where
- getHeader ∷ blk → Header blk
- blockMatchesHeader ∷ Header blk → blk → Bool
- headerIsEBB ∷ Header blk → Maybe EpochNo
- data family Header blk
- blockIsEBB ∷ GetHeader blk ⇒ blk → Maybe EpochNo
- blockToIsEBB ∷ GetHeader blk ⇒ blk → IsEBB
- getBlockHeaderFields ∷ GetHeader blk ⇒ blk → HeaderFields blk
- headerHash ∷ HasHeader (Header blk) ⇒ Header blk → HeaderHash blk
- headerPoint ∷ HasHeader (Header blk) ⇒ Header blk → Point blk
- headerToIsEBB ∷ GetHeader blk ⇒ Header blk → IsEBB
- class ConvertRawHash blk where
- toRawHash ∷ proxy blk → HeaderHash blk → ByteString
- fromRawHash ∷ proxy blk → ByteString → HeaderHash blk
- toShortRawHash ∷ proxy blk → HeaderHash blk → ShortByteString
- fromShortRawHash ∷ proxy blk → ShortByteString → HeaderHash blk
- hashSize ∷ proxy blk → Word32
- decodeRawHash ∷ ConvertRawHash blk ⇒ proxy blk → ∀ s. Decoder s (HeaderHash blk)
- encodeRawHash ∷ ConvertRawHash blk ⇒ proxy blk → HeaderHash blk → Encoding
- succWithOrigin ∷ (Bounded t, Enum t) ⇒ WithOrigin t → t
- newtype GenesisWindow = GenesisWindow {}
- data ChainHash (b ∷ k)
- = GenesisHash
- | BlockHash !(HeaderHash b)
- class (StandardHash b, Typeable b) ⇒ HasHeader b where
- getHeaderFields ∷ b → HeaderFields b
- data HeaderFields (b ∷ k) = HeaderFields {}
- type family HeaderHash (b ∷ k)
- data Point (block ∷ k) where
- pattern GenesisPoint ∷ Point block
- pattern BlockPoint ∷ SlotNo → HeaderHash block → Point block
- class (Eq (HeaderHash b), Ord (HeaderHash b), Show (HeaderHash b), Typeable (HeaderHash b), NoThunks (HeaderHash b)) ⇒ StandardHash (b ∷ k)
- blockHash ∷ HasHeader b ⇒ b → HeaderHash b
- blockNo ∷ HasHeader b ⇒ b → BlockNo
- blockPoint ∷ HasHeader block ⇒ block → Point block
- blockSlot ∷ HasHeader b ⇒ b → SlotNo
- castHash ∷ ∀ {k1} {k2} (b ∷ k1) (b' ∷ k2). Coercible (HeaderHash b) (HeaderHash b') ⇒ ChainHash b → ChainHash b'
- castHeaderFields ∷ ∀ {k1} {k2} (b ∷ k1) (b' ∷ k2). HeaderHash b ~ HeaderHash b' ⇒ HeaderFields b → HeaderFields b'
- castPoint ∷ ∀ {k1} {k2} (b ∷ k1) (b' ∷ k2). Coercible (HeaderHash b) (HeaderHash b') ⇒ Point b → Point b'
- pointHash ∷ ∀ {k} (block ∷ k). Point block → ChainHash block
- pointSlot ∷ ∀ {k} (block ∷ k). Point block → WithOrigin SlotNo
- newtype BlockNo = BlockNo {}
- newtype EpochNo = EpochNo {}
- newtype EpochSize = EpochSize {}
- newtype SlotNo = SlotNo {}
- data WithOrigin t where
- Origin
- pattern NotOrigin ∷ t → WithOrigin t
- fromWithOrigin ∷ t → WithOrigin t → t
- withOrigin ∷ b → (t → b) → WithOrigin t → b
- withOriginFromMaybe ∷ Maybe t → WithOrigin t
- withOriginToMaybe ∷ WithOrigin t → Maybe t
Protocol
type family BlockProtocol blk Source #
Map block to consensus protocol
Instances
type BlockProtocol (Header blk) Source # | |
Defined in Ouroboros.Consensus.Block.Abstract | |
type BlockProtocol (HardForkBlock xs) Source # | |
type BlockProtocol (DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual |
Configuration
data family BlockConfig blk Source #
Static configuration required to work with this type of blocks
Instances
data family CodecConfig blk Source #
Static configuration required for serialisation and deserialisation of types pertaining to this type of block.
Data family instead of type family to get better type inference.
Instances
data family StorageConfig blk Source #
Config needed for the
NodeInitStorage
class. Defined here to
avoid circular dependencies.
Instances
Isomorphic StorageConfig Source # | |||||
Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Unary Methods project ∷ NoHardForks blk ⇒ StorageConfig (HardForkBlock '[blk]) → StorageConfig blk Source # inject ∷ NoHardForks blk ⇒ StorageConfig blk → StorageConfig (HardForkBlock '[blk]) Source # | |||||
Generic (StorageConfig (DualBlock m a)) Source # | |||||
Defined in Ouroboros.Consensus.Ledger.Dual Associated Types
Methods from ∷ StorageConfig (DualBlock m a) → Rep (StorageConfig (DualBlock m a)) x # to ∷ Rep (StorageConfig (DualBlock m a)) x → StorageConfig (DualBlock m a) # | |||||
CanHardFork xs ⇒ NoThunks (StorageConfig (HardForkBlock xs)) Source # | |||||
Defined in Ouroboros.Consensus.HardFork.Combinator.Basics Methods noThunks ∷ Context → StorageConfig (HardForkBlock xs) → IO (Maybe ThunkInfo) Source # wNoThunks ∷ Context → StorageConfig (HardForkBlock xs) → IO (Maybe ThunkInfo) Source # showTypeOf ∷ Proxy (StorageConfig (HardForkBlock xs)) → String Source # | |||||
(NoThunks (StorageConfig m), NoThunks (StorageConfig a)) ⇒ NoThunks (StorageConfig (DualBlock m a)) Source # | |||||
type Rep (StorageConfig (DualBlock m a)) Source # | |||||
Defined in Ouroboros.Consensus.Ledger.Dual type Rep (StorageConfig (DualBlock m a)) = D1 ('MetaData "StorageConfig" "Ouroboros.Consensus.Ledger.Dual" "ouroboros-consensus-0.25.0.0-inplace" 'False) (C1 ('MetaCons "DualStorageConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "dualStorageConfigMain") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StorageConfig m)) :*: S1 ('MetaSel ('Just "dualStorageConfigAux") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StorageConfig a)))) | |||||
newtype StorageConfig (HardForkBlock xs) Source # | |||||
data StorageConfig (DualBlock m a) Source # | |||||
Defined in Ouroboros.Consensus.Ledger.Dual |
Previous hash
class (HasHeader blk, GetHeader blk) ⇒ GetPrevHash blk where Source #
Methods
headerPrevHash ∷ Header blk → ChainHash blk Source #
Get the hash of the predecessor of this block
Instances
CanHardFork xs ⇒ GetPrevHash (HardForkBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Block Methods headerPrevHash ∷ Header (HardForkBlock xs) → ChainHash (HardForkBlock xs) Source # | |
Bridge m a ⇒ GetPrevHash (DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual |
blockPrevHash ∷ GetPrevHash blk ⇒ blk → ChainHash blk Source #
Working with headers
class HasHeader (Header blk) ⇒ GetHeader blk where Source #
Methods
getHeader ∷ blk → Header blk Source #
blockMatchesHeader ∷ Header blk → blk → Bool Source #
Check whether the header is the header of the block.
For example, by checking whether the hash of the body stored in the header matches that of the block.
headerIsEBB ∷ Header blk → Maybe EpochNo Source #
When the given header is the header of an Epoch Boundary Block, returns its epoch number.
Instances
CanHardFork xs ⇒ GetHeader (HardForkBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Block Methods getHeader ∷ HardForkBlock xs → Header (HardForkBlock xs) Source # blockMatchesHeader ∷ Header (HardForkBlock xs) → HardForkBlock xs → Bool Source # headerIsEBB ∷ Header (HardForkBlock xs) → Maybe EpochNo Source # | |
Bridge m a ⇒ GetHeader (DualBlock m a) Source # | |
data family Header blk Source #
Instances
Inject Header Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary Methods inject ∷ ∀ x (xs ∷ [Type]). (CanHardFork xs, HasCanonicalTxIn xs, HasHardForkTxOut xs) ⇒ InjectionIndex xs x → Header x → Header (HardForkBlock xs) Source # | |
Isomorphic Header Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Unary Methods project ∷ NoHardForks blk ⇒ Header (HardForkBlock '[blk]) → Header blk Source # inject ∷ NoHardForks blk ⇒ Header blk → Header (HardForkBlock '[blk]) Source # | |
CanHardFork xs ⇒ HasNestedContent Header (HardForkBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Block Methods unnest ∷ Header (HardForkBlock xs) → DepPair (NestedCtxt Header (HardForkBlock xs)) Source # nest ∷ DepPair (NestedCtxt Header (HardForkBlock xs)) → Header (HardForkBlock xs) Source # | |
SerialiseHFC xs ⇒ ReconstructNestedCtxt Header (HardForkBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseDisk Methods reconstructPrefixLen ∷ proxy (Header (HardForkBlock xs)) → PrefixLen Source # reconstructNestedCtxt ∷ proxy (Header (HardForkBlock xs)) → ShortByteString → SizeInBytes → SomeSecond (NestedCtxt Header) (HardForkBlock xs) Source # | |
StandardHash blk ⇒ StandardHash (Header blk ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Block.Abstract | |
Typeable xs ⇒ ShowProxy (Header (HardForkBlock xs) ∷ Type) Source # | |
HasNestedContent Header m ⇒ HasNestedContent Header (DualBlock m a) Source # | |
ReconstructNestedCtxt Header m ⇒ ReconstructNestedCtxt Header (DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods reconstructPrefixLen ∷ proxy (Header (DualBlock m a)) → PrefixLen Source # reconstructNestedCtxt ∷ proxy (Header (DualBlock m a)) → ShortByteString → SizeInBytes → SomeSecond (NestedCtxt Header) (DualBlock m a) Source # | |
CanHardFork xs ⇒ SameDepIndex (NestedCtxt_ (HardForkBlock xs) Header ∷ Type → Type) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Block Methods sameDepIndex ∷ NestedCtxt_ (HardForkBlock xs) Header a → NestedCtxt_ (HardForkBlock xs) Header b → Maybe (a :~: b) Source # | |
(Typeable m, Typeable a) ⇒ ShowProxy (DualHeader m a ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
CanHardFork xs ⇒ Show (Header (HardForkBlock xs)) Source # | |
All (Compose Eq Header) xs ⇒ Eq (Header (HardForkBlock xs)) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Block Methods (==) ∷ Header (HardForkBlock xs) → Header (HardForkBlock xs) → Bool # (/=) ∷ Header (HardForkBlock xs) → Header (HardForkBlock xs) → Bool # | |
CanHardFork xs ⇒ NoThunks (Header (HardForkBlock xs)) Source # | |
NoThunks (Header (DualBlock m a)) Source # | |
All CondenseConstraints xs ⇒ Condense (Header (HardForkBlock xs)) Source # | |
CanHardFork xs ⇒ HasHeader (Header (HardForkBlock xs)) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Block Methods getHeaderFields ∷ Header (HardForkBlock xs) → HeaderFields (Header (HardForkBlock xs)) Source # | |
SerialiseHFC xs ⇒ SerialiseNodeToNode (HardForkBlock xs) (Header (HardForkBlock xs)) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToNode Methods encodeNodeToNode ∷ CodecConfig (HardForkBlock xs) → BlockNodeToNodeVersion (HardForkBlock xs) → Header (HardForkBlock xs) → Encoding Source # decodeNodeToNode ∷ CodecConfig (HardForkBlock xs) → BlockNodeToNodeVersion (HardForkBlock xs) → ∀ s. Decoder s (Header (HardForkBlock xs)) Source # | |
SerialiseHFC xs ⇒ DecodeDiskDep (NestedCtxt Header) (HardForkBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseDisk Methods decodeDiskDep ∷ CodecConfig (HardForkBlock xs) → NestedCtxt Header (HardForkBlock xs) a → ∀ s. Decoder s (ByteString → a) Source # | |
SerialiseHFC xs ⇒ DecodeDiskDepIx (NestedCtxt Header) (HardForkBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseDisk Methods decodeDiskDepIx ∷ CodecConfig (HardForkBlock xs) → Decoder s (SomeSecond (NestedCtxt Header) (HardForkBlock xs)) Source # | |
SerialiseHFC xs ⇒ EncodeDiskDep (NestedCtxt Header) (HardForkBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseDisk Methods encodeDiskDep ∷ CodecConfig (HardForkBlock xs) → NestedCtxt Header (HardForkBlock xs) a → a → Encoding Source # | |
SerialiseHFC xs ⇒ EncodeDiskDepIx (NestedCtxt Header) (HardForkBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseDisk Methods encodeDiskDepIx ∷ CodecConfig (HardForkBlock xs) → SomeSecond (NestedCtxt Header) (HardForkBlock xs) → Encoding Source # | |
EncodeDiskDep (NestedCtxt Header) m ⇒ EncodeDiskDep (NestedCtxt Header) (DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods encodeDiskDep ∷ CodecConfig (DualBlock m a) → NestedCtxt Header (DualBlock m a) a0 → a0 → Encoding Source # | |
EncodeDiskDepIx (NestedCtxt Header) m ⇒ EncodeDiskDepIx (NestedCtxt Header) (DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods encodeDiskDepIx ∷ CodecConfig (DualBlock m a) → SomeSecond (NestedCtxt Header) (DualBlock m a) → Encoding Source # | |
Show (Header m) ⇒ Show (DualHeader m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods showsPrec ∷ Int → DualHeader m a → ShowS # show ∷ DualHeader m a → String # showList ∷ [DualHeader m a] → ShowS # | |
Bridge m a ⇒ HasHeader (DualHeader m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods getHeaderFields ∷ DualHeader m a → HeaderFields (DualHeader m a) Source # | |
All SingleEraBlock xs ⇒ Show (NestedCtxt_ (HardForkBlock xs) Header a) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Block Methods showsPrec ∷ Int → NestedCtxt_ (HardForkBlock xs) Header a → ShowS # show ∷ NestedCtxt_ (HardForkBlock xs) Header a → String # showList ∷ [NestedCtxt_ (HardForkBlock xs) Header a] → ShowS # | |
type HeaderHash (Header blk ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Block.Abstract | |
type BlockProtocol (Header blk) Source # | |
Defined in Ouroboros.Consensus.Block.Abstract | |
newtype Header (DisableDiffusionPipelining blk) Source # | |
newtype Header (SelectViewDiffusionPipelining blk) Source # | |
Defined in Ouroboros.Consensus.Block.SupportsDiffusionPipelining newtype Header (SelectViewDiffusionPipelining blk) = SelectViewDiffusionPipeliningHeader (Header blk) | |
newtype Header (HardForkBlock xs) Source # | |
newtype Header (DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual |
blockToIsEBB ∷ GetHeader blk ⇒ blk → IsEBB Source #
getBlockHeaderFields ∷ GetHeader blk ⇒ blk → HeaderFields blk Source #
Get the HeaderFields
of a block, without requiring 'HasHeader blk'
This is primarily useful as a a simple definition of HasHeader
for
block types:
instance HasHeader SomeBlock where getHeaderFields = getBlockHeaderFields
provided that there is a HasHeader
instance for the header.
Unfortunately we cannot give a HasHeader
instance once and for all; if we
mapped from a header to a block instead we could do
instance HasHeader hdr => HasHeader (Block hdr) where ..
but we can't do that when we do things this way around.
headerHash ∷ HasHeader (Header blk) ⇒ Header blk → HeaderHash blk Source #
Raw hash
class ConvertRawHash blk where Source #
Convert a hash from/to raw bytes
Variants of toRawHash
and fromRawHash
for ShortByteString
are
included. Override the default implementations to avoid an extra step in
case the HeaderHash
is a ShortByteString
under the hood.
Minimal complete definition
hashSize, (toRawHash | toShortRawHash), (fromRawHash | fromShortRawHash)
Methods
toRawHash ∷ proxy blk → HeaderHash blk → ByteString Source #
Get the raw bytes from a hash
fromRawHash ∷ proxy blk → ByteString → HeaderHash blk Source #
Construct the hash from a raw hash
PRECONDITION: the bytestring's size must match hashSize
toShortRawHash ∷ proxy blk → HeaderHash blk → ShortByteString Source #
Variant of toRawHash
for ShortByteString
fromShortRawHash ∷ proxy blk → ShortByteString → HeaderHash blk Source #
Variant of fromRawHash
for ShortByteString
hashSize ∷ proxy blk → Word32 Source #
The size of the hash in number of bytes
Instances
CanHardFork xs ⇒ ConvertRawHash (HardForkBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Block Methods toRawHash ∷ proxy (HardForkBlock xs) → HeaderHash (HardForkBlock xs) → ByteString Source # fromRawHash ∷ proxy (HardForkBlock xs) → ByteString → HeaderHash (HardForkBlock xs) Source # toShortRawHash ∷ proxy (HardForkBlock xs) → HeaderHash (HardForkBlock xs) → ShortByteString Source # fromShortRawHash ∷ proxy (HardForkBlock xs) → ShortByteString → HeaderHash (HardForkBlock xs) Source # hashSize ∷ proxy (HardForkBlock xs) → Word32 Source # | |
ConvertRawHash m ⇒ ConvertRawHash (DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods toRawHash ∷ proxy (DualBlock m a) → HeaderHash (DualBlock m a) → ByteString Source # fromRawHash ∷ proxy (DualBlock m a) → ByteString → HeaderHash (DualBlock m a) Source # toShortRawHash ∷ proxy (DualBlock m a) → HeaderHash (DualBlock m a) → ShortByteString Source # fromShortRawHash ∷ proxy (DualBlock m a) → ShortByteString → HeaderHash (DualBlock m a) Source # |
decodeRawHash ∷ ConvertRawHash blk ⇒ proxy blk → ∀ s. Decoder s (HeaderHash blk) Source #
encodeRawHash ∷ ConvertRawHash blk ⇒ proxy blk → HeaderHash blk → Encoding Source #
Utilities for working with WithOrigin
succWithOrigin ∷ (Bounded t, Enum t) ⇒ WithOrigin t → t Source #
Return the successor of a WithOrigin
value. Useful in combination with
SlotNo
and BlockNo
.
Ouroboros Genesis window
newtype GenesisWindow Source #
Size of the Genesis window, in number of slots.
This is the number of slots that the GDD Governor (Genesis Density
Disconnection Governor -- see Governor
) will
consider when deciding whether to disconnect from a peer. It has to be
smaller or equal to the stability window. For instance, for Shelley-based
eras, this will be equal to a stability window, that is 3k/f
.
Constructors
GenesisWindow | |
Fields |
Instances
Num GenesisWindow Source # | |
Defined in Ouroboros.Consensus.Block.Abstract Methods (+) ∷ GenesisWindow → GenesisWindow → GenesisWindow # (-) ∷ GenesisWindow → GenesisWindow → GenesisWindow # (*) ∷ GenesisWindow → GenesisWindow → GenesisWindow # negate ∷ GenesisWindow → GenesisWindow # abs ∷ GenesisWindow → GenesisWindow # | |
Show GenesisWindow Source # | |
Defined in Ouroboros.Consensus.Block.Abstract Methods showsPrec ∷ Int → GenesisWindow → ShowS # show ∷ GenesisWindow → String # showList ∷ [GenesisWindow] → ShowS # | |
Eq GenesisWindow Source # | |
Defined in Ouroboros.Consensus.Block.Abstract | |
Ord GenesisWindow Source # | |
Defined in Ouroboros.Consensus.Block.Abstract Methods compare ∷ GenesisWindow → GenesisWindow → Ordering # (<) ∷ GenesisWindow → GenesisWindow → Bool # (<=) ∷ GenesisWindow → GenesisWindow → Bool # (>) ∷ GenesisWindow → GenesisWindow → Bool # (>=) ∷ GenesisWindow → GenesisWindow → Bool # | |
NoThunks GenesisWindow Source # | |
Defined in Ouroboros.Consensus.Block.Abstract |
Re-export basic definitions from ouroboros-network
data ChainHash (b ∷ k) Source #
Constructors
GenesisHash | |
BlockHash !(HeaderHash b) |
Instances
Isomorphic (ChainHash ∷ Type → Type) Source # | |||||
Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Unary Methods project ∷ NoHardForks blk ⇒ ChainHash (HardForkBlock '[blk]) → ChainHash blk Source # inject ∷ NoHardForks blk ⇒ ChainHash blk → ChainHash (HardForkBlock '[blk]) Source # | |||||
Generic (ChainHash b) | |||||
Defined in Ouroboros.Network.Block Associated Types
| |||||
StandardHash block ⇒ Show (ChainHash block) | |||||
StandardHash block ⇒ Eq (ChainHash block) | |||||
StandardHash block ⇒ Ord (ChainHash block) | |||||
Defined in Ouroboros.Network.Block Methods compare ∷ ChainHash block → ChainHash block → Ordering # (<) ∷ ChainHash block → ChainHash block → Bool # (<=) ∷ ChainHash block → ChainHash block → Bool # (>) ∷ ChainHash block → ChainHash block → Bool # (>=) ∷ ChainHash block → ChainHash block → Bool # | |||||
(StandardHash block, Typeable block) ⇒ NoThunks (ChainHash block) | |||||
Condense (HeaderHash b) ⇒ Condense (ChainHash b) Source # | |||||
Serialise (HeaderHash b) ⇒ Serialise (ChainHash b) | |||||
type Rep (ChainHash b) | |||||
Defined in Ouroboros.Network.Block type Rep (ChainHash b) = D1 ('MetaData "ChainHash" "Ouroboros.Network.Block" "ouroboros-network-api-0.13.0.0-5343a8071b3f542ab81b06c59cf16dafcc55f3756ea92962f719c77a1536151d" 'False) (C1 ('MetaCons "GenesisHash" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "BlockHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HeaderHash b)))) |
class (StandardHash b, Typeable b) ⇒ HasHeader b where Source #
Abstract over the shape of blocks (or indeed just block headers)
Methods
getHeaderFields ∷ b → HeaderFields b Source #
Instances
HasHeader Block | |
Defined in Ouroboros.Network.Mock.ConcreteBlock Methods | |
HasHeader BlockHeader | |
Defined in Ouroboros.Network.Mock.ConcreteBlock Methods getHeaderFields ∷ BlockHeader → HeaderFields BlockHeader Source # | |
CanHardFork xs ⇒ HasHeader (Header (HardForkBlock xs)) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Block Methods getHeaderFields ∷ Header (HardForkBlock xs) → HeaderFields (Header (HardForkBlock xs)) Source # | |
CanHardFork xs ⇒ HasHeader (HardForkBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Block Methods getHeaderFields ∷ HardForkBlock xs → HeaderFields (HardForkBlock xs) Source # | |
Bridge m a ⇒ HasHeader (DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods getHeaderFields ∷ DualBlock m a → HeaderFields (DualBlock m a) Source # | |
Bridge m a ⇒ HasHeader (DualHeader m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods getHeaderFields ∷ DualHeader m a → HeaderFields (DualHeader m a) Source # | |
(StandardHash b, Typeable b, Typeable k) ⇒ HasHeader (HeaderFields b) | |
Defined in Ouroboros.Network.Block Methods getHeaderFields ∷ HeaderFields b → HeaderFields (HeaderFields b) Source # |
data HeaderFields (b ∷ k) Source #
Header fields we expect to be present in a block
These fields are lazy because they are extracted from a block or block header; this type is not intended for storage.
Constructors
HeaderFields | |
Fields |
Instances
StandardHash b ⇒ StandardHash (HeaderFields b ∷ Type) | |||||
Defined in Ouroboros.Network.Block | |||||
Generic (HeaderFields b) | |||||
Defined in Ouroboros.Network.Block Associated Types
Methods from ∷ HeaderFields b → Rep (HeaderFields b) x # to ∷ Rep (HeaderFields b) x → HeaderFields b # | |||||
StandardHash b ⇒ Show (HeaderFields b) | |||||
Defined in Ouroboros.Network.Block Methods showsPrec ∷ Int → HeaderFields b → ShowS # show ∷ HeaderFields b → String # showList ∷ [HeaderFields b] → ShowS # | |||||
StandardHash b ⇒ Eq (HeaderFields b) | |||||
Defined in Ouroboros.Network.Block Methods (==) ∷ HeaderFields b → HeaderFields b → Bool # (/=) ∷ HeaderFields b → HeaderFields b → Bool # | |||||
StandardHash b ⇒ Ord (HeaderFields b) | |||||
Defined in Ouroboros.Network.Block Methods compare ∷ HeaderFields b → HeaderFields b → Ordering # (<) ∷ HeaderFields b → HeaderFields b → Bool # (<=) ∷ HeaderFields b → HeaderFields b → Bool # (>) ∷ HeaderFields b → HeaderFields b → Bool # (>=) ∷ HeaderFields b → HeaderFields b → Bool # max ∷ HeaderFields b → HeaderFields b → HeaderFields b # min ∷ HeaderFields b → HeaderFields b → HeaderFields b # | |||||
(StandardHash b, Typeable b, Typeable k) ⇒ HasHeader (HeaderFields b) | |||||
Defined in Ouroboros.Network.Block Methods getHeaderFields ∷ HeaderFields b → HeaderFields (HeaderFields b) Source # | |||||
Serialise (HeaderHash b) ⇒ Serialise (HeaderFields b) | |||||
Defined in Ouroboros.Network.Block Methods encode ∷ HeaderFields b → Encoding Source # decode ∷ Decoder s (HeaderFields b) Source # encodeList ∷ [HeaderFields b] → Encoding Source # decodeList ∷ Decoder s [HeaderFields b] Source # | |||||
type HeaderHash (HeaderFields b ∷ Type) | |||||
Defined in Ouroboros.Network.Block | |||||
type Rep (HeaderFields b) | |||||
Defined in Ouroboros.Network.Block type Rep (HeaderFields b) = D1 ('MetaData "HeaderFields" "Ouroboros.Network.Block" "ouroboros-network-api-0.13.0.0-5343a8071b3f542ab81b06c59cf16dafcc55f3756ea92962f719c77a1536151d" 'False) (C1 ('MetaCons "HeaderFields" 'PrefixI 'True) (S1 ('MetaSel ('Just "headerFieldSlot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SlotNo) :*: (S1 ('MetaSel ('Just "headerFieldBlockNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BlockNo) :*: S1 ('MetaSel ('Just "headerFieldHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HeaderHash b))))) |
type family HeaderHash (b ∷ k) Source #
Header hash
Instances
type HeaderHash Block | |
Defined in Ouroboros.Network.Mock.ConcreteBlock | |
type HeaderHash BlockHeader | |
Defined in Ouroboros.Network.Mock.ConcreteBlock | |
type HeaderHash (Header blk ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Block.Abstract | |
type HeaderHash (HardForkBlock xs ∷ Type) Source # | |
type HeaderHash (SerialisedHeader blk ∷ Type) Source # | Only needed for the |
Defined in Ouroboros.Consensus.Storage.Serialisation | |
type HeaderHash (DualBlock m a ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
type HeaderHash (WithPoint blk b ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Storage.ChainDB.API | |
type HeaderHash (HeaderFields b ∷ Type) | |
Defined in Ouroboros.Network.Block | |
type HeaderHash (Serialised block ∷ Type) | |
Defined in Ouroboros.Network.Block | |
type HeaderHash (Ticked l ∷ k) Source # | |
Defined in Ouroboros.Consensus.Ticked | |
type HeaderHash (LedgerDB m l blk ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Storage.LedgerDB.API | |
type HeaderHash (Forker m l blk ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Storage.LedgerDB.Forker | |
type HeaderHash (ReadOnlyForker m l blk ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Storage.LedgerDB.Forker | |
type HeaderHash (LedgerState blk ∷ MapKind → Type) Source # | |
Defined in Ouroboros.Consensus.Ledger.Basics | |
type HeaderHash (ExtLedgerState blk ∷ MapKind → Type) Source # | |
Defined in Ouroboros.Consensus.Ledger.Extended | |
type HeaderHash (K (DbChangelog l) ∷ MapKind → Type) Source # | |
data Point (block ∷ k) where Source #
A point on the chain is identified by its Slot
and HeaderHash
.
The Slot
tells us where to look and the HeaderHash
either simply serves
as a check, or in some contexts it disambiguates blocks from different forks
that were in the same slot.
It's a newtype rather than a type synonym, because using a type synonym would lead to ambiguity, since HeaderHash is a non-injective type family.
Bundled Patterns
pattern GenesisPoint ∷ Point block | |
pattern BlockPoint ∷ SlotNo → HeaderHash block → Point block |
Instances
ShowProxy block ⇒ ShowProxy (Point block ∷ Type) | |||||
Generic (Point block) | |||||
Defined in Ouroboros.Network.Block Associated Types
| |||||
StandardHash block ⇒ Show (Point block) | |||||
StandardHash block ⇒ Eq (Point block) | |||||
StandardHash block ⇒ Ord (Point block) | |||||
StandardHash block ⇒ NoThunks (Point block) | |||||
Condense (HeaderHash block) ⇒ Condense (Point block) Source # | |||||
Serialise (HeaderHash block) ⇒ Serialise (Point block) | |||||
type Rep (Point block) | |||||
Defined in Ouroboros.Network.Block type Rep (Point block) = D1 ('MetaData "Point" "Ouroboros.Network.Block" "ouroboros-network-api-0.13.0.0-5343a8071b3f542ab81b06c59cf16dafcc55f3756ea92962f719c77a1536151d" 'True) (C1 ('MetaCons "Point" 'PrefixI 'True) (S1 ('MetaSel ('Just "getPoint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (WithOrigin (Block SlotNo (HeaderHash block)))))) |
class (Eq (HeaderHash b), Ord (HeaderHash b), Show (HeaderHash b), Typeable (HeaderHash b), NoThunks (HeaderHash b)) ⇒ StandardHash (b ∷ k) Source #
StandardHash
summarises the constraints we want header hashes to have
Without this class we would need to write
deriving instance Eq (HeaderHash block) => Eq (ChainHash block)
That requires UndecidableInstances
; not a problem by itself, but it also
means that we can then not use deriving Eq
anywhere else for datatypes
that reference Hash
, which is very frustrating; see
https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/exts/deriving_inferred.html
Introducing the StandardHash
class avoids this problem.
Having these constraints directly as part of the HasHeader
class is
possible but libraries that use the networking layer may wish to be able to
talk about StandardHash
independently of HasHeader
since the latter may
impose yet further constraints.
Instances
StandardHash Block | |
Defined in Ouroboros.Network.Mock.ConcreteBlock | |
StandardHash BlockHeader | |
Defined in Ouroboros.Network.Mock.ConcreteBlock | |
StandardHash blk ⇒ StandardHash (Header blk ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Block.Abstract | |
CanHardFork xs ⇒ StandardHash (HardForkBlock xs ∷ Type) Source # | |
StandardHash blk ⇒ StandardHash (SerialisedHeader blk ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Storage.Serialisation | |
StandardHash m ⇒ StandardHash (DualBlock m a ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual | |
StandardHash blk ⇒ StandardHash (WithPoint blk b ∷ Type) Source # | |
Defined in Ouroboros.Consensus.Storage.ChainDB.API | |
StandardHash b ⇒ StandardHash (HeaderFields b ∷ Type) | |
Defined in Ouroboros.Network.Block | |
StandardHash block ⇒ StandardHash (Serialised block ∷ Type) | |
Defined in Ouroboros.Network.Block | |
StandardHash blk ⇒ StandardHash (LedgerState blk ∷ MapKind → Type) Source # | |
Defined in Ouroboros.Consensus.Ledger.Basics | |
(NoThunks (HeaderHash blk), Typeable (HeaderHash blk), Show (HeaderHash blk), Ord (HeaderHash blk), Eq (HeaderHash blk)) ⇒ StandardHash (ExtLedgerState blk ∷ MapKind → Type) Source # | |
Defined in Ouroboros.Consensus.Ledger.Extended |
blockHash ∷ HasHeader b ⇒ b → HeaderHash b Source #
blockPoint ∷ HasHeader block ⇒ block → Point block Source #
castHash ∷ ∀ {k1} {k2} (b ∷ k1) (b' ∷ k2). Coercible (HeaderHash b) (HeaderHash b') ⇒ ChainHash b → ChainHash b' Source #
castHeaderFields ∷ ∀ {k1} {k2} (b ∷ k1) (b' ∷ k2). HeaderHash b ~ HeaderHash b' ⇒ HeaderFields b → HeaderFields b' Source #
castPoint ∷ ∀ {k1} {k2} (b ∷ k1) (b' ∷ k2). Coercible (HeaderHash b) (HeaderHash b') ⇒ Point b → Point b' Source #
Re-export basic definitions from cardano-base
The 0-based index of the block in the blockchain. BlockNo is <= SlotNo and is only equal at slot N if there is a block for every slot where N <= SlotNo.
Instances
FromJSON BlockNo | |||||
ToJSON BlockNo | |||||
FromCBOR BlockNo | |||||
ToCBOR BlockNo | |||||
EncCBOR BlockNo | |||||
NFData BlockNo | |||||
Defined in Cardano.Slotting.Block | |||||
Bounded BlockNo | |||||
Enum BlockNo | |||||
Defined in Cardano.Slotting.Block | |||||
Generic BlockNo | |||||
Defined in Cardano.Slotting.Block Associated Types
| |||||
Num BlockNo | |||||
Show BlockNo | |||||
Eq BlockNo | |||||
Ord BlockNo | |||||
NoThunks BlockNo | |||||
ChainOrder BlockNo Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Abstract Associated Types
Methods preferCandidate ∷ ChainOrderConfig BlockNo → BlockNo → BlockNo → Bool Source # | |||||
Condense BlockNo Source # | |||||
Serialise BlockNo | |||||
type Rep BlockNo | |||||
Defined in Cardano.Slotting.Block type Rep BlockNo = D1 ('MetaData "BlockNo" "Cardano.Slotting.Block" "cardano-slotting-0.2.0.0-2b12715306b9f8011dcd1a9abda3c9a87b5af2551395e7f7113557ad264b8ac9" 'True) (C1 ('MetaCons "BlockNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBlockNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) | |||||
type ChainOrderConfig BlockNo Source # | |||||
Defined in Ouroboros.Consensus.Protocol.Abstract |
An epoch, i.e. the number of the epoch.
Instances
FromJSON EpochNo | |||||
ToJSON EpochNo | |||||
FromCBOR EpochNo | |||||
ToCBOR EpochNo | |||||
EncCBOR EpochNo | |||||
NFData EpochNo | |||||
Defined in Cardano.Slotting.Slot | |||||
Enum EpochNo | |||||
Defined in Cardano.Slotting.Slot | |||||
Generic EpochNo | |||||
Defined in Cardano.Slotting.Slot Associated Types
| |||||
Show EpochNo | |||||
Eq EpochNo | |||||
Ord EpochNo | |||||
NoThunks EpochNo | |||||
Condense EpochNo Source # | |||||
Serialise EpochNo | |||||
type Rep EpochNo | |||||
Defined in Cardano.Slotting.Slot type Rep EpochNo = D1 ('MetaData "EpochNo" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.0-2b12715306b9f8011dcd1a9abda3c9a87b5af2551395e7f7113557ad264b8ac9" 'True) (C1 ('MetaCons "EpochNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |
Constructors
EpochSize | |
Fields |
Instances
FromJSON EpochSize | |||||
ToJSON EpochSize | |||||
FromCBOR EpochSize | |||||
ToCBOR EpochSize | |||||
EncCBOR EpochSize | |||||
NFData EpochSize | |||||
Defined in Cardano.Slotting.Slot | |||||
Enum EpochSize | |||||
Defined in Cardano.Slotting.Slot | |||||
Generic EpochSize | |||||
Defined in Cardano.Slotting.Slot Associated Types
| |||||
Show EpochSize | |||||
Eq EpochSize | |||||
Ord EpochSize | |||||
Defined in Cardano.Slotting.Slot | |||||
NoThunks EpochSize | |||||
type Rep EpochSize | |||||
Defined in Cardano.Slotting.Slot type Rep EpochSize = D1 ('MetaData "EpochSize" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.0-2b12715306b9f8011dcd1a9abda3c9a87b5af2551395e7f7113557ad264b8ac9" 'True) (C1 ('MetaCons "EpochSize" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |
The 0-based index for the Ourboros time slot.
Instances
FromJSON SlotNo | |||||
ToJSON SlotNo | |||||
FromCBOR SlotNo | |||||
ToCBOR SlotNo | |||||
EncCBOR SlotNo | |||||
NFData SlotNo | |||||
Defined in Cardano.Slotting.Slot | |||||
Bounded SlotNo | |||||
Enum SlotNo | |||||
Defined in Cardano.Slotting.Slot | |||||
Generic SlotNo | |||||
Defined in Cardano.Slotting.Slot Associated Types
| |||||
Num SlotNo | |||||
Show SlotNo | |||||
Eq SlotNo | |||||
Ord SlotNo | |||||
NoThunks SlotNo | |||||
Condense SlotNo Source # | |||||
Serialise SlotNo | |||||
ShowProxy SlotNo | |||||
(Condense block, HasHeader block, Condense (HeaderHash block)) ⇒ Condense (AnchoredFragment block) Source # | |||||
Defined in Ouroboros.Consensus.Util.Condense Methods condense ∷ AnchoredFragment block → String Source # | |||||
SerialiseHFC xs ⇒ SerialiseNodeToClient (HardForkBlock xs) SlotNo Source # | |||||
Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToClient Methods encodeNodeToClient ∷ CodecConfig (HardForkBlock xs) → BlockNodeToClientVersion (HardForkBlock xs) → SlotNo → Encoding Source # decodeNodeToClient ∷ CodecConfig (HardForkBlock xs) → BlockNodeToClientVersion (HardForkBlock xs) → ∀ s. Decoder s SlotNo Source # | |||||
HasHeader block ⇒ Anchorable (WithOrigin SlotNo) (Anchor block) block | |||||
Defined in Ouroboros.Network.AnchoredFragment | |||||
Anchorable (WithOrigin SlotNo) (HeaderStateWithTime blk) (HeaderStateWithTime blk) Source # | |||||
Defined in Ouroboros.Consensus.HeaderStateHistory Methods asAnchor ∷ HeaderStateWithTime blk → HeaderStateWithTime blk Source # getAnchorMeasure ∷ Proxy (HeaderStateWithTime blk) → HeaderStateWithTime blk → WithOrigin SlotNo Source # | |||||
GetTip l ⇒ Anchorable (WithOrigin SlotNo) (l EmptyMK) (l EmptyMK) Source # | |||||
GetTip l ⇒ Anchorable (WithOrigin SlotNo) (StateRef m l) (StateRef m l) Source # | |||||
type Rep SlotNo | |||||
Defined in Cardano.Slotting.Slot type Rep SlotNo = D1 ('MetaData "SlotNo" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.0-2b12715306b9f8011dcd1a9abda3c9a87b5af2551395e7f7113557ad264b8ac9" 'True) (C1 ('MetaCons "SlotNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSlotNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |
data WithOrigin t Source #
Constructors
Origin |
Bundled Patterns
pattern NotOrigin ∷ t → WithOrigin t | Custom pattern for This avoids clashing with our (extensive) use of |
Instances
Functor WithOrigin | |||||
Defined in Cardano.Slotting.Slot | |||||
Foldable WithOrigin | |||||
Defined in Cardano.Slotting.Slot Methods fold ∷ Monoid m ⇒ WithOrigin m → m # foldMap ∷ Monoid m ⇒ (a → m) → WithOrigin a → m # foldMap' ∷ Monoid m ⇒ (a → m) → WithOrigin a → m # foldr ∷ (a → b → b) → b → WithOrigin a → b # foldr' ∷ (a → b → b) → b → WithOrigin a → b # foldl ∷ (b → a → b) → b → WithOrigin a → b # foldl' ∷ (b → a → b) → b → WithOrigin a → b # foldr1 ∷ (a → a → a) → WithOrigin a → a # foldl1 ∷ (a → a → a) → WithOrigin a → a # toList ∷ WithOrigin a → [a] # null ∷ WithOrigin a → Bool # length ∷ WithOrigin a → Int # elem ∷ Eq a ⇒ a → WithOrigin a → Bool # maximum ∷ Ord a ⇒ WithOrigin a → a # minimum ∷ Ord a ⇒ WithOrigin a → a # sum ∷ Num a ⇒ WithOrigin a → a # product ∷ Num a ⇒ WithOrigin a → a # | |||||
Traversable WithOrigin | |||||
Defined in Cardano.Slotting.Slot Methods traverse ∷ Applicative f ⇒ (a → f b) → WithOrigin a → f (WithOrigin b) # sequenceA ∷ Applicative f ⇒ WithOrigin (f a) → f (WithOrigin a) # mapM ∷ Monad m ⇒ (a → m b) → WithOrigin a → m (WithOrigin b) # sequence ∷ Monad m ⇒ WithOrigin (m a) → m (WithOrigin a) # | |||||
FromJSON a ⇒ FromJSON (WithOrigin a) | |||||
Defined in Cardano.Slotting.Slot Methods parseJSON ∷ Value → Parser (WithOrigin a) Source # parseJSONList ∷ Value → Parser [WithOrigin a] Source # omittedField ∷ Maybe (WithOrigin a) Source # | |||||
ToJSON a ⇒ ToJSON (WithOrigin a) | |||||
Defined in Cardano.Slotting.Slot Methods toJSON ∷ WithOrigin a → Value Source # toEncoding ∷ WithOrigin a → Encoding Source # toJSONList ∷ [WithOrigin a] → Value Source # toEncodingList ∷ [WithOrigin a] → Encoding Source # omitField ∷ WithOrigin a → Bool Source # | |||||
(Serialise t, Typeable t) ⇒ FromCBOR (WithOrigin t) | |||||
Defined in Cardano.Slotting.Slot | |||||
(Serialise t, Typeable t) ⇒ ToCBOR (WithOrigin t) | |||||
Defined in Cardano.Slotting.Slot Methods toCBOR ∷ WithOrigin t → Encoding Source # encodedSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy (WithOrigin t) → Size Source # encodedListSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy [WithOrigin t] → Size Source # | |||||
(Serialise t, Typeable t) ⇒ EncCBOR (WithOrigin t) | |||||
Defined in Cardano.Ledger.Binary.Encoding.EncCBOR Methods encCBOR ∷ WithOrigin t → Encoding Source # encodedSizeExpr ∷ (∀ t0. EncCBOR t0 ⇒ Proxy t0 → Size) → Proxy (WithOrigin t) → Size Source # encodedListSizeExpr ∷ (∀ t0. EncCBOR t0 ⇒ Proxy t0 → Size) → Proxy [WithOrigin t] → Size Source # | |||||
NFData a ⇒ NFData (WithOrigin a) | |||||
Defined in Cardano.Slotting.Slot Methods rnf ∷ WithOrigin a → () # | |||||
Bounded t ⇒ Bounded (WithOrigin t) | |||||
Defined in Cardano.Slotting.Slot | |||||
Generic (WithOrigin t) | |||||
Defined in Cardano.Slotting.Slot Associated Types
| |||||
Show t ⇒ Show (WithOrigin t) | |||||
Defined in Cardano.Slotting.Slot Methods showsPrec ∷ Int → WithOrigin t → ShowS # show ∷ WithOrigin t → String # showList ∷ [WithOrigin t] → ShowS # | |||||
Eq t ⇒ Eq (WithOrigin t) | |||||
Defined in Cardano.Slotting.Slot | |||||
Ord t ⇒ Ord (WithOrigin t) | |||||
Defined in Cardano.Slotting.Slot Methods compare ∷ WithOrigin t → WithOrigin t → Ordering # (<) ∷ WithOrigin t → WithOrigin t → Bool # (<=) ∷ WithOrigin t → WithOrigin t → Bool # (>) ∷ WithOrigin t → WithOrigin t → Bool # (>=) ∷ WithOrigin t → WithOrigin t → Bool # max ∷ WithOrigin t → WithOrigin t → WithOrigin t # min ∷ WithOrigin t → WithOrigin t → WithOrigin t # | |||||
NoThunks t ⇒ NoThunks (WithOrigin t) | |||||
Defined in Cardano.Slotting.Slot | |||||
Condense a ⇒ Condense (WithOrigin a) Source # | |||||
Defined in Ouroboros.Consensus.Util.Condense Methods condense ∷ WithOrigin a → String Source # | |||||
(Condense block, HasHeader block, Condense (HeaderHash block)) ⇒ Condense (AnchoredFragment block) Source # | |||||
Defined in Ouroboros.Consensus.Util.Condense Methods condense ∷ AnchoredFragment block → String Source # | |||||
Serialise t ⇒ Serialise (WithOrigin t) | |||||
Defined in Cardano.Slotting.Slot Methods encode ∷ WithOrigin t → Encoding Source # decode ∷ Decoder s (WithOrigin t) Source # encodeList ∷ [WithOrigin t] → Encoding Source # decodeList ∷ Decoder s [WithOrigin t] Source # | |||||
HasHeader block ⇒ Anchorable (WithOrigin SlotNo) (Anchor block) block | |||||
Defined in Ouroboros.Network.AnchoredFragment | |||||
Anchorable (WithOrigin SlotNo) (HeaderStateWithTime blk) (HeaderStateWithTime blk) Source # | |||||
Defined in Ouroboros.Consensus.HeaderStateHistory Methods asAnchor ∷ HeaderStateWithTime blk → HeaderStateWithTime blk Source # getAnchorMeasure ∷ Proxy (HeaderStateWithTime blk) → HeaderStateWithTime blk → WithOrigin SlotNo Source # | |||||
GetTip l ⇒ Anchorable (WithOrigin SlotNo) (l EmptyMK) (l EmptyMK) Source # | |||||
GetTip l ⇒ Anchorable (WithOrigin SlotNo) (StateRef m l) (StateRef m l) Source # | |||||
type Rep (WithOrigin t) | |||||
Defined in Cardano.Slotting.Slot type Rep (WithOrigin t) = D1 ('MetaData "WithOrigin" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.0-2b12715306b9f8011dcd1a9abda3c9a87b5af2551395e7f7113557ad264b8ac9" 'False) (C1 ('MetaCons "Origin" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "At" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 t))) |
fromWithOrigin ∷ t → WithOrigin t → t Source #
withOrigin ∷ b → (t → b) → WithOrigin t → b Source #
withOriginFromMaybe ∷ Maybe t → WithOrigin t Source #
withOriginToMaybe ∷ WithOrigin t → Maybe t Source #