hydra-cluster-0.19.0: Integration test suite using a local cluster of cardano and hydra nodes
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Generator

Contents

Synopsis

Documentation

networkId :: NetworkId Source #

data Dataset Source #

A Dataset that can be run for testing purpose. Each Dataset represents a complete scenario where several ClientDataset are run concurrently against one or more HydraNodes. A dataset can optionally have a title and description which will be used to report results.

Instances

Instances details
Arbitrary Dataset Source # 
Instance details

Defined in Hydra.Generator

Methods

arbitrary :: Gen Dataset

shrink :: Dataset -> [Dataset]

FromJSON Dataset Source # 
Instance details

Defined in Hydra.Generator

Methods

parseJSON :: Value -> Parser Dataset

parseJSONList :: Value -> Parser [Dataset]

omittedField :: Maybe Dataset

ToJSON Dataset Source # 
Instance details

Defined in Hydra.Generator

Methods

toJSON :: Dataset -> Value

toEncoding :: Dataset -> Encoding

toJSONList :: [Dataset] -> Value

toEncodingList :: [Dataset] -> Encoding

omitField :: Dataset -> Bool

Generic Dataset Source # 
Instance details

Defined in Hydra.Generator

Associated Types

type Rep Dataset :: Type -> Type Source #

Show Dataset Source # 
Instance details

Defined in Hydra.Generator

type Rep Dataset Source # 
Instance details

Defined in Hydra.Generator

type Rep Dataset = D1 ('MetaData "Dataset" "Hydra.Generator" "hydra-cluster-0.19.0-FdS6WpgbrGm8HrOQAHMkj7" 'False) (C1 ('MetaCons "Dataset" 'PrefixI 'True) ((S1 ('MetaSel ('Just "fundingTransaction") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Tx) :*: S1 ('MetaSel ('Just "clientDatasets") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ClientDataset])) :*: (S1 ('MetaSel ('Just "title") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))))

data ClientKeys Source #

Constructors

ClientKeys 

Fields

  • signingKey :: SigningKey PaymentKey

    Key used by the hydra-node to authorize hydra transactions and holding fuel.

  • externalSigningKey :: SigningKey PaymentKey

    Key holding funds to commit.

Instances

Instances details
Arbitrary ClientKeys Source # 
Instance details

Defined in Hydra.Generator

FromJSON ClientKeys Source # 
Instance details

Defined in Hydra.Generator

Methods

parseJSON :: Value -> Parser ClientKeys

parseJSONList :: Value -> Parser [ClientKeys]

omittedField :: Maybe ClientKeys

ToJSON ClientKeys Source # 
Instance details

Defined in Hydra.Generator

Methods

toJSON :: ClientKeys -> Value

toEncoding :: ClientKeys -> Encoding

toJSONList :: [ClientKeys] -> Value

toEncodingList :: [ClientKeys] -> Encoding

omitField :: ClientKeys -> Bool

Show ClientKeys Source # 
Instance details

Defined in Hydra.Generator

data ClientDataset Source #

Constructors

ClientDataset 

Fields

Instances

Instances details
FromJSON ClientDataset Source # 
Instance details

Defined in Hydra.Generator

Methods

parseJSON :: Value -> Parser ClientDataset

parseJSONList :: Value -> Parser [ClientDataset]

omittedField :: Maybe ClientDataset

ToJSON ClientDataset Source # 
Instance details

Defined in Hydra.Generator

Generic ClientDataset Source # 
Instance details

Defined in Hydra.Generator

Associated Types

type Rep ClientDataset :: Type -> Type Source #

Show ClientDataset Source # 
Instance details

Defined in Hydra.Generator

type Rep ClientDataset Source # 
Instance details

Defined in Hydra.Generator

type Rep ClientDataset = D1 ('MetaData "ClientDataset" "Hydra.Generator" "hydra-cluster-0.19.0-FdS6WpgbrGm8HrOQAHMkj7" 'False) (C1 ('MetaCons "ClientDataset" 'PrefixI 'True) (S1 ('MetaSel ('Just "clientKeys") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClientKeys) :*: (S1 ('MetaSel ('Just "initialUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTxO) :*: S1 ('MetaSel ('Just "txSequence") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Tx]))))

defaultProtocolParameters :: PParams LedgerEra Source #

generateConstantUTxODataset Source #

Arguments

:: SigningKey PaymentKey

Faucet signing key

-> Int

Number of clients

-> Int

Number of transactions

-> Gen Dataset 

Generate Dataset which does not grow the per-client UTXO set over time. The sequence of transactions generated consist only of simple payments from and to arbitrary keys controlled by the individual clients.

generateDemoUTxODataset Source #

Arguments

:: NetworkId 
-> SocketPath 
-> [ClientKeys]

Number of clients

-> Int

Number of transactions

-> IO Dataset 

Generate Dataset which does not grow the per-client UTXO set over time. This queries the network to fetch the current funds available in the faucet to be distributed among the peers. The sequence of transactions generated consist only of simple self payments.

Helpers

thrd :: (a, b, c) -> c Source #

withInitialUTxO :: SigningKey PaymentKey -> Tx -> UTxO Source #

genClientFunds :: [ClientKeys] -> Integer -> Gen [(VerificationKey PaymentKey, Coin)] Source #

generateClientDataset :: NetworkId -> Tx -> ClientKeys -> Int -> (NetworkId -> (UTxO, SigningKey PaymentKey, [Tx]) -> Int -> Gen (UTxO, SigningKey PaymentKey, [Tx])) -> Gen ClientDataset Source #