/
Constraints.hs
53 lines (51 loc) · 1.83 KB
/
Constraints.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
-- | Constraints for transactions
module Ledger.Constraints(
-- $constraints
TxConstraints(..)
, TxConstraint(..)
-- * Defining constraints
, mustPayToTheScript
, mustPayToPubKey
, mustForgeCurrency
, mustForgeValue
, mustSpendAtLeast
, mustSpendPubKeyOutput
, mustSpendScriptOutput
, mustValidateIn
, mustBeSignedBy
, mustIncludeDatum
, mustPayToOtherScript
, mustHashDatum
-- * Queries
, modifiesUtxoSet
, isSatisfiable
-- * Checking
, checkScriptContext
-- * Generating transactions
, ScriptLookups(..)
, MkTxError(..)
, UnbalancedTx
, typedValidatorLookups
, unspentOutputs
, monetaryPolicy
, otherScript
, otherData
, ownPubKeyHash
, mkTx
-- ** Combining multiple typed scripts into one transaction
, SomeLookupsAndConstraints(..)
, mkSomeTx
) where
import Ledger.Constraints.OffChain (MkTxError (..), ScriptLookups (..), SomeLookupsAndConstraints (..),
UnbalancedTx, mkSomeTx, mkTx, monetaryPolicy, otherData, otherScript,
ownPubKeyHash, typedValidatorLookups, unspentOutputs)
import Ledger.Constraints.OnChain (checkScriptContext)
import Ledger.Constraints.TxConstraints
-- $constraints
-- This module defines 'Ledger.Constraints.TxConstraints.TxConstraints', a list
-- of constraints on transactions. To construct a value of 'TxConstraints' use
-- the 'mustPayToTheScript', 'mustSpendAtLeast', etc functions. Once we have a
-- 'TxConstraints' value it can be used both to generate a transaction that
-- satisfies the constraints (off-chain, using 'mkTx') and to check whether
-- a given pending transaction meets the constraints (on-chain, using
-- 'checkScriptContext').