hydra-node
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Node.Environment

Synopsis

Documentation

data Environment Source #

Constructors

Environment 

Fields

Instances

Instances details
FromJSON Environment Source #

FromJSON is provided only so that types embedding Environment (e.g. Greetings) can still be parsed for golden / roundtrip tests. The decoded signing key is a fixed placeholder, NOT the real key: real signing keys must always be loaded from disk via the text-envelope path. Tests that compare values for equality should use the same placeholder via the Arbitrary instance.

Instance details

Defined in Hydra.Node.Environment

Methods

parseJSON :: Value -> Parser Environment

parseJSONList :: Value -> Parser [Environment]

omittedField :: Maybe Environment

ToJSON Environment Source #

ToJSON deliberately omits $sel:signingKey:Environment from the serialised output: the WebSocket API sends Environment to clients as part of Greetings, and the signing key must never appear on the wire.

Instance details

Defined in Hydra.Node.Environment

Methods

toJSON :: Environment -> Value

toEncoding :: Environment -> Encoding

toJSONList :: [Environment] -> Value

toEncodingList :: [Environment] -> Encoding

omitField :: Environment -> Bool

Generic Environment Source # 
Instance details

Defined in Hydra.Node.Environment

Associated Types

type Rep Environment :: Type -> Type Source #

Show Environment Source # 
Instance details

Defined in Hydra.Node.Environment

FromCBOR Environment Source #

Like the JSON instance above, the decoded signing key is placeholderSigningKey, NOT the real key.

Instance details

Defined in Hydra.Node.Environment

Methods

fromCBOR :: Decoder s Environment

label :: Proxy Environment -> Text

ToCBOR Environment Source #

Like the JSON instance above, ToCBOR deliberately omits $sel:signingKey:Environment (CBOR-encoding a Secret is a compile-time error by design). This is why the codec stays hand-written; the leading tag matches the generic format.

Instance details

Defined in Hydra.Node.Environment

Methods

toCBOR :: Environment -> Encoding

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

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

Eq Environment Source # 
Instance details

Defined in Hydra.Node.Environment

type Rep Environment Source # 
Instance details

Defined in Hydra.Node.Environment

type Rep Environment = D1 ('MetaData "Environment" "Hydra.Node.Environment" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (C1 ('MetaCons "Environment" 'PrefixI 'True) (((S1 ('MetaSel ('Just "party") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Party) :*: S1 ('MetaSel ('Just "signingKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Secret (SigningKey HydraKey)))) :*: (S1 ('MetaSel ('Just "otherParties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Party]) :*: S1 ('MetaSel ('Just "participants") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [OnChainId]))) :*: ((S1 ('MetaSel ('Just "contestationPeriod") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ContestationPeriod) :*: S1 ('MetaSel ('Just "depositPeriod") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 DepositPeriod)) :*: (S1 ('MetaSel ('Just "depositActivation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 DepositPeriod) :*: (S1 ('MetaSel ('Just "unsyncedPeriod") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UnsyncedPeriod) :*: S1 ('MetaSel ('Just "configuredPeers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))))

placeholderSigningKey :: Secret (SigningKey HydraKey) Source #

Sentinel signing key used when an Environment has to be reconstructed without access to the real one (e.g. JSON roundtrip tests). Exported so Arbitrary generators can use the same value, keeping roundtrip Eq stable.

mkHeadParameters :: Environment -> HeadParameters Source #

Make HeadParameters that are consistent with the given Environment.