byron-spec-chain-1.0.1.0: Executable specification of the Cardano blockchain
Safe HaskellSafe-Inferred
LanguageHaskell2010

Byron.Spec.Chain.STS.Block

Synopsis

Documentation

data BlockHeader Source #

Constructors

BlockHeader 

Fields

Instances

Instances details
Data BlockHeader Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → BlockHeader → c BlockHeader Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c BlockHeader Source #

toConstrBlockHeaderConstr Source #

dataTypeOfBlockHeaderDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c BlockHeader) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c BlockHeader) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → BlockHeaderBlockHeader Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → BlockHeader → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → BlockHeader → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → BlockHeader → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → BlockHeader → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → BlockHeader → m BlockHeader Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → BlockHeader → m BlockHeader Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → BlockHeader → m BlockHeader Source #

Generic BlockHeader Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Associated Types

type Rep BlockHeaderTypeType Source #

Show BlockHeader Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

HasTypeReps BlockHeader Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Eq BlockHeader Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

type Rep BlockHeader Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

type Rep BlockHeader = D1 ('MetaData "BlockHeader" "Byron.Spec.Chain.STS.Block" "byron-spec-chain-1.0.1.0-inplace" 'False) (C1 ('MetaCons "BlockHeader" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_bhPrevHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Hash) :*: (S1 ('MetaSel ('Just "_bhSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Slot) :*: S1 ('MetaSel ('Just "_bhIssuer") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 VKey))) :*: ((S1 ('MetaSel ('Just "_bhSig") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Sig Hash)) :*: S1 ('MetaSel ('Just "_bhUtxoHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Hash)) :*: (S1 ('MetaSel ('Just "_bhDlgHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Hash) :*: S1 ('MetaSel ('Just "_bhUpdHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Hash)))))

data BlockBody Source #

Constructors

BlockBody 

Fields

Instances

Instances details
Data BlockBody Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → BlockBody → c BlockBody Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c BlockBody Source #

toConstrBlockBodyConstr Source #

dataTypeOfBlockBodyDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c BlockBody) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c BlockBody) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → BlockBodyBlockBody Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → BlockBody → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → BlockBody → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → BlockBody → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → BlockBody → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → BlockBody → m BlockBody Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → BlockBody → m BlockBody Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → BlockBody → m BlockBody Source #

Generic BlockBody Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Associated Types

type Rep BlockBodyTypeType Source #

Show BlockBody Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

HasTypeReps BlockBody Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

type Rep BlockBody Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

type Rep BlockBody = D1 ('MetaData "BlockBody" "Byron.Spec.Chain.STS.Block" "byron-spec-chain-1.0.1.0-inplace" 'False) (C1 ('MetaCons "BlockBody" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_bDCerts") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [DCert]) :*: S1 ('MetaSel ('Just "_bUtxo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Tx])) :*: (S1 ('MetaSel ('Just "_bUpdProp") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe UProp)) :*: (S1 ('MetaSel ('Just "_bUpdVotes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Vote]) :*: S1 ('MetaSel ('Just "_bProtVer") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ProtVer)))))

data Block Source #

A block in the chain. The specification only models regular blocks since epoch boundary blocks will be largely ignored in the Byron-Shelley bridge.

Constructors

Block 

Instances

Instances details
Data Block Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → Block → c Block Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c Block Source #

toConstrBlockConstr Source #

dataTypeOfBlockDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c Block) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c Block) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → BlockBlock Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → Block → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → Block → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → Block → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → Block → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → Block → m Block Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → Block → m Block Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → Block → m Block Source #

Generic Block Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Associated Types

type Rep BlockTypeType Source #

Methods

fromBlockRep Block x Source #

toRep Block x → Block Source #

Show Block Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

HasTypeReps Block Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Methods

typeRepsBlockSeq TypeRep Source #

HasSizeInfo Block Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Methods

isTrivialBlockBool Source #

type Rep Block Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

type Rep Block = D1 ('MetaData "Block" "Byron.Spec.Chain.STS.Block" "byron-spec-chain-1.0.1.0-inplace" 'False) (C1 ('MetaCons "Block" 'PrefixI 'True) (S1 ('MetaSel ('Just "_bHeader") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BlockHeader) :*: S1 ('MetaSel ('Just "_bBody") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BlockBody)))

mkBlock Source #

Arguments

Hash

Hash of the previous block

Slot

Current slot

VKey

Issuer

ProtVer

Protocol version

→ [DCert]

Delegation certificates

Maybe UProp

Update proposal

→ [Vote]

Votes on update proposals

→ [Tx]

UTxO payload

Block 

genesisHashHash Source #

Dummy genesis hash.

bEndorsmentBlock → (ProtVer, VKey) Source #

Protocol version endorsment

bSlotBlockSlot Source #

Slot the block is published in

bUpdPayloadBlock → (Maybe UProp, [Vote]) Source #

Block update payload

bSizeBlockNatural Source #

Compute the abstract size (in words) that a block takes.

bBodySizeBlockBodyNatural Source #

Compute the abstract size (in words) that a block body occupies.

bHeaderSizeBlockHeaderNatural Source #

Compute the abstract size (in words) that a block header occupies.

hashHeaderBlockHeaderHash Source #

Computes the hash of a header.

bhToSignBlockHeaderHash Source #

Computes the hash of the header.

bIsEBBBlockBool Source #

Checks if a block is an epoch boundary block.

The function always returns False because tests will be performed only against chains without EBBs.

updateBodyBlock → (BlockBodyBlockBody) → Block Source #

Update a field of the block body, recomputing the hashes to get a valid block.

data BlockStats Source #

Constructors

BlockStats 

Fields

Instances

Instances details
Show BlockStats Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

blockStatsBlockBlockStats Source #

Count number of transactions in the block

Returns the number of

  • Regular transactions
  • Delegation certificates
  • Update votes
  • Update proposals (0 or 1)

chainBlockStats ∷ [BlockStats] → Maybe (BlockStats, BlockStats, BlockStats) Source #

Block stats for an entire chain

Computes minimum, maximum, and average values.

Returns Nothing for the empty chain.