hydra-cluster-0.20.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.

Constructors

Dataset 

Fields

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.20.0-8reP7QGo6wY8RVPOtXpPTl" 'False) (C1 ('MetaCons "Dataset" 'PrefixI 'True) ((S1 ('MetaSel ('Just "fundingTransaction") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Tx) :*: S1 ('MetaSel ('Just "hydraNodeKeys") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SigningKey PaymentKey])) :*: (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 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.20.0-8reP7QGo6wY8RVPOtXpPTl" 'False) (C1 ('MetaCons "ClientDataset" 'PrefixI 'True) (S1 ('MetaSel ('Just "paymentKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SigningKey PaymentKey)) :*: (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 a Dataset which does not grow the per-client UTXO set over time. This version provided faucet key owns funds on the initial funds of the devnet (See availableInitialFunds and 'genesis-shelley.json'). Then for a given number of clients a number of transactions are generated.

generateDemoUTxODataset Source #

Arguments

:: NetworkId 
-> SocketPath 
-> SigningKey PaymentKey

Faucet signing key

-> Int

Number of clients.

-> Int

Number of transactions

-> IO Dataset 

Generate a Dataset from an already running network by quering available funds of the well-known 'faucet.sk' and assuming the hydra-nodes we connect to have fuel available. Then for a given number of clients a number of transactions are generated.

Helpers

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

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

generateClientDataset :: NetworkId -> Tx -> Int -> SigningKey PaymentKey -> Gen ClientDataset Source #