Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- chooseTokenQuantity :: ( TokenQuantity , TokenQuantity ) -> Gen TokenQuantity
- genTokenQuantity :: Gen TokenQuantity
- genTokenQuantityPositive :: Gen TokenQuantity
- genTokenQuantityFullRange :: Gen TokenQuantity
- shrinkTokenQuantity :: TokenQuantity -> [ TokenQuantity ]
- shrinkTokenQuantityPositive :: TokenQuantity -> [ TokenQuantity ]
- shrinkTokenQuantityFullRange :: TokenQuantity -> [ TokenQuantity ]
- genTokenQuantityPartition :: TokenQuantity -> Int -> Gen ( NonEmpty TokenQuantity )
Documentation
chooseTokenQuantity :: ( TokenQuantity , TokenQuantity ) -> Gen TokenQuantity Source #
genTokenQuantityFullRange :: Gen TokenQuantity Source #
Generates token quantities across the full range of what may be encoded within a single on-chain token bundle.
This generator has a slight bias towards the limits of the range, but otherwise generates values uniformly across the whole range.
This can be useful when testing roundtrip conversions between different types.
shrinkTokenQuantity :: TokenQuantity -> [ TokenQuantity ] Source #
genTokenQuantityPartition :: TokenQuantity -> Int -> Gen ( NonEmpty TokenQuantity ) Source #
Partitions a token quantity randomly into a given number of parts.
Satisfies the following properties:
forAll (genTokenQuantityPartition q i) $ (== q) . fold
forAll (genTokenQuantityPartition q i) $ (== max 1 i) . length