ouroboros-consensus-diffusion-0.18.0.0: Integration for the Ouroboros Network layer
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.ThreadNet.TxGen

Description

Transaction generator for testing

Synopsis

Documentation

class TxGen blk where Source #

Associated Types

type TxGenExtra blk ∷ Type Source #

Extra information required to generate transactions

type TxGenExtra blk = ()

Methods

testGenTxsCoreNodeIdNumCoreNodesSlotNoTopLevelConfig blk → TxGenExtra blk → LedgerState blk → Gen [GenTx blk] Source #

Generate a number of transactions, valid or invalid, that can be submitted to a node's Mempool.

This function will be called to generate transactions in consensus tests.

Note: this function returns a list so that an empty list can be returned in case we are unable to generate transactions for a blk.

Implementation for HFC

newtype WrapTxGenExtra blk Source #

Newtypes wrapper around the TxGenExtra type family so that it can be partially applied.

Constructors

WrapTxGenExtra 

testGenTxsHfc ∷ ∀ xs. (All TxGen xs, CanHardFork xs) ⇒ CoreNodeIdNumCoreNodesSlotNoTopLevelConfig (HardForkBlock xs) → NP WrapTxGenExtra xs → LedgerState (HardForkBlock xs) → Gen [GenTx (HardForkBlock xs)] Source #

Function that can be used for TxGen instances for HardForkBlock.

We don't provide a generic instance of TxGen because it might be desirable to provide custom implementations for specific instantiations of the eras of HardForkBlock. Instead, we provide this function that can be used when a generic implemenation is desired.

Choose NP WrapTxGenExtra xs for the instance of the TxGenExtra type family, where xs matches the concrete instantiation.