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 #

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

toConstrBlockHeader → Constr #

dataTypeOfBlockHeaderDataType #

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

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

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

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

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

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

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

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

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

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

Generic BlockHeader Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Associated Types

type Rep BlockHeaderTypeType #

Show BlockHeader Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

HasTypeReps BlockHeader Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Methods

typeRepsBlockHeaderSeq TypeRep Source #

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 #

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

toConstrBlockBody → Constr #

dataTypeOfBlockBodyDataType #

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

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

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

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

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

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

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

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

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

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

Generic BlockBody Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Associated Types

type Rep BlockBodyTypeType #

Methods

fromBlockBodyRep BlockBody x #

toRep BlockBody x → BlockBody #

Show BlockBody Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Methods

showsPrecIntBlockBodyShowS #

showBlockBodyString #

showList ∷ [BlockBody] → ShowS #

HasTypeReps BlockBody Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Methods

typeRepsBlockBodySeq TypeRep Source #

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 #

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

toConstrBlock → Constr #

dataTypeOfBlockDataType #

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

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

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

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

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

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

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

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

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

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

Generic Block Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Associated Types

type Rep BlockTypeType #

Methods

fromBlockRep Block x #

toRep Block x → Block #

Show Block Source # 
Instance details

Defined in Byron.Spec.Chain.STS.Block

Methods

showsPrecIntBlockShowS #

showBlockString #

showList ∷ [Block] → ShowS #

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.