| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.Chain.ChainState
Synopsis
- newtype ChainSlot = ChainSlot 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
- type ChainPointType tx = p | p -> tx
- type ChainStateType tx = c | c -> tx
- chainStatePoint :: ChainStateType tx -> ChainPointType tx
- chainPointSlot :: ChainPointType tx -> ChainSlot
- chainStateSlot :: IsChainState tx => ChainStateType tx -> ChainSlot
Documentation
A generic description for a chain slot all implementations need to use.
Instances
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.