cardano-wallet-core-2022.7.1: The Wallet Backend for a Cardano node.
Safe Haskell None
Language Haskell2010

Cardano.Wallet.Primitive.Types.TokenQuantity.Gen

Synopsis

Documentation

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.

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