Modulebyron-spec-ledger-1.1.0.1Haskell2010
Byron.Spec.Ledger.UTxO.Generators
- 20 values
- Packagebyron-spec-ledger-1.1.0.1
- Exports20
- LanguageHaskell2010
- LicenceApache-2.0
- SourceGenerators.hs
Generate a subsequence of a list of values and traverse the subsequence with a generator producer
Generate a list using genTraverseSubsequence
Temporarily defined here until hedgehog exposes this function
genTxFromUTxO Generate a valid transaction from a given UTxO
A property to test that the entire shrink tree generated by genInputOutput maintains the invariant that the inputs and outputs have equal sums
NB: This uses small values for the list and values, because we force the entire shrink tree, which can grow very large
genInputOutput :: [input]List of input to take a subsequence of
-> (input -> Integer)A view of the value in the input used to preserve the invariant
-> Gen (Integer -> output)A applicative generator for an output given a value
-> (output -> Integer)A view of the value in the output used to preserve the invariant
-> ((Integer -> Integer) -> output -> output)An update function for the output value used to preserve the invariant
-> Gen ([input], [output])
Generate a subsequence of the inputs and split the value into a number of outputs
The shrink tree maintains the invariant that the sum of the inputs is equal to the sum of the outputs. This is generalised to any type of input where we can view the contained value, and type of output where we can generate the type from a value, and view and modify the contained value
Used as part of genInputOutput, so see there for details of the arguments
Used as part of genInputOutput, so see there for details of the arguments
Used as part of genInputOutput, so see there for details of the arguments
Shrink the left value of a tuple, preserving the total value stored in the right value
Used as part of genInputOutput, so see there for details of the arguments
subFromList Remove total value from a list, removing from the front
A property to check that genSplitValue does indeed preserve the input
genSplitValue :: IntegerTotal value to divide into outputs
-> Gen (Integer -> a)Applicative generator for an output given a value
-> (a -> Integer)A view of the value in the output used to preserve the invariant
-> ((Integer -> Integer) -> a -> a)A modifier for the value in the output used to preserve the invariant
-> Gen [a]
Given an input value and functions to generate, view, and update some type
a based on that value, split the input into a number of as, preserving
the value throughout the shrink tree
Used as part of genSplitValue, so see there for details of the arguments
Used as part of genSplitValue, so see there for details of the arguments
Drop one of the outputs, preserving the invariant by moving its value to the left
Used as part of genSplitValue, so see there for details of the arguments
Shrink a value in a list, preserving the total value by moving the lost value to the left
Used as part of genSplitValue, so see there for details of the arguments
All the ways of choosing two consecutive values from a list