Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Hydra.Snapshot
Synopsis
- newtype SnapshotNumber = UnsafeSnapshotNumber Natural
- data Snapshot tx = Snapshot {}
- data ConfirmedSnapshot tx
- = InitialSnapshot {
- initialUTxO :: UTxOType tx
- | ConfirmedSnapshot {
- snapshot :: Snapshot tx
- signatures :: MultiSignature (Snapshot tx)
- = InitialSnapshot {
- getSnapshot :: ConfirmedSnapshot tx -> Snapshot tx
- isInitialSnapshot :: ConfirmedSnapshot tx -> Bool
- genConfirmedSnapshot :: IsTx tx => SnapshotNumber -> UTxOType tx -> [SigningKey HydraKey] -> Gen (ConfirmedSnapshot tx)
- fromChainSnapshot :: SnapshotNumber -> SnapshotNumber
Documentation
newtype SnapshotNumber Source #
Constructors
UnsafeSnapshotNumber Natural |
Instances
Constructors
Snapshot | |
Instances
(Arbitrary (TxIdType tx), Arbitrary (UTxOType tx)) => Arbitrary (Snapshot tx) Source # | |
IsTx tx => FromJSON (Snapshot tx) Source # | |
Defined in Hydra.Snapshot | |
IsTx tx => ToJSON (Snapshot tx) Source # | |
Defined in Hydra.Snapshot Methods toJSON :: Snapshot tx -> Value toEncoding :: Snapshot tx -> Encoding toJSONList :: [Snapshot tx] -> Value toEncodingList :: [Snapshot tx] -> Encoding | |
Generic (Snapshot tx) Source # | |
IsTx tx => Show (Snapshot tx) Source # | |
(Typeable tx, FromCBOR (UTxOType tx), FromCBOR (TxIdType tx)) => FromCBOR (Snapshot tx) Source # | |
(Typeable tx, ToCBOR (UTxOType tx), ToCBOR (TxIdType tx)) => ToCBOR (Snapshot tx) Source # | |
Defined in Hydra.Snapshot Methods toCBOR :: Snapshot tx -> Encoding encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (Snapshot tx) -> Size encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [Snapshot tx] -> Size | |
IsTx tx => SignableRepresentation (Snapshot tx) Source # | Binary representation of snapshot signatures
TODO: document CDDL format, either here or on in |
Defined in Hydra.Snapshot Methods getSignableRepresentation :: Snapshot tx -> ByteString | |
IsTx tx => Eq (Snapshot tx) Source # | |
type Rep (Snapshot tx) Source # | |
Defined in Hydra.Snapshot type Rep (Snapshot tx) = D1 ('MetaData "Snapshot" "Hydra.Snapshot" "hydra-node-0.13.0-HKlbaPrFKjs2dhEMwn7ono" 'False) (C1 ('MetaCons "Snapshot" 'PrefixI 'True) (S1 ('MetaSel ('Just "number") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SnapshotNumber) :*: (S1 ('MetaSel ('Just "utxo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (UTxOType tx)) :*: S1 ('MetaSel ('Just "confirmed") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TxIdType tx])))) |
data ConfirmedSnapshot tx Source #
A snapshot that can be used to close a head with. Either the initial one, or when it was signed by all parties, i.e. it is confirmed.
Constructors
InitialSnapshot | |
Fields
| |
ConfirmedSnapshot | |
Fields
|
Instances
getSnapshot :: ConfirmedSnapshot tx -> Snapshot tx Source #
Safely get a Snapshot
from a confirmed snapshot.
isInitialSnapshot :: ConfirmedSnapshot tx -> Bool Source #
Tell whether a snapshot is the initial snapshot coming from the collect-com transaction.
Arguments
:: IsTx tx | |
=> SnapshotNumber | The lower bound on snapshot number to generate.
If this is 0, then we can generate an |
-> UTxOType tx | |
-> [SigningKey HydraKey] | |
-> Gen (ConfirmedSnapshot tx) |
fromChainSnapshot :: SnapshotNumber -> SnapshotNumber Source #