| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.ThreadNet.TxGen
Contents
Description
Transaction generator for testing
Synopsis
- class TxGen blk where
- type TxGenExtra blk
- testGenTxs ∷ CoreNodeId → NumCoreNodes → SlotNo → TopLevelConfig blk → TxGenExtra blk → LedgerState blk ValuesMK → Gen [GenTx blk]
- newtype WrapTxGenExtra blk = WrapTxGenExtra {
- unwrapTxGenExtra ∷ TxGenExtra blk
- testGenTxsHfc ∷ ∀ (xs ∷ [Type]). (All TxGen xs, CanHardFork xs) ⇒ CoreNodeId → NumCoreNodes → SlotNo → TopLevelConfig (HardForkBlock xs) → NP WrapTxGenExtra xs → LedgerState (HardForkBlock xs) ValuesMK → Gen [GenTx (HardForkBlock xs)]
Documentation
class TxGen blk where Source #
Associated Types
type TxGenExtra blk Source #
Extra information required to generate transactions
type TxGenExtra blk = ()
Methods
testGenTxs ∷ CoreNodeId → NumCoreNodes → SlotNo → TopLevelConfig blk → TxGenExtra blk → LedgerState blk ValuesMK → 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 | |
Fields
| |
testGenTxsHfc ∷ ∀ (xs ∷ [Type]). (All TxGen xs, CanHardFork xs) ⇒ CoreNodeId → NumCoreNodes → SlotNo → TopLevelConfig (HardForkBlock xs) → NP WrapTxGenExtra xs → LedgerState (HardForkBlock xs) ValuesMK → 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.