| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.Chain.ChainState
Synopsis
- newtype ChainSlot = ChainSlot Natural
- class (IsTx tx, Eq (ChainStateType tx), Show (ChainStateType tx), FromJSON (ChainStateType tx), ToJSON (ChainStateType tx), Arbitrary (ChainStateType tx)) => IsChainState tx where
- type ChainStateType tx = c | c -> tx
- chainStateSlot :: ChainStateType tx -> ChainSlot
Documentation
A generic description for a chain slot all implementations need to use.
Instances
| Arbitrary ChainSlot Source # | |
| FromJSON ChainSlot Source # | |
Defined in Hydra.Chain.ChainState | |
| ToJSON ChainSlot Source # | |
Defined in Hydra.Chain.ChainState Methods toEncoding :: ChainSlot -> Encoding toJSONList :: [ChainSlot] -> Value toEncodingList :: [ChainSlot] -> Encoding | |
| Generic ChainSlot Source # | |
| Num ChainSlot Source # | |
Defined in Hydra.Chain.ChainState Methods (+) :: ChainSlot -> ChainSlot -> ChainSlot Source # (-) :: ChainSlot -> ChainSlot -> ChainSlot Source # (*) :: ChainSlot -> ChainSlot -> ChainSlot Source # negate :: ChainSlot -> ChainSlot Source # abs :: ChainSlot -> ChainSlot Source # signum :: ChainSlot -> ChainSlot Source # fromInteger :: Integer -> ChainSlot Source # | |
| Show ChainSlot Source # | |
| Eq ChainSlot Source # | |
| Ord ChainSlot Source # | |
Defined in Hydra.Chain.ChainState | |
| type Rep ChainSlot Source # | |
Defined in Hydra.Chain.ChainState | |
class (IsTx tx, Eq (ChainStateType tx), Show (ChainStateType tx), FromJSON (ChainStateType tx), ToJSON (ChainStateType tx), Arbitrary (ChainStateType tx)) => IsChainState tx where Source #
Types that can be used on-chain by the Hydra protocol. XXX: Find a better name for this. Maybe IsChainTx or IsL1Tx?
Associated Types
type ChainStateType tx = c | c -> tx Source #
Type of what to keep as L1 chain state. XXX: Why is this not always UTxOType?
Methods
chainStateSlot :: ChainStateType tx -> ChainSlot Source #
Get the chain slot for a chain state. NOTE: For any sequence of a
encountered, we assume monotonically increasing slots.