hydra-node-0.16.0: The Hydra node
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Snapshot

Synopsis

Documentation

newtype SnapshotNumber Source #

Instances

Instances details
Arbitrary SnapshotNumber Source # 
Instance details

Defined in Hydra.Snapshot

FromJSON SnapshotNumber Source # 
Instance details

Defined in Hydra.Snapshot

Methods

parseJSON :: Value -> Parser SnapshotNumber

parseJSONList :: Value -> Parser [SnapshotNumber]

omittedField :: Maybe SnapshotNumber

ToJSON SnapshotNumber Source # 
Instance details

Defined in Hydra.Snapshot

Enum SnapshotNumber Source # 
Instance details

Defined in Hydra.Snapshot

Generic SnapshotNumber Source # 
Instance details

Defined in Hydra.Snapshot

Associated Types

type Rep SnapshotNumber :: Type -> Type Source #

Num SnapshotNumber Source # 
Instance details

Defined in Hydra.Snapshot

Integral SnapshotNumber Source # 
Instance details

Defined in Hydra.Snapshot

Real SnapshotNumber Source # 
Instance details

Defined in Hydra.Snapshot

Show SnapshotNumber Source # 
Instance details

Defined in Hydra.Snapshot

FromCBOR SnapshotNumber Source # 
Instance details

Defined in Hydra.Snapshot

ToCBOR SnapshotNumber Source # 
Instance details

Defined in Hydra.Snapshot

Methods

toCBOR :: SnapshotNumber -> Encoding

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

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

Eq SnapshotNumber Source # 
Instance details

Defined in Hydra.Snapshot

Ord SnapshotNumber Source # 
Instance details

Defined in Hydra.Snapshot

type Rep SnapshotNumber Source # 
Instance details

Defined in Hydra.Snapshot

type Rep SnapshotNumber = D1 ('MetaData "SnapshotNumber" "Hydra.Snapshot" "hydra-node-0.16.0-C0XGScKIquG5I6dPp21445" 'True) (C1 ('MetaCons "UnsafeSnapshotNumber" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)))

data Snapshot tx Source #

Constructors

Snapshot 

Fields

Instances

Instances details
IsTx tx => Arbitrary (Snapshot tx) Source # 
Instance details

Defined in Hydra.Snapshot

Methods

arbitrary :: Gen (Snapshot tx)

shrink :: Snapshot tx -> [Snapshot tx]

IsTx tx => FromJSON (Snapshot tx) Source # 
Instance details

Defined in Hydra.Snapshot

Methods

parseJSON :: Value -> Parser (Snapshot tx)

parseJSONList :: Value -> Parser [Snapshot tx]

omittedField :: Maybe (Snapshot tx)

IsTx tx => ToJSON (Snapshot tx) Source # 
Instance details

Defined in Hydra.Snapshot

Methods

toJSON :: Snapshot tx -> Value

toEncoding :: Snapshot tx -> Encoding

toJSONList :: [Snapshot tx] -> Value

toEncodingList :: [Snapshot tx] -> Encoding

omitField :: Snapshot tx -> Bool

Generic (Snapshot tx) Source # 
Instance details

Defined in Hydra.Snapshot

Associated Types

type Rep (Snapshot tx) :: Type -> Type Source #

Methods

from :: Snapshot tx -> Rep (Snapshot tx) x Source #

to :: Rep (Snapshot tx) x -> Snapshot tx Source #

IsTx tx => Show (Snapshot tx) Source # 
Instance details

Defined in Hydra.Snapshot

(Typeable tx, FromCBOR (UTxOType tx), FromCBOR (TxIdType tx)) => FromCBOR (Snapshot tx) Source # 
Instance details

Defined in Hydra.Snapshot

Methods

fromCBOR :: Decoder s (Snapshot tx)

label :: Proxy (Snapshot tx) -> Text

(Typeable tx, ToCBOR (UTxOType tx), ToCBOR (TxIdType tx)) => ToCBOR (Snapshot tx) Source # 
Instance details

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 verifyPartySignature

Instance details

Defined in Hydra.Snapshot

IsTx tx => Eq (Snapshot tx) Source # 
Instance details

Defined in Hydra.Snapshot

Methods

(==) :: Snapshot tx -> Snapshot tx -> Bool Source #

(/=) :: Snapshot tx -> Snapshot tx -> Bool Source #

type Rep (Snapshot tx) Source # 
Instance details

Defined in Hydra.Snapshot

type Rep (Snapshot tx) = D1 ('MetaData "Snapshot" "Hydra.Snapshot" "hydra-node-0.16.0-C0XGScKIquG5I6dPp21445" 'False) (C1 ('MetaCons "Snapshot" 'PrefixI 'True) ((S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HeadId) :*: 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.

Instances

Instances details
IsTx tx => Arbitrary (ConfirmedSnapshot tx) Source # 
Instance details

Defined in Hydra.Snapshot

IsTx tx => FromJSON (ConfirmedSnapshot tx) Source # 
Instance details

Defined in Hydra.Snapshot

Methods

parseJSON :: Value -> Parser (ConfirmedSnapshot tx)

parseJSONList :: Value -> Parser [ConfirmedSnapshot tx]

omittedField :: Maybe (ConfirmedSnapshot tx)

IsTx tx => ToJSON (ConfirmedSnapshot tx) Source # 
Instance details

Defined in Hydra.Snapshot

Methods

toJSON :: ConfirmedSnapshot tx -> Value

toEncoding :: ConfirmedSnapshot tx -> Encoding

toJSONList :: [ConfirmedSnapshot tx] -> Value

toEncodingList :: [ConfirmedSnapshot tx] -> Encoding

omitField :: ConfirmedSnapshot tx -> Bool

Generic (ConfirmedSnapshot tx) Source # 
Instance details

Defined in Hydra.Snapshot

Associated Types

type Rep (ConfirmedSnapshot tx) :: Type -> Type Source #

IsTx tx => Show (ConfirmedSnapshot tx) Source # 
Instance details

Defined in Hydra.Snapshot

IsTx tx => Eq (ConfirmedSnapshot tx) Source # 
Instance details

Defined in Hydra.Snapshot

type Rep (ConfirmedSnapshot tx) Source # 
Instance details

Defined in Hydra.Snapshot

type Rep (ConfirmedSnapshot tx) = D1 ('MetaData "ConfirmedSnapshot" "Hydra.Snapshot" "hydra-node-0.16.0-C0XGScKIquG5I6dPp21445" 'False) (C1 ('MetaCons "InitialSnapshot" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "initialUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (UTxOType tx))) :+: C1 ('MetaCons "ConfirmedSnapshot" 'PrefixI 'True) (S1 ('MetaSel ('Just "snapshot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Snapshot tx)) :*: S1 ('MetaSel ('Just "signatures") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (MultiSignature (Snapshot tx)))))

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.

genConfirmedSnapshot Source #

Arguments

:: IsTx tx 
=> HeadId 
-> SnapshotNumber

The lower bound on snapshot number to generate. If this is 0, then we can generate an InitialSnapshot or a ConfirmedSnapshot. Otherwise we generate only ConfirmedSnapshot with a number strictly superior to this lower bound.

-> UTxOType tx 
-> [SigningKey HydraKey] 
-> Gen (ConfirmedSnapshot tx)