hydra-tx
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Chain.ChainState

Synopsis

Documentation

newtype ChainSlot Source #

A generic description for a chain slot all implementations need to use.

Constructors

ChainSlot Natural 

Instances

Instances details
FromJSON ChainSlot Source # 
Instance details

Defined in Hydra.Chain.ChainState

Methods

parseJSON :: Value -> Parser ChainSlot

parseJSONList :: Value -> Parser [ChainSlot]

omittedField :: Maybe ChainSlot

ToJSON ChainSlot Source # 
Instance details

Defined in Hydra.Chain.ChainState

Methods

toJSON :: ChainSlot -> Value

toEncoding :: ChainSlot -> Encoding

toJSONList :: [ChainSlot] -> Value

toEncodingList :: [ChainSlot] -> Encoding

omitField :: ChainSlot -> Bool

Generic ChainSlot Source # 
Instance details

Defined in Hydra.Chain.ChainState

Associated Types

type Rep ChainSlot :: Type -> Type Source #

Num ChainSlot Source # 
Instance details

Defined in Hydra.Chain.ChainState

Show ChainSlot Source # 
Instance details

Defined in Hydra.Chain.ChainState

FromCBOR ChainSlot Source # 
Instance details

Defined in Hydra.Chain.ChainState

Methods

fromCBOR :: Decoder s ChainSlot

label :: Proxy ChainSlot -> Text

ToCBOR ChainSlot Source # 
Instance details

Defined in Hydra.Chain.ChainState

Methods

toCBOR :: ChainSlot -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy ChainSlot -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [ChainSlot] -> Size

Eq ChainSlot Source # 
Instance details

Defined in Hydra.Chain.ChainState

Ord ChainSlot Source # 
Instance details

Defined in Hydra.Chain.ChainState

type Rep ChainSlot Source # 
Instance details

Defined in Hydra.Chain.ChainState

type Rep ChainSlot = D1 ('MetaData "ChainSlot" "Hydra.Chain.ChainState" "hydra-tx-2.3.0-AmphLXDqLbeiaw5uNmLIz" 'True) (C1 ('MetaCons "ChainSlot" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)))

class (IsTx tx, Ord (ChainPointType tx), Eq (ChainPointType tx), Show (ChainPointType tx), FromJSON (ChainPointType tx), ToJSON (ChainPointType tx), FromCBOR (ChainPointType tx), ToCBOR (ChainPointType tx), Eq (ChainStateType tx), Show (ChainStateType tx), FromJSON (ChainStateType tx), ToJSON (ChainStateType tx), FromCBOR (ChainStateType tx), ToCBOR (ChainStateType tx)) => IsChainState tx where Source #

Types that can be used on-chain by the Hydra protocol. This includes the information that needs to be retained about the L1 state to interact with Hydra heads via the chain.

XXX: Find a better name for this. Maybe HasL1State, IsChainTx or IsL1Tx?

Associated Types

type ChainPointType tx = p | p -> tx Source #

Type of unique points on the chain.

type ChainStateType tx = c | c -> tx Source #

Type of what to keep as L1 chain state. XXX: Why is this not always UTxOType?

Methods

chainStatePoint :: ChainStateType tx -> ChainPointType tx Source #

Get the chain point for a chain state.

chainPointSlot :: ChainPointType tx -> ChainSlot Source #

Get the chain slot from a chain point.

chainStateSlot :: IsChainState tx => ChainStateType tx -> ChainSlot Source #

Get the chain slot for a chain state. NOTE: For any sequence of a encountered, we assume monotonically increasing slots.