plutus-ledger-api- Interface to the Plutus ledger for the Cardano ledger.
Safe HaskellSafe-Inferred




listsToValue ∷ [(CurrencySymbol, [(TokenName, Integer)])] → Value Source #

Convert a list representation of a Value to the Value.

valueToListsValue → [(CurrencySymbol, [(TokenName, Integer)])] Source #

Convert a Value to its list representation.

toCellCandidatesNumberIntInt 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]

genShortHexIntGen 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 Values to have decent test coverage, hence to make name clashing more likely we pick from a predetermined set of BuiltinByteStrings. Otherwise the chance of generating the same BuiltinByteString for two different Values would be virtually zero.

uniqueNamesEq 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 FaceValue Source #

The value of a TokenName in a Value.





Instances details
Arbitrary FaceValue Source # 
Instance details

Defined in PlutusLedgerApi.Test.V1.Data.Value

newtype NoArbitrary a Source #

A wrapper for satisfying an Arbitrary a constraint without implementing an Arbitrary instance for a.





Instances details
Arbitrary (NoArbitrary a) Source #

arbitrary throws, shrink neither throws nor shrinks.

Instance details

Defined in PlutusLedgerApi.Test.V1.Data.Value

Orphan instances

Arbitrary Value Source # 
Instance details


arbitraryGen Value #

shrinkValue → [Value] #