Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- listsToValue ∷ [(CurrencySymbol, [(TokenName, Integer)])] → Value
- valueToLists ∷ Value → [(CurrencySymbol, [(TokenName, Integer)])]
- toCellCandidatesNumber ∷ Int → Int
- genShortHex ∷ Int → Gen BuiltinByteString
- uniqueNames ∷ Eq name ⇒ (BuiltinByteString → name) → [b] → Gen [(name, b)]
- newtype FaceValue = FaceValue {}
- newtype NoArbitrary a = NoArbitrary {
- unNoArbitrary ∷ a
Documentation
listsToValue ∷ [(CurrencySymbol, [(TokenName, Integer)])] → Value Source #
valueToLists ∷ Value → [(CurrencySymbol, [(TokenName, Integer)])] Source #
Convert a Value
to its list representation.
toCellCandidatesNumber ∷ Int → Int Source #
Return how many candidates to randomly choose from to fill the given number of cells. For example, if we only need to fill a single cell, we choose from 6 different candidates, and if we need to fill 5 cells, we choose from 11 candidates.
>>>
map (\i -> (i, toCellCandidatesNumber i)) [1..13]
[(1,6),(2,6),(3,6),(4,8),(5,11),(6,14),(7,18),(8,22),(9,27),(10,31),(11,36),(12,41),(13,46)]
genShortHex ∷ Int → Gen BuiltinByteString Source #
Generate a BuiltinByteString
by picking one of the predetermined ones, given a number of
cells to fill (see toCellCandidatesNumber
). The idea is that we want to occasionally generate
the same CurrencySymbol
or TokenName
for different Value
s to have decent test coverage,
hence to make name clashing more likely we pick from a predetermined set of
BuiltinByteString
s. Otherwise the chance of generating the same BuiltinByteString
for two
different Value
s would be virtually zero.
uniqueNames ∷ Eq name ⇒ (BuiltinByteString → name) → [b] → Gen [(name, b)] Source #
Annotate each element of the give list with a name
, given a function turning
BuiltinByteString
into names.
newtype NoArbitrary a Source #
A wrapper for satisfying an Arbitrary a
constraint without implementing an Arbitrary
instance for a
.
Instances
Arbitrary (NoArbitrary a) Source # | |
Defined in PlutusLedgerApi.Test.V1.Value arbitrary ∷ Gen (NoArbitrary a) # shrink ∷ NoArbitrary a → [NoArbitrary a] # |