ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.HardFork.Combinator.Block

Synopsis

Type family instances

data family Header blk Source #

Instances

Instances details
GetHeader1 Header Source # 
Instance details

Defined in Ouroboros.Consensus.Block.Abstract

Methods

getHeader1 ∷ Header blk → Header blk Source #

Inject Header Source # 
Instance details

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 # 
Instance details

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 # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

SerialiseHFC xs ⇒ ReconstructNestedCtxt Header (HardForkBlock xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseDisk

StandardHash blk ⇒ StandardHash (Header blk ∷ Type) Source # 
Instance details

Defined in Ouroboros.Consensus.Block.Abstract

Typeable xs ⇒ ShowProxy (Header (HardForkBlock xs) ∷ Type) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

Methods

showProxy ∷ Proxy (Header (HardForkBlock xs)) → String #

HasNestedContent Header m ⇒ HasNestedContent Header (DualBlock m a) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

ReconstructNestedCtxt Header m ⇒ ReconstructNestedCtxt Header (DualBlock m a) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

CanHardFork xs ⇒ SameDepIndex (NestedCtxt_ (HardForkBlock xs) Header ∷ Type → Type) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

(Typeable m, Typeable a) ⇒ ShowProxy (DualHeader m a ∷ Type) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

showProxy ∷ Proxy (DualHeader m a) → String #

All (Compose Eq Header) xs ⇒ Eq (Header (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

Methods

(==) ∷ Header (HardForkBlock xs) → Header (HardForkBlock xs) → Bool #

(/=) ∷ Header (HardForkBlock xs) → Header (HardForkBlock xs) → Bool #

CanHardFork xs ⇒ Show (Header (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

CanHardFork xs ⇒ NoThunks (Header (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

NoThunks (Header (DualBlock m a)) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

All CondenseConstraints xs ⇒ Condense (Header (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Condense

CanHardFork xs ⇒ HasHeader (Header (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

SerialiseHFC xs ⇒ SerialiseNodeToNode (HardForkBlock xs) (Header (HardForkBlock xs)) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseNodeToNode

SerialiseHFC xs ⇒ DecodeDiskDep (NestedCtxt Header) (HardForkBlock xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseDisk

SerialiseHFC xs ⇒ DecodeDiskDepIx (NestedCtxt Header) (HardForkBlock xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseDisk

SerialiseHFC xs ⇒ EncodeDiskDep (NestedCtxt Header) (HardForkBlock xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseDisk

SerialiseHFC xs ⇒ EncodeDiskDepIx (NestedCtxt Header) (HardForkBlock xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseDisk

EncodeDiskDep (NestedCtxt Header) m ⇒ EncodeDiskDep (NestedCtxt Header) (DualBlock m a) Source # 
Instance details

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 # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Show (Header m) ⇒ Show (DualHeader m a) Source # 
Instance details

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 # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

All SingleEraBlock xs ⇒ Show (NestedCtxt_ (HardForkBlock xs) Header a) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

type HeaderHash (Header blk ∷ Type) Source # 
Instance details

Defined in Ouroboros.Consensus.Block.Abstract

type HeaderHash (Header blk ∷ Type) = HeaderHash blk
type BlockProtocol (Header blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Block.Abstract

newtype Header (DisableDiffusionPipelining blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Block.SupportsDiffusionPipelining

newtype Header (SelectViewDiffusionPipelining blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Block.SupportsDiffusionPipelining

newtype Header (HardForkBlock xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

newtype Header (DualBlock m a) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

data family NestedCtxt_ blk ∷ (Type → Type) → Type → Type Source #

Context identifying what kind of block we have

In almost all places we will use NestedCtxt rather than NestedCtxt_.

Instances

Instances details
CanHardFork xs ⇒ SameDepIndex (NestedCtxt_ (HardForkBlock xs) Header ∷ Type → Type) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

SameDepIndex (NestedCtxt_ m f) ⇒ SameDepIndex (NestedCtxt_ (DualBlock m a) f ∷ Type → Type) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

sameDepIndex ∷ NestedCtxt_ (DualBlock m a) f a0 → NestedCtxt_ (DualBlock m a) f b → Maybe (a0 :~: b) Source #

All SingleEraBlock xs ⇒ Show (NestedCtxt_ (HardForkBlock xs) Header a) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

Show (NestedCtxt_ m f x) ⇒ Show (NestedCtxt_ (DualBlock m a) f x) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Methods

showsPrec ∷ Int → NestedCtxt_ (DualBlock m a) f x → ShowS #

show ∷ NestedCtxt_ (DualBlock m a) f x → String #

showList ∷ [NestedCtxt_ (DualBlock m a) f x] → ShowS #

data NestedCtxt_ (HardForkBlock xs) a b Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

data NestedCtxt_ (HardForkBlock xs) a b where
newtype NestedCtxt_ (DualBlock m a) f x Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

newtype NestedCtxt_ (DualBlock m a) f x where

class KnownNat (HashSize blk) ⇒ 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.

The associated type HashSize is the size of the hash in bytes, expressed at the type level. The hashSize method returns the same value at the term level.

The hash size is enforced by default: fromRawHash and fromShortRawHash return Nothing when the input does not have the announced hashSize. One can opt out of this check through the unsafeFromRawHash and unsafeFromShortRawHash variants, which must only be used at call sites where there is no easy way to handle failure and the size is known to be correct.

Associated Types

type HashSize blk ∷ Nat Source #

The size of the hash in number of bytes, at the type level.

See hashSize for the term-level counterpart.

Methods

toRawHash ∷ proxy blk → HeaderHash blk → ByteString Source #

Get the raw bytes from a hash

toShortRawHash ∷ proxy blk → HeaderHash blk → ShortByteString Source #

Variant of toRawHash for ShortByteString

fromRawHash ∷ proxy blk → ByteString → Maybe (HeaderHash blk) Source #

Construct the hash from a raw hash, enforcing that the input has the announced hashSize.

Returns Nothing on a size mismatch.

fromShortRawHash ∷ proxy blk → ShortByteString → Maybe (HeaderHash blk) Source #

Construct the hash from a raw hash, enforcing that the input has the announced hashSize.

Returns Nothing on a size mismatch.

unsafeFromRawHash ∷ proxy blk → ByteString → HeaderHash blk Source #

Construct the hash from a raw hash without enforcing the size.

PRECONDITION: the input's size must match hashSize.

unsafeFromShortRawHash ∷ proxy blk → ShortByteString → HeaderHash blk Source #

Construct the hash from a raw hash without enforcing the size.

PRECONDITION: the input's size must match hashSize.

hashSize ∷ proxy blk → Word32 Source #

The size of the hash in number of bytes

Instances

Instances details
CanHardFork xs ⇒ ConvertRawHash (HardForkBlock xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

Associated Types

type HashSize (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

ConvertRawHash m ⇒ ConvertRawHash (DualBlock m a) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

Associated Types

type HashSize (DualBlock m a) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

type HashSize (DualBlock m a) = HashSize m

AnnTip

distribAnnTip ∷ ∀ (xs ∷ [Type]). SListI xs ⇒ AnnTip (HardForkBlock xs) → NS AnnTip xs Source #

undistribAnnTip ∷ ∀ (xs ∷ [Type]). SListI xs ⇒ NS AnnTip xs → AnnTip (HardForkBlock xs) Source #

Orphan instances

CanHardFork xs ⇒ HasNestedContent Header (HardForkBlock xs) Source # 
Instance details

CanHardFork xs ⇒ StandardHash (HardForkBlock xs ∷ Type) Source # 
Instance details

Typeable xs ⇒ ShowProxy (Header (HardForkBlock xs) ∷ Type) Source # 
Instance details

Methods

showProxy ∷ Proxy (Header (HardForkBlock xs)) → String #

CanHardFork xs ⇒ SameDepIndex (NestedCtxt_ (HardForkBlock xs) Header ∷ Type → Type) Source # 
Instance details

All (Compose Eq Header) xs ⇒ Eq (Header (HardForkBlock xs)) Source # 
Instance details

Methods

(==) ∷ Header (HardForkBlock xs) → Header (HardForkBlock xs) → Bool #

(/=) ∷ Header (HardForkBlock xs) → Header (HardForkBlock xs) → Bool #

All Eq xs ⇒ Eq (HardForkBlock xs) Source # 
Instance details

Methods

(==) ∷ HardForkBlock xs → HardForkBlock xs → Bool #

(/=) ∷ HardForkBlock xs → HardForkBlock xs → Bool #

CanHardFork xs ⇒ Show (Header (HardForkBlock xs)) Source # 
Instance details

CanHardFork xs ⇒ NoThunks (Header (HardForkBlock xs)) Source # 
Instance details

CanHardFork xs ⇒ ConvertRawHash (HardForkBlock xs) Source # 
Instance details

Associated Types

type HashSize (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

CanHardFork xs ⇒ GetHeader (HardForkBlock xs) Source # 
Instance details

CanHardFork xs ⇒ GetPrevHash (HardForkBlock xs) Source # 
Instance details

CanHardFork xs ⇒ BasicEnvelopeValidation (HardForkBlock xs) Source # 
Instance details

CanHardFork xs ⇒ HasAnnTip (HardForkBlock xs) Source # 
Instance details

Associated Types

type TipInfo (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Block

CanHardFork xs ⇒ HasHeader (Header (HardForkBlock xs)) Source # 
Instance details

CanHardFork xs ⇒ HasHeader (HardForkBlock xs) Source # 
Instance details

All SingleEraBlock xs ⇒ Show (NestedCtxt_ (HardForkBlock xs) Header a) Source # 
Instance details