Safe Haskell | None |
---|---|
Language | Haskell2010 |
Blocks in the blockchain
Synopsis
- data Block era where
- ColeBlock ∷ ColeBlock → Block ColeEra
- SophieBlock ∷ SophieBasedEra era → SophieBlock (SophieLedgerEra era) → Block era
- pattern Block ∷ BlockHeader → [Tx era] → Block era
- data BlockHeader = BlockHeader !SlotNo !(Hash BlockHeader) !BlockNo
- data BlockInMode mode where
- BlockInMode ∷ Block era → EraInMode era mode → BlockInMode mode
- fromConsensusBlock ∷ ConsensusBlockForMode mode ~ block ⇒ ConsensusMode mode → block → BlockInMode mode
- data ChainPoint
- newtype SlotNo = SlotNo {}
- newtype EpochNo = EpochNo {}
- toConsensusPoint ∷ ∀ ledgerera. SophieBasedEra ledgerera ⇒ ChainPoint → Point (SophieBlock ledgerera)
- fromConsensusPoint ∷ ∀ ledgerera. SophieBasedEra ledgerera ⇒ Point (SophieBlock ledgerera) → ChainPoint
- toConsensusPointInMode ∷ ConsensusMode mode → ChainPoint → Point (ConsensusBlockForMode mode)
- fromConsensusPointInMode ∷ ConsensusMode mode → Point (ConsensusBlockForMode mode) → ChainPoint
- data ChainTip
- newtype BlockNo = BlockNo {}
- chainTipToChainPoint ∷ ChainTip → ChainPoint
- fromConsensusTip ∷ ConsensusBlockForMode mode ~ block ⇒ ConsensusMode mode → Tip block → ChainTip
- data family Hash keyrole ∷ Type
Blocks in the context of an era
A blockchain block in a particular Bcc era.
ColeBlock ∷ ColeBlock → Block ColeEra | |
SophieBlock ∷ SophieBasedEra era → SophieBlock (SophieLedgerEra era) → Block era |
pattern Block ∷ BlockHeader → [Tx era] → Block era | A block consists of a header and a body containing transactions. |
data BlockHeader Source #
Instances
Blocks in the context of a consensus mode
data BlockInMode mode where Source #
A Block
in one of the eras supported by a given protocol mode.
For multi-era modes such as the BccMode
this type is a sum of the
different block types for all the eras. It is used in the ChainSync protocol.
BlockInMode ∷ Block era → EraInMode era mode → BlockInMode mode |
Instances
Show (BlockInMode mode) Source # | |
Defined in Bcc.Api.Block |
fromConsensusBlock ∷ ConsensusBlockForMode mode ~ block ⇒ ConsensusMode mode → block → BlockInMode mode Source #
Points on the chain
data ChainPoint Source #
Instances
Eq ChainPoint Source # | |
Defined in Bcc.Api.Block (==) ∷ ChainPoint → ChainPoint → Bool Source # (/=) ∷ ChainPoint → ChainPoint → Bool Source # | |
Show ChainPoint Source # | |
Defined in Bcc.Api.Block |
Instances
Bounded SlotNo | |
Enum SlotNo | |
Defined in Bcc.Slotting.Slot succ ∷ SlotNo → SlotNo Source # pred ∷ SlotNo → SlotNo Source # toEnum ∷ Int → SlotNo Source # fromEnum ∷ SlotNo → Int Source # enumFrom ∷ SlotNo → [SlotNo] Source # enumFromThen ∷ SlotNo → SlotNo → [SlotNo] Source # enumFromTo ∷ SlotNo → SlotNo → [SlotNo] Source # enumFromThenTo ∷ SlotNo → SlotNo → SlotNo → [SlotNo] Source # | |
Eq SlotNo | |
Num SlotNo | |
Ord SlotNo | |
Defined in Bcc.Slotting.Slot | |
Show SlotNo | |
Generic SlotNo | |
NFData SlotNo | |
Defined in Bcc.Slotting.Slot | |
FromJSON SlotNo | |
Defined in Bcc.Slotting.Slot | |
NoThunks SlotNo | |
ToJSON SlotNo | |
Defined in Bcc.Slotting.Slot toEncoding ∷ SlotNo → Encoding # toJSONList ∷ [SlotNo] → Value # toEncodingList ∷ [SlotNo] → Encoding # | |
FromCBOR SlotNo | |
ToCBOR SlotNo | |
Serialise SlotNo | |
Defined in Bcc.Slotting.Slot encodeList ∷ [SlotNo] → Encoding decodeList ∷ Decoder s [SlotNo] | |
Condense SlotNo | |
Defined in Shardagnostic.Consensus.Util.Condense | |
HasField "ttl" (TxBody era) SlotNo | |
Defined in Sophie.Spec.Ledger.TxBody | |
HasHeader block ⇒ Anchorable (WithOrigin SlotNo) (Anchor block) block | |
Defined in Shardagnostic.Network.AnchoredFragment asAnchor ∷ block → Anchor block getAnchorMeasure ∷ Proxy block → Anchor block → WithOrigin SlotNo | |
Anchorable (WithOrigin SlotNo) (HeaderState blk) (HeaderState blk) | |
Defined in Shardagnostic.Consensus.HeaderValidation asAnchor ∷ HeaderState blk → HeaderState blk getAnchorMeasure ∷ Proxy (HeaderState blk) → HeaderState blk → WithOrigin SlotNo | |
GetTip l ⇒ Anchorable (WithOrigin SlotNo) (Checkpoint l) (Checkpoint l) | |
Defined in Shardagnostic.Consensus.Storage.LedgerDB.InMemory asAnchor ∷ Checkpoint l → Checkpoint l getAnchorMeasure ∷ Proxy (Checkpoint l) → Checkpoint l → WithOrigin SlotNo | |
Embed (StakeCreds era) (Map (Credential 'Staking era) SlotNo) | |
HasExp (StakeCreds era) (Map (Credential 'Staking era) SlotNo) | |
Defined in Sophie.Spec.Ledger.TxBody | |
type Rep SlotNo | |
Defined in Bcc.Slotting.Slot type Rep SlotNo = D1 ('MetaData "SlotNo" "Bcc.Slotting.Slot" "bcc-slotting-0.1.0.0-31796ee1b38506581e134229951d26120392aac1ce6c978fbf7438ab37ed4173" 'True) (C1 ('MetaCons "SlotNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSlotNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |
Instances
toConsensusPoint ∷ ∀ ledgerera. SophieBasedEra ledgerera ⇒ ChainPoint → Point (SophieBlock ledgerera) Source #
Convert a Point
for single Sophie-era block type
fromConsensusPoint ∷ ∀ ledgerera. SophieBasedEra ledgerera ⇒ Point (SophieBlock ledgerera) → ChainPoint Source #
Convert a Point
for single Sophie-era block type
toConsensusPointInMode ∷ ConsensusMode mode → ChainPoint → Point (ConsensusBlockForMode mode) Source #
fromConsensusPointInMode ∷ ConsensusMode mode → Point (ConsensusBlockForMode mode) → ChainPoint Source #
Tip of the chain
This is like a ChainPoint
but is conventionally used for the tip of the
chain: that is the most recent block at the end of the chain.
It also carries the BlockNo
of the chain tip.
Instances
fromConsensusTip ∷ ConsensusBlockForMode mode ~ block ⇒ ConsensusMode mode → Tip block → ChainTip Source #
Data family instances
data family Hash keyrole ∷ Type Source #