shelley-spec-ledger-0.1.0.0
Safe HaskellNone
LanguageHaskell98

Shelley.Spec.Ledger.BlockChain

Synopsis

Documentation

newtype HashHeader crypto Source #

The hash of a Block Header

Constructors

HashHeader 

Fields

Instances

Instances details
Eq (HashHeader crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

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

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

Ord (HashHeader crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

compare :: HashHeader crypto -> HashHeader crypto -> Ordering #

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

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

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

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

max :: HashHeader crypto -> HashHeader crypto -> HashHeader crypto #

min :: HashHeader crypto -> HashHeader crypto -> HashHeader crypto #

Show (HashHeader crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

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

show :: HashHeader crypto -> String #

showList :: [HashHeader crypto] -> ShowS #

Generic (HashHeader crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Associated Types

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

Methods

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

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

NFData (HashHeader crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

rnf :: HashHeader crypto -> () #

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

Defined in Shelley.Spec.Ledger.BlockChain

Methods

toCBOR :: HashHeader crypto -> Encoding Source #

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

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

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

Defined in Shelley.Spec.Ledger.BlockChain

Methods

fromCBOR :: Decoder s (HashHeader crypto) Source #

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

NoThunks (HashHeader crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

type Rep (HashHeader crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

type Rep (HashHeader crypto) = D1 ('MetaData "HashHeader" "Shelley.Spec.Ledger.BlockChain" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'True) (C1 ('MetaCons "HashHeader" 'PrefixI 'True) (S1 ('MetaSel ('Just "unHashHeader") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Hash crypto (BHeader crypto)))))

data PrevHash crypto Source #

The previous hash of a block

Constructors

GenesisHash 
BlockHash !(HashHeader crypto) 

Instances

Instances details
Eq (PrevHash crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

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

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

Ord (PrevHash crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

compare :: PrevHash crypto -> PrevHash crypto -> Ordering #

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

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

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

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

max :: PrevHash crypto -> PrevHash crypto -> PrevHash crypto #

min :: PrevHash crypto -> PrevHash crypto -> PrevHash crypto #

Show (PrevHash crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

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

show :: PrevHash crypto -> String #

showList :: [PrevHash crypto] -> ShowS #

Generic (PrevHash crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Associated Types

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

Methods

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

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

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

Defined in Shelley.Spec.Ledger.BlockChain

Methods

toCBOR :: PrevHash crypto -> Encoding Source #

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

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

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

Defined in Shelley.Spec.Ledger.BlockChain

Methods

fromCBOR :: Decoder s (PrevHash crypto) Source #

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

Crypto crypto => NoThunks (PrevHash crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

type Rep (PrevHash crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

type Rep (PrevHash crypto) = D1 ('MetaData "PrevHash" "Shelley.Spec.Ledger.BlockChain" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "GenesisHash" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BlockHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashHeader crypto))))

data LastAppliedBlock crypto Source #

Constructors

LastAppliedBlock 

Fields

Instances

Instances details
Eq (LastAppliedBlock crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

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

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

Show (LastAppliedBlock crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

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

show :: LastAppliedBlock crypto -> String #

showList :: [LastAppliedBlock crypto] -> ShowS #

Generic (LastAppliedBlock crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Associated Types

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

Methods

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

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

NFData (LastAppliedBlock crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

rnf :: LastAppliedBlock crypto -> () #

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

Defined in Shelley.Spec.Ledger.BlockChain

Methods

toCBOR :: LastAppliedBlock crypto -> Encoding Source #

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

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

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

Defined in Shelley.Spec.Ledger.BlockChain

Crypto crypto => NoThunks (LastAppliedBlock crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

type Rep (LastAppliedBlock crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

type Rep (LastAppliedBlock crypto) = D1 ('MetaData "LastAppliedBlock" "Shelley.Spec.Ledger.BlockChain" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "LastAppliedBlock" 'PrefixI 'True) (S1 ('MetaSel ('Just "labBlockNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockNo) :*: (S1 ('MetaSel ('Just "labSlotNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo) :*: S1 ('MetaSel ('Just "labHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashHeader crypto)))))

data BHBody crypto Source #

Constructors

BHBody 

Fields

Instances

Instances details
Crypto crypto => Eq (BHBody crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

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

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

Crypto crypto => Show (BHBody crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

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

show :: BHBody crypto -> String #

showList :: [BHBody crypto] -> ShowS #

Generic (BHBody crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Associated Types

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

Methods

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

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

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

Defined in Shelley.Spec.Ledger.BlockChain

Methods

toCBOR :: BHBody crypto -> Encoding Source #

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

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

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

Defined in Shelley.Spec.Ledger.BlockChain

Methods

fromCBOR :: Decoder s (BHBody crypto) Source #

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

Crypto crypto => SignableRepresentation (BHBody crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Crypto crypto => NoThunks (BHBody crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

type Rep (BHBody crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

type Rep (BHBody crypto) = D1 ('MetaData "BHBody" "Shelley.Spec.Ledger.BlockChain" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "BHBody" 'PrefixI 'True) (((S1 ('MetaSel ('Just "bheaderBlockNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockNo) :*: S1 ('MetaSel ('Just "bheaderSlotNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo)) :*: (S1 ('MetaSel ('Just "bheaderPrev") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PrevHash crypto)) :*: (S1 ('MetaSel ('Just "bheaderVk") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VKey 'BlockIssuer crypto)) :*: S1 ('MetaSel ('Just "bheaderVrfVk") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VerKeyVRF crypto))))) :*: ((S1 ('MetaSel ('Just "bheaderEta") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CertifiedVRF crypto Nonce)) :*: (S1 ('MetaSel ('Just "bheaderL") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CertifiedVRF crypto Natural)) :*: S1 ('MetaSel ('Just "bsize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural))) :*: (S1 ('MetaSel ('Just "bhash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HashBBody crypto)) :*: (S1 ('MetaSel ('Just "bheaderOCert") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (OCert crypto)) :*: S1 ('MetaSel ('Just "bprotver") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ProtVer))))))

poolIDfromBHBody :: Crypto crypto => BHBody crypto -> KeyHash 'BlockIssuer crypto Source #

Deprecated: poolIDfromBHBody has been deprecated (the name is misleading), use issuerIDfromBHBody

Retrieve the pool id (the hash of the pool operator's cold key) from the body of the block header.

issuerIDfromBHBody :: Crypto crypto => BHBody crypto -> KeyHash 'BlockIssuer crypto Source #

Retrieve the issuer id (the hash of the cold key) from the body of the block header. This corresponds to either a genesis/core node or a stake pool.

data BHeader crypto where Source #

Bundled Patterns

pattern BHeader :: Crypto crypto => BHBody crypto -> SignedKES crypto (BHBody crypto) -> BHeader crypto 

Instances

Instances details
Crypto crypto => Eq (BHeader crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

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

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

Crypto crypto => Show (BHeader crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

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

show :: BHeader crypto -> String #

showList :: [BHeader crypto] -> ShowS #

Generic (BHeader crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Associated Types

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

Methods

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

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

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

Defined in Shelley.Spec.Ledger.BlockChain

Methods

toCBOR :: BHeader crypto -> Encoding Source #

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

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

Crypto crypto => FromCBOR (Annotator (BHeader crypto)) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

fromCBOR :: Decoder s (Annotator (BHeader crypto)) Source #

label :: Proxy (Annotator (BHeader crypto)) -> Text Source #

Crypto crypto => NoThunks (BHeader crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

type Rep (BHeader crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

type Rep (BHeader crypto) = D1 ('MetaData "BHeader" "Shelley.Spec.Ledger.BlockChain" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "BHeader'" 'PrefixI 'True) (S1 ('MetaSel ('Just "bHeaderBody'") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (BHBody crypto)) :*: (S1 ('MetaSel ('Just "bHeaderSig'") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SignedKES crypto (BHBody crypto))) :*: S1 ('MetaSel ('Just "bHeaderBytes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteString))))

data Block era Source #

Constructors

Block' !(BHeader (Crypto era)) !(TxSeq era) ByteString 

Bundled Patterns

pattern Block :: Era era => BHeader (Crypto era) -> TxSeq era -> Block era 

Instances

Instances details
ShelleyBased era => Eq (Block era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

(==) :: Block era -> Block era -> Bool #

(/=) :: Block era -> Block era -> Bool #

ShelleyBased era => Show (Block era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

showsPrec :: Int -> Block era -> ShowS #

show :: Block era -> String #

showList :: [Block era] -> ShowS #

Generic (Block era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Associated Types

type Rep (Block era) :: Type -> Type #

Methods

from :: Block era -> Rep (Block era) x #

to :: Rep (Block era) x -> Block era #

Era era => ToCBOR (Block era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

toCBOR :: Block era -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (Block era) -> Size Source #

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

(ShelleyBased era, ValidateScript era) => FromCBOR (Annotator (Block era)) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

ShelleyBased era => NoThunks (Block era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

type Rep (Block era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

type Rep (Block era) = D1 ('MetaData "Block" "Shelley.Spec.Ledger.BlockChain" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "Block'" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (BHeader (Crypto era))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (TxSeq era)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))))

newtype LaxBlock era Source #

Constructors

LaxBlock (Block era) 

Instances

Instances details
ShelleyBased era => Show (LaxBlock era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

showsPrec :: Int -> LaxBlock era -> ShowS #

show :: LaxBlock era -> String #

showList :: [LaxBlock era] -> ShowS #

Era era => ToCBOR (LaxBlock era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

toCBOR :: LaxBlock era -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (LaxBlock era) -> Size Source #

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

(ShelleyBased era, ValidateScript era) => FromCBOR (Annotator (LaxBlock era)) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

data TxSeq era Source #

Bundled Patterns

pattern TxSeq :: (Era era, TxBodyConstraints era, ToCBOR (AuxiliaryData era)) => StrictSeq (Tx era) -> TxSeq era 

Instances

Instances details
ShelleyBased era => Eq (TxSeq era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

(==) :: TxSeq era -> TxSeq era -> Bool #

(/=) :: TxSeq era -> TxSeq era -> Bool #

ShelleyBased era => Show (TxSeq era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

showsPrec :: Int -> TxSeq era -> ShowS #

show :: TxSeq era -> String #

showList :: [TxSeq era] -> ShowS #

Generic (TxSeq era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Associated Types

type Rep (TxSeq era) :: Type -> Type #

Methods

from :: TxSeq era -> Rep (TxSeq era) x #

to :: Rep (TxSeq era) x -> TxSeq era #

ShelleyBased era => NoThunks (TxSeq era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Era era => ToCBORGroup (TxSeq era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

toCBORGroup :: TxSeq era -> Encoding Source #

encodedGroupSizeExpr :: (forall x. ToCBOR x => Proxy x -> Size) -> Proxy (TxSeq era) -> Size Source #

listLen :: TxSeq era -> Word Source #

listLenBound :: Proxy (TxSeq era) -> Word Source #

type Rep (TxSeq era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

type Rep (TxSeq era) = D1 ('MetaData "TxSeq" "Shelley.Spec.Ledger.BlockChain" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "TxSeq'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "txSeqTxns'") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictSeq (Tx era))) :*: S1 ('MetaSel ('Just "txSeqBodyBytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)) :*: (S1 ('MetaSel ('Just "txSeqWitsBytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString) :*: S1 ('MetaSel ('Just "txSeqMetadataBytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))))

newtype HashBBody crypto Source #

Hash of block body

Instances

Instances details
Eq (HashBBody crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

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

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

Ord (HashBBody crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

compare :: HashBBody crypto -> HashBBody crypto -> Ordering #

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

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

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

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

max :: HashBBody crypto -> HashBBody crypto -> HashBBody crypto #

min :: HashBBody crypto -> HashBBody crypto -> HashBBody crypto #

Show (HashBBody crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

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

show :: HashBBody crypto -> String #

showList :: [HashBBody crypto] -> ShowS #

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

Defined in Shelley.Spec.Ledger.BlockChain

Methods

toCBOR :: HashBBody crypto -> Encoding Source #

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

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

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

Defined in Shelley.Spec.Ledger.BlockChain

Methods

fromCBOR :: Decoder s (HashBBody crypto) Source #

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

NoThunks (HashBBody crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

bhHash :: forall crypto. Crypto crypto => BHeader crypto -> HashHeader crypto Source #

Hash a given block header

bbHash :: forall era. Era era => TxSeq era -> HashBBody (Crypto era) Source #

Hash a given block body

hashHeaderToNonce :: HashHeader crypto -> Nonce Source #

HashHeader to Nonce

bHeaderSize :: forall crypto. Crypto crypto => BHeader crypto -> Int Source #

bBodySize :: forall era. Era era => TxSeq era -> Int Source #

bheader :: Era era => Block era -> BHeader (Crypto era) Source #

bhbody :: Crypto crypto => BHeader crypto -> BHBody crypto Source #

bbody :: Era era => Block era -> TxSeq era Source #

bnonce :: BHBody crypto -> Nonce Source #

Retrieve the new nonce from the block header body.

incrBlocks :: Bool -> KeyHash 'StakePool crypto -> BlocksMade crypto -> BlocksMade crypto Source #

mkSeed Source #

Arguments

:: Nonce

Universal constant

-> SlotNo 
-> Nonce

Epoch nonce

-> Seed 

Construct a seed to use in the VRF computation.

checkLeaderValue :: forall v. VRFAlgorithm v => OutputVRF v -> Rational -> ActiveSlotCoeff -> Bool Source #

Check that the certified input natural is valid for being slot leader. This means we check that

fromNat (certNat) < 1 - (1 - f)^σ

where fromNat creates an appropriate value in [0;1] from the certified natural. The calculation is done using the following optimization:

let p = fromNat (certNat) and c = ln(1 - f)

then p < 1 - (1 - f)^σ = 1 / (1 - p) < exp(-σ * c)

this can be efficiently be computed by taylorExpCmp which returns ABOVE in case the reference value `1 / (1 - p)` is above the exponential function at `-σ * c`, BELOW if it is below or MaxReached if it couldn't conclusively compute this within the given iteration bounds.