Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data BlockHeader = BlockHeader {
- _bhPrevHash ∷ !Hash
- _bhSlot ∷ !Slot
- _bhIssuer ∷ !VKey
- _bhSig ∷ !(Sig Hash)
- _bhUtxoHash ∷ !Hash
- _bhDlgHash ∷ !Hash
- _bhUpdHash ∷ !Hash
- bhUtxoHash ∷ Lens' BlockHeader Hash
- bhUpdHash ∷ Lens' BlockHeader Hash
- bhSlot ∷ Lens' BlockHeader Slot
- bhSig ∷ Lens' BlockHeader (Sig Hash)
- bhPrevHash ∷ Lens' BlockHeader Hash
- bhIssuer ∷ Lens' BlockHeader VKey
- bhDlgHash ∷ Lens' BlockHeader Hash
- data BlockBody = BlockBody {}
- bUtxo ∷ Lens' BlockBody [Tx]
- bUpdVotes ∷ Lens' BlockBody [Vote]
- bUpdProp ∷ Lens' BlockBody (Maybe UProp)
- bProtVer ∷ Lens' BlockBody ProtVer
- bDCerts ∷ Lens' BlockBody [DCert]
- data Block = Block {}
- bHeader ∷ Lens' Block BlockHeader
- bBody ∷ Lens' Block BlockBody
- mkBlock ∷ Hash → Slot → VKey → ProtVer → [DCert] → Maybe UProp → [Vote] → [Tx] → Block
- genesisHash ∷ Hash
- bEndorsment ∷ Block → (ProtVer, VKey)
- bSlot ∷ Block → Slot
- bUpdPayload ∷ Block → (Maybe UProp, [Vote])
- bSize ∷ Block → Natural
- bBodySize ∷ BlockBody → Natural
- bHeaderSize ∷ BlockHeader → Natural
- hashHeader ∷ BlockHeader → Hash
- bhToSign ∷ BlockHeader → Hash
- bhHash ∷ BlockHeader → Hash
- bIsEBB ∷ Block → Bool
- updateBody ∷ Block → (BlockBody → BlockBody) → Block
- data BlockStats = BlockStats {}
- blockStats ∷ Block → BlockStats
- chainBlockStats ∷ [BlockStats] → Maybe (BlockStats, BlockStats, BlockStats)
Documentation
data BlockHeader Source #
BlockHeader | |
|
Instances
Data BlockHeader Source # | |
Defined in Byron.Spec.Chain.STS.Block 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 # toConstr ∷ BlockHeader → Constr # dataTypeOf ∷ BlockHeader → DataType # dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c BlockHeader) # dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c BlockHeader) # gmapT ∷ (∀ b. Data b ⇒ b → b) → BlockHeader → BlockHeader # 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] # gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → BlockHeader → u # gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → BlockHeader → m BlockHeader # gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → BlockHeader → m BlockHeader # gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → BlockHeader → m BlockHeader # | |
Generic BlockHeader Source # | |
Defined in Byron.Spec.Chain.STS.Block type Rep BlockHeader ∷ Type → Type # from ∷ BlockHeader → Rep BlockHeader x # to ∷ Rep BlockHeader x → BlockHeader # | |
Show BlockHeader Source # | |
Defined in Byron.Spec.Chain.STS.Block showsPrec ∷ Int → BlockHeader → ShowS # show ∷ BlockHeader → String # showList ∷ [BlockHeader] → ShowS # | |
HasTypeReps BlockHeader Source # | |
Defined in Byron.Spec.Chain.STS.Block typeReps ∷ BlockHeader → Seq TypeRep Source # | |
Eq BlockHeader Source # | |
Defined in Byron.Spec.Chain.STS.Block (==) ∷ BlockHeader → BlockHeader → Bool # (/=) ∷ BlockHeader → BlockHeader → Bool # | |
type Rep BlockHeader Source # | |
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))))) |
Instances
Data BlockBody Source # | |
Defined in Byron.Spec.Chain.STS.Block 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 # toConstr ∷ BlockBody → Constr # dataTypeOf ∷ BlockBody → DataType # dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c BlockBody) # dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c BlockBody) # gmapT ∷ (∀ b. Data b ⇒ b → b) → BlockBody → BlockBody # 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] # gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → BlockBody → u # gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → BlockBody → m BlockBody # gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → BlockBody → m BlockBody # gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → BlockBody → m BlockBody # | |
Generic BlockBody Source # | |
Show BlockBody Source # | |
HasTypeReps BlockBody Source # | |
type Rep BlockBody Source # | |
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))))) |
A block in the chain. The specification only models regular blocks since epoch boundary blocks will be largely ignored in the Byron-Shelley bridge.
Instances
Data Block Source # | |
Defined in Byron.Spec.Chain.STS.Block 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 # dataTypeOf ∷ Block → DataType # dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c Block) # dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c Block) # gmapT ∷ (∀ b. Data b ⇒ b → b) → Block → Block # 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] # gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → Block → u # gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → Block → m Block # gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → Block → m Block # gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → Block → m Block # | |
Generic Block Source # | |
Show Block Source # | |
HasTypeReps Block Source # | |
HasSizeInfo Block Source # | |
type Rep Block Source # | |
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))) |
Dummy genesis hash.
bBodySize ∷ BlockBody → Natural Source #
Compute the abstract size (in words) that a block body occupies.
bHeaderSize ∷ BlockHeader → Natural Source #
Compute the abstract size (in words) that a block header occupies.
hashHeader ∷ BlockHeader → Hash Source #
Computes the hash of a header.
bhToSign ∷ BlockHeader → Hash Source #
Computes the hash of the header.
bhHash ∷ BlockHeader → Hash Source #
bIsEBB ∷ Block → Bool 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.
updateBody ∷ Block → (BlockBody → BlockBody) → Block Source #
Update a field of the block body, recomputing the hashes to get a valid block.
data BlockStats Source #
BlockStats | |
|
Instances
Show BlockStats Source # | |
Defined in Byron.Spec.Chain.STS.Block |
blockStats ∷ Block → BlockStats 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.