Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Byron.Ledger.Ledger
Description
Instances requires for consensus/ledger integration
Synopsis
- data ByronTransition = ByronTransitionInfo !(Map ProtocolVersion BlockNo)
- byronEraParams :: Config -> EraParams
- byronEraParamsNeverHardForks :: Config -> EraParams
- initByronLedgerState :: Config -> Maybe UTxO -> LedgerState ByronBlock
- decodeByronAnnTip :: Decoder s (AnnTip ByronBlock)
- decodeByronLedgerState :: Decoder s (LedgerState ByronBlock)
- decodeByronQuery :: Decoder s (SomeSecond BlockQuery ByronBlock)
- decodeByronResult :: BlockQuery ByronBlock result -> forall s. Decoder s result
- encodeByronAnnTip :: AnnTip ByronBlock -> Encoding
- encodeByronExtLedgerState :: ExtLedgerState ByronBlock -> Encoding
- encodeByronHeaderState :: HeaderState ByronBlock -> Encoding
- encodeByronLedgerState :: LedgerState ByronBlock -> Encoding
- encodeByronQuery :: BlockQuery ByronBlock result -> Encoding
- encodeByronResult :: BlockQuery ByronBlock result -> result -> Encoding
- data family BlockQuery blk :: Type -> Type
- data family LedgerState blk
- data family Ticked st
- validationErrorImpossible :: forall err a. Except err a -> a
Documentation
data ByronTransition Source #
Information required to determine the transition from Byron to Shelley
Constructors
ByronTransitionInfo !(Map ProtocolVersion BlockNo) | Per candidate proposal, the The HFC needs to know when a candidate proposal becomes stable. We cannot
reliably do this using Invariant: the domain of this map should equal the set of candidate proposals. |
Instances
Ledger integration
byronEraParams :: Config -> EraParams Source #
To be used for a Byron-to-X (where X is typically Shelley) chain.
byronEraParamsNeverHardForks :: Config -> EraParams Source #
Separate variant of byronEraParams
to be used for a Byron-only chain.
Arguments
:: Config | |
-> Maybe UTxO | Optionally override UTxO |
-> LedgerState ByronBlock |
Serialisation
decodeByronAnnTip :: Decoder s (AnnTip ByronBlock) Source #
decodeByronLedgerState :: Decoder s (LedgerState ByronBlock) Source #
decodeByronQuery :: Decoder s (SomeSecond BlockQuery ByronBlock) Source #
decodeByronResult :: BlockQuery ByronBlock result -> forall s. Decoder s result Source #
encodeByronAnnTip :: AnnTip ByronBlock -> Encoding Source #
encodeByronExtLedgerState :: ExtLedgerState ByronBlock -> Encoding Source #
encodeByronHeaderState :: HeaderState ByronBlock -> Encoding Source #
encodeByronLedgerState :: LedgerState ByronBlock -> Encoding Source #
encodeByronQuery :: BlockQuery ByronBlock result -> Encoding Source #
encodeByronResult :: BlockQuery ByronBlock result -> result -> Encoding Source #
Type family instances
data family BlockQuery blk :: Type -> Type #
Instances
SerialiseResult ByronBlock (BlockQuery ByronBlock) | |
Defined in Ouroboros.Consensus.Byron.Node.Serialisation Methods encodeResult :: CodecConfig ByronBlock -> BlockNodeToClientVersion ByronBlock -> BlockQuery ByronBlock result -> result -> Encoding decodeResult :: CodecConfig ByronBlock -> BlockNodeToClientVersion ByronBlock -> BlockQuery ByronBlock result -> forall s. Decoder s result | |
SerialiseNodeToClient ByronBlock (SomeSecond BlockQuery ByronBlock) | |
Defined in Ouroboros.Consensus.Byron.Node.Serialisation Methods encodeNodeToClient :: CodecConfig ByronBlock -> BlockNodeToClientVersion ByronBlock -> SomeSecond BlockQuery ByronBlock -> Encoding decodeNodeToClient :: CodecConfig ByronBlock -> BlockNodeToClientVersion ByronBlock -> forall s. Decoder s (SomeSecond BlockQuery ByronBlock) | |
Inject (SomeSecond BlockQuery) | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Nary Methods inject :: forall x (xs :: [Type]). CanHardFork xs => Exactly xs Bound -> Index xs x -> SomeSecond BlockQuery x -> SomeSecond BlockQuery (HardForkBlock xs) | |
SameDepIndex (BlockQuery ByronBlock) | |
Defined in Ouroboros.Consensus.Byron.Ledger.Ledger Methods sameDepIndex :: BlockQuery ByronBlock a -> BlockQuery ByronBlock b -> Maybe (a :~: b) | |
SameDepIndex (BlockQuery (ShelleyBlock proto era)) | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query Methods sameDepIndex :: BlockQuery (ShelleyBlock proto era) a -> BlockQuery (ShelleyBlock proto era) b -> Maybe (a :~: b) | |
ShowQuery (BlockQuery ByronBlock) | |
Defined in Ouroboros.Consensus.Byron.Ledger.Ledger Methods showResult :: BlockQuery ByronBlock result -> result -> String | |
ShelleyCompatible proto era => ShowQuery (BlockQuery (ShelleyBlock proto era)) | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query Methods showResult :: BlockQuery (ShelleyBlock proto era) result -> result -> String | |
Show (BlockQuery ByronBlock result) Source # | |
Defined in Ouroboros.Consensus.Byron.Ledger.Ledger Methods showsPrec :: Int -> BlockQuery ByronBlock result -> ShowS Source # show :: BlockQuery ByronBlock result -> String Source # showList :: [BlockQuery ByronBlock result] -> ShowS Source # | |
Show (BlockQuery (ShelleyBlock proto era) result) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query Methods showsPrec :: Int -> BlockQuery (ShelleyBlock proto era) result -> ShowS Source # show :: BlockQuery (ShelleyBlock proto era) result -> String Source # showList :: [BlockQuery (ShelleyBlock proto era) result] -> ShowS Source # | |
(forall result. Show (BlockQuery blk result)) => Show (SomeSecond BlockQuery blk) | |
Defined in Ouroboros.Consensus.Ledger.Query | |
Eq (BlockQuery ByronBlock result) Source # | |
Defined in Ouroboros.Consensus.Byron.Ledger.Ledger Methods (==) :: BlockQuery ByronBlock result -> BlockQuery ByronBlock result -> Bool Source # (/=) :: BlockQuery ByronBlock result -> BlockQuery ByronBlock result -> Bool Source # | |
Eq (BlockQuery (ShelleyBlock proto era) result) Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query Methods (==) :: BlockQuery (ShelleyBlock proto era) result -> BlockQuery (ShelleyBlock proto era) result -> Bool Source # (/=) :: BlockQuery (ShelleyBlock proto era) result -> BlockQuery (ShelleyBlock proto era) result -> Bool Source # | |
SameDepIndex (BlockQuery blk) => Eq (SomeSecond BlockQuery blk) | |
Defined in Ouroboros.Consensus.Ledger.Query Methods (==) :: SomeSecond BlockQuery blk -> SomeSecond BlockQuery blk -> Bool Source # (/=) :: SomeSecond BlockQuery blk -> SomeSecond BlockQuery blk -> Bool Source # | |
ShelleyCompatible proto era => SerialiseResult (ShelleyBlock proto era) (BlockQuery (ShelleyBlock proto era)) | |
Defined in Ouroboros.Consensus.Shelley.Node.Serialisation Methods encodeResult :: CodecConfig (ShelleyBlock proto era) -> BlockNodeToClientVersion (ShelleyBlock proto era) -> BlockQuery (ShelleyBlock proto era) result -> result -> Encoding decodeResult :: CodecConfig (ShelleyBlock proto era) -> BlockNodeToClientVersion (ShelleyBlock proto era) -> BlockQuery (ShelleyBlock proto era) result -> forall s. Decoder s result | |
ShowProxy (BlockQuery ByronBlock) | |
Defined in Ouroboros.Consensus.Byron.Ledger.Ledger Methods showProxy :: Proxy (BlockQuery ByronBlock) -> String | |
(Typeable era, Typeable proto) => ShowProxy (BlockQuery (ShelleyBlock proto era) :: Type -> Type) | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query Methods showProxy :: Proxy (BlockQuery (ShelleyBlock proto era)) -> String | |
ShelleyCompatible proto era => SerialiseNodeToClient (ShelleyBlock proto era) (SomeSecond BlockQuery (ShelleyBlock proto era)) | |
Defined in Ouroboros.Consensus.Shelley.Node.Serialisation Methods encodeNodeToClient :: CodecConfig (ShelleyBlock proto era) -> BlockNodeToClientVersion (ShelleyBlock proto era) -> SomeSecond BlockQuery (ShelleyBlock proto era) -> Encoding decodeNodeToClient :: CodecConfig (ShelleyBlock proto era) -> BlockNodeToClientVersion (ShelleyBlock proto era) -> forall s. Decoder s (SomeSecond BlockQuery (ShelleyBlock proto era)) | |
data BlockQuery ByronBlock a Source # | |
Defined in Ouroboros.Consensus.Byron.Ledger.Ledger | |
data BlockQuery (HardForkBlock xs) a | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.Query data BlockQuery (HardForkBlock xs) a where
| |
data BlockQuery (ShelleyBlock proto era) a Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query data BlockQuery (ShelleyBlock proto era) a where
|
data family LedgerState blk #
Instances
Instances
Auxiliary
validationErrorImpossible :: forall err a. Except err a -> a Source #
Mark computation as validation error free
Given a BlockValidationMode
of NoBlockValidation
, a call to
applyByronBlock
shouldn't fail since the ledger layer won't be performing
any block validation checks. However, because applyByronBlock
can fail in
the event it is given a BlockValidationMode
of BlockValidation
, it still
looks like it can fail (since its type doesn't change based on the
ValidationMode
) and we must still treat it as such.