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

PlutusLedgerApi.Test.V1.Data.Value

Synopsis

Documentation

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]
[(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)]

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.

Constructors

FaceValue 

Fields

Instances

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.

Constructors

NoArbitrary 

Fields

Instances

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

Methods

arbitraryGen Value #

shrinkValue → [Value] #