From 20e889265948344e945c730661f25b02a9ca6257 Mon Sep 17 00:00:00 2001 From: mmontin Date: Fri, 16 Feb 2024 14:46:25 +0000 Subject: [PATCH] deploy: 062beabc714c3541850011fa9bab7191e7e9aadd --- Cooked-Ltl.html | 4 +- Cooked-MockChain-BlockChain.html | 8 +- Cooked-MockChain-Direct.html | 2 +- Cooked-MockChain-Staged.html | 9 +- Cooked-MockChain.html | 15 +- Cooked-Tweak-Common.html | 2 +- cooked-validators.haddock | Bin 89133 -> 89321 bytes doc-index-All.html | 2 +- doc-index-T.html | 2 +- doc-index.json | 2 +- src/Cooked.Attack.AddToken.html | 70 +- src/Cooked.Attack.DatumHijacking.html | 108 +- src/Cooked.Attack.DoubleSat.html | 158 +-- src/Cooked.Attack.DupToken.html | 116 +- src/Cooked.Ltl.html | 606 +++++----- src/Cooked.MockChain.Balancing.html | 1302 ++++++++++----------- src/Cooked.MockChain.BlockChain.html | 614 +++++----- src/Cooked.MockChain.Direct.html | 804 ++++++------- src/Cooked.MockChain.GenerateTx.html | 562 ++++----- src/Cooked.MockChain.Staged.html | 769 ++++++------ src/Cooked.MockChain.Testing.html | 538 ++++----- src/Cooked.MockChain.UtxoSearch.html | 118 +- src/Cooked.MockChain.UtxoState.html | 100 +- src/Cooked.Output.html | 534 ++++----- src/Cooked.Pretty.Class.html | 412 +++---- src/Cooked.Pretty.Common.html | 74 +- src/Cooked.Pretty.Cooked.html | 1178 +++++++++---------- src/Cooked.Pretty.Options.html | 10 +- src/Cooked.RawUPLC.html | 32 +- src/Cooked.ShowBS.html | 1028 ++++++++-------- src/Cooked.Skeleton.html | 1082 ++++++++--------- src/Cooked.Tweak.AddInputsAndOutputs.html | 156 +-- src/Cooked.Tweak.Common.html | 332 +++--- src/Cooked.Tweak.Labels.html | 6 +- src/Cooked.Tweak.OutPermutations.html | 250 ++-- src/Cooked.Tweak.Signers.html | 52 +- src/Cooked.Tweak.TamperDatum.html | 190 +-- src/Cooked.Tweak.ValidityRange.html | 140 +-- src/Cooked.ValueUtils.html | 66 +- src/Cooked.Wallet.html | 86 +- src/Paths_cooked_validators.html | 54 +- 41 files changed, 5837 insertions(+), 5756 deletions(-) diff --git a/Cooked-Ltl.html b/Cooked-Ltl.html index c37f2398a..d9664bef7 100644 --- a/Cooked-Ltl.html +++ b/Cooked-Ltl.html @@ -42,8 +42,8 @@ modify the following computations. Think of this operation as coming between time steps and adding a new formula to be applied before all of the formulas that should already be applied to the next time step.

StopLtl :: LtlOp modification builtin ()

The operation that removes the last LTL formula that was introduced. If - the formula is not yet finished, the current time line will fail.

Builtin :: builtin a -> LtlOp modification builtin a 

Instances

Instances details
MonadFail StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

fail :: String -> StagedMockChain a #

Alternative StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadModal (Staged (LtlOp modification builtin)) Source # 
Instance details

Defined in Cooked.Ltl

Associated Types

type Modification (Staged (LtlOp modification builtin)) Source #

Methods

modifyLtl :: Ltl (Modification (Staged (LtlOp modification builtin))) -> Staged (LtlOp modification builtin) a -> Staged (LtlOp modification builtin) a Source #

type Modification (Staged (LtlOp modification builtin)) Source # 
Instance details

Defined in Cooked.Ltl

type Modification (Staged (LtlOp modification builtin)) = modification

data Staged (op :: * -> *) :: * -> * where Source #

The freer monad on op. We think of this as the AST of a computation with - operations of types op a.

Constructors

Return :: a -> Staged op a 
Instr :: op a -> (a -> Staged op b) -> Staged op b 

Instances

Instances details
MonadFail StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

fail :: String -> StagedMockChain a #

Alternative StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Monad (Staged op) Source # 
Instance details

Defined in Cooked.Ltl

Methods

(>>=) :: Staged op a -> (a -> Staged op b) -> Staged op b #

(>>) :: Staged op a -> Staged op b -> Staged op b #

return :: a -> Staged op a #

Functor (Staged op) Source # 
Instance details

Defined in Cooked.Ltl

Methods

fmap :: (a -> b) -> Staged op a -> Staged op b #

(<$) :: a -> Staged op b -> Staged op a #

Applicative (Staged op) Source # 
Instance details

Defined in Cooked.Ltl

Methods

pure :: a -> Staged op a #

(<*>) :: Staged op (a -> b) -> Staged op a -> Staged op b #

liftA2 :: (a -> b -> c) -> Staged op a -> Staged op b -> Staged op c #

(*>) :: Staged op a -> Staged op b -> Staged op b #

(<*) :: Staged op a -> Staged op b -> Staged op a #

MonadModal (Staged (LtlOp modification builtin)) Source # 
Instance details

Defined in Cooked.Ltl

Associated Types

type Modification (Staged (LtlOp modification builtin)) Source #

Methods

modifyLtl :: Ltl (Modification (Staged (LtlOp modification builtin))) -> Staged (LtlOp modification builtin) a -> Staged (LtlOp modification builtin) a Source #

type Modification (Staged (LtlOp modification builtin)) Source # 
Instance details

Defined in Cooked.Ltl

type Modification (Staged (LtlOp modification builtin)) = modification

interpLtl :: InterpLtl modification builtin m => Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a Source #

Interpret a Staged computation into a suitable domain, using the function + the formula is not yet finished, the current time line will fail.

Builtin :: builtin a -> LtlOp modification builtin a 

Instances

Instances details
MonadFail StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

fail :: String -> StagedMockChain a #

Alternative StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadModal (Staged (LtlOp modification builtin)) Source # 
Instance details

Defined in Cooked.Ltl

Associated Types

type Modification (Staged (LtlOp modification builtin)) Source #

Methods

modifyLtl :: Ltl (Modification (Staged (LtlOp modification builtin))) -> Staged (LtlOp modification builtin) a -> Staged (LtlOp modification builtin) a Source #

type Modification (Staged (LtlOp modification builtin)) Source # 
Instance details

Defined in Cooked.Ltl

type Modification (Staged (LtlOp modification builtin)) = modification

data Staged (op :: * -> *) :: * -> * where Source #

The freer monad on op. We think of this as the AST of a computation with + operations of types op a.

Constructors

Return :: a -> Staged op a 
Instr :: op a -> (a -> Staged op b) -> Staged op b 

Instances

Instances details
MonadFail StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

fail :: String -> StagedMockChain a #

Alternative StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Monad (Staged op) Source # 
Instance details

Defined in Cooked.Ltl

Methods

(>>=) :: Staged op a -> (a -> Staged op b) -> Staged op b #

(>>) :: Staged op a -> Staged op b -> Staged op b #

return :: a -> Staged op a #

Functor (Staged op) Source # 
Instance details

Defined in Cooked.Ltl

Methods

fmap :: (a -> b) -> Staged op a -> Staged op b #

(<$) :: a -> Staged op b -> Staged op a #

Applicative (Staged op) Source # 
Instance details

Defined in Cooked.Ltl

Methods

pure :: a -> Staged op a #

(<*>) :: Staged op (a -> b) -> Staged op a -> Staged op b #

liftA2 :: (a -> b -> c) -> Staged op a -> Staged op b -> Staged op c #

(*>) :: Staged op a -> Staged op b -> Staged op b #

(<*) :: Staged op a -> Staged op b -> Staged op a #

MonadModal (Staged (LtlOp modification builtin)) Source # 
Instance details

Defined in Cooked.Ltl

Associated Types

type Modification (Staged (LtlOp modification builtin)) Source #

Methods

modifyLtl :: Ltl (Modification (Staged (LtlOp modification builtin))) -> Staged (LtlOp modification builtin) a -> Staged (LtlOp modification builtin) a Source #

type Modification (Staged (LtlOp modification builtin)) Source # 
Instance details

Defined in Cooked.Ltl

type Modification (Staged (LtlOp modification builtin)) = modification

interpLtl :: InterpLtl modification builtin m => Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a Source #

Interpret a Staged computation into a suitable domain, using the function interpBuiltin to interpret the builtins.

interpLtlAndPruneUnfinished :: InterpLtl modification builtin m => Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a Source #

Interpret a Staged computation into a suitable domain, using the function interpBuiltin to interpret the builtins. At the end of the computation, prune branches that still have unfinished modifications applied to diff --git a/Cooked-MockChain-BlockChain.html b/Cooked-MockChain-BlockChain.html index 82e88db56..5f125d925 100644 --- a/Cooked-MockChain-BlockChain.html +++ b/Cooked-MockChain-BlockChain.html @@ -1,19 +1,19 @@ Cooked.MockChain.BlockChain

cooked-validators-2.0.0
Safe HaskellNone
LanguageHaskell2010

Cooked.MockChain.BlockChain

Synopsis

Documentation

data MockChainError where Source #

The errors that can be produced by the MockChainT monad

Constructors

MCEValidationError :: ValidationErrorInPhase -> MockChainError 
MCEUnbalanceable :: MCEUnbalanceableError -> TxSkel -> MockChainError 
MCENoSuitableCollateral :: MockChainError

Thrown when the balancing wallet owns no output that is pure Ada and with no datum.

MCEGenerationError :: GenerateTxError -> MockChainError 
MCECalcFee :: MockChainError -> MockChainError

Errors happening at fee calculation time.

MCEUnknownOutRefError :: String -> TxOutRef -> MockChainError

Thrown when an output reference should be in the state of the mockchain, - but isn't.

MCEUnknownValidator :: String -> ValidatorHash -> MockChainError

Same as MCEUnknownOutRefError for validators.

MCEUnknownDatum :: String -> DatumHash -> MockChainError

Same as MCEUnknownOutRefError for datums.

FailWith :: String -> MockChainError

Used to provide MonadFail instances.

OtherMockChainError :: (Show err, Eq err) => err -> MockChainError 

Instances

Instances details
Eq MockChainError Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Show MockChainError Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

PrettyCooked MockChainError Source # 
Instance details

Defined in Cooked.Pretty.Cooked

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Monad m => MonadError MockChainError (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

(MonadTransControl t, MonadError MockChainError m, Monad (t m)) => MonadError MockChainError (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

throwError :: MockChainError -> AsTrans t m a #

catchError :: AsTrans t m a -> (MockChainError -> AsTrans t m a) -> AsTrans t m a #

Show a => PrettyCooked (Either MockChainError (a, UtxoState)) Source # 
Instance details

Defined in Cooked.Pretty.Cooked

data MCEUnbalanceableError Source #

Constructors

MCEUnbalNotEnoughFunds Wallet Value

The balancing wallet misses some value to pay what is needed to balance + but isn't.

MCEUnknownValidator :: String -> ValidatorHash -> MockChainError

Same as MCEUnknownOutRefError for validators.

MCEUnknownDatum :: String -> DatumHash -> MockChainError

Same as MCEUnknownOutRefError for datums.

FailWith :: String -> MockChainError

Used to provide MonadFail instances.

OtherMockChainError :: (Show err, Eq err) => err -> MockChainError 

Instances

Instances details
Eq MockChainError Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Show MockChainError Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

PrettyCooked MockChainError Source # 
Instance details

Defined in Cooked.Pretty.Cooked

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Monad m => MonadError MockChainError (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

(MonadTransControl t, MonadError MockChainError m, Monad (t m)) => MonadError MockChainError (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

throwError :: MockChainError -> AsTrans t m a #

catchError :: AsTrans t m a -> (MockChainError -> AsTrans t m a) -> AsTrans t m a #

Show a => PrettyCooked (Either MockChainError (a, UtxoState)) Source # 
Instance details

Defined in Cooked.Pretty.Cooked

data MCEUnbalanceableError Source #

Constructors

MCEUnbalNotEnoughFunds Wallet Value

The balancing wallet misses some value to pay what is needed to balance the transaction.

MCEUnbalNotEnoughReturning (Value, [TxOutRef]) (Value, [TxOutRef]) Value

There is value to return to the balancing wallet but not enough to fullfill the min ada requirement and there is not enough in additional inputs to make it possible.

class (MonadFail m, MonadError MockChainError m) => MonadBlockChainBalancing m where Source #

Contains methods needed for balancing.

Methods

getParams :: m Params Source #

Returns the parameters of the chain.

utxosAtLedger :: Address -> m [(TxOutRef, TxOut)] Source #

Returns a list of all UTxOs at a certain address.

datumFromHash :: DatumHash -> m (Maybe Datum) Source #

Returns the datum with the given hash or Nothing if there is none

validatorFromHash :: ValidatorHash -> m (Maybe (Versioned Validator)) Source #

Returns the full validator corresponding to hash, if that validator owns - something or if it is stored in the reference script field of some UTxO.

txOutByRefLedger :: TxOutRef -> m (Maybe TxOut) Source #

Returns an output given a reference to it

Instances

Instances details
MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadBlockChainBalancing m => MonadBlockChainBalancing (ListT m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: ListT m Params Source #

utxosAtLedger :: Address -> ListT m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> ListT m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> ListT m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> ListT m (Maybe TxOut) Source #

Monad m => MonadBlockChainBalancing (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

getParams :: MockChainT m Params Source #

utxosAtLedger :: Address -> MockChainT m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> MockChainT m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> MockChainT m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> MockChainT m (Maybe TxOut) Source #

MonadBlockChainBalancing m => MonadBlockChainBalancing (ReaderT r m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: ReaderT r m Params Source #

utxosAtLedger :: Address -> ReaderT r m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> ReaderT r m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> ReaderT r m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> ReaderT r m (Maybe TxOut) Source #

MonadBlockChainBalancing m => MonadBlockChainBalancing (StateT s m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: StateT s m Params Source #

utxosAtLedger :: Address -> StateT s m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StateT s m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StateT s m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StateT s m (Maybe TxOut) Source #

(Monoid w, MonadBlockChainBalancing m) => MonadBlockChainBalancing (WriterT w m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: WriterT w m Params Source #

utxosAtLedger :: Address -> WriterT w m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> WriterT w m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> WriterT w m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> WriterT w m (Maybe TxOut) Source #

(MonadTrans t, MonadBlockChainBalancing m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainBalancing (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: AsTrans t m Params Source #

utxosAtLedger :: Address -> AsTrans t m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> AsTrans t m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> AsTrans t m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> AsTrans t m (Maybe TxOut) Source #

class MonadBlockChainBalancing m => MonadBlockChainWithoutValidation m where Source #

Methods

allUtxosLedger :: m [(TxOutRef, TxOut)] Source #

Returns a list of all currently known outputs.

currentSlot :: m Slot Source #

Returns the current slot number

awaitSlot :: Slot -> m Slot Source #

Waits until the current slot becomes greater or equal to the given slot, + something or if it is stored in the reference script field of some UTxO.

txOutByRefLedger :: TxOutRef -> m (Maybe TxOut) Source #

Returns an output given a reference to it

Instances

Instances details
MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadBlockChainBalancing m => MonadBlockChainBalancing (ListT m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: ListT m Params Source #

utxosAtLedger :: Address -> ListT m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> ListT m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> ListT m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> ListT m (Maybe TxOut) Source #

Monad m => MonadBlockChainBalancing (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

getParams :: MockChainT m Params Source #

utxosAtLedger :: Address -> MockChainT m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> MockChainT m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> MockChainT m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> MockChainT m (Maybe TxOut) Source #

MonadBlockChainBalancing m => MonadBlockChainBalancing (ReaderT r m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: ReaderT r m Params Source #

utxosAtLedger :: Address -> ReaderT r m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> ReaderT r m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> ReaderT r m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> ReaderT r m (Maybe TxOut) Source #

MonadBlockChainBalancing m => MonadBlockChainBalancing (StateT s m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: StateT s m Params Source #

utxosAtLedger :: Address -> StateT s m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StateT s m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StateT s m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StateT s m (Maybe TxOut) Source #

(Monoid w, MonadBlockChainBalancing m) => MonadBlockChainBalancing (WriterT w m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: WriterT w m Params Source #

utxosAtLedger :: Address -> WriterT w m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> WriterT w m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> WriterT w m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> WriterT w m (Maybe TxOut) Source #

(MonadTrans t, MonadBlockChainBalancing m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainBalancing (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: AsTrans t m Params Source #

utxosAtLedger :: Address -> AsTrans t m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> AsTrans t m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> AsTrans t m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> AsTrans t m (Maybe TxOut) Source #

class MonadBlockChainBalancing m => MonadBlockChainWithoutValidation m where Source #

Methods

allUtxosLedger :: m [(TxOutRef, TxOut)] Source #

Returns a list of all currently known outputs.

currentSlot :: m Slot Source #

Returns the current slot number

awaitSlot :: Slot -> m Slot Source #

Waits until the current slot becomes greater or equal to the given slot, and returns the current slot after waiting.

Note that it might not wait for anything if the current slot is large - enough.

Instances

Instances details
MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (ListT m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: ListT m [(TxOutRef, TxOut)] Source #

currentSlot :: ListT m Slot Source #

awaitSlot :: Slot -> ListT m Slot Source #

Monad m => MonadBlockChainWithoutValidation (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

allUtxosLedger :: MockChainT m [(TxOutRef, TxOut)] Source #

currentSlot :: MockChainT m Slot Source #

awaitSlot :: Slot -> MockChainT m Slot Source #

MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (ReaderT r m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: ReaderT r m [(TxOutRef, TxOut)] Source #

currentSlot :: ReaderT r m Slot Source #

awaitSlot :: Slot -> ReaderT r m Slot Source #

MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (StateT s m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: StateT s m [(TxOutRef, TxOut)] Source #

currentSlot :: StateT s m Slot Source #

awaitSlot :: Slot -> StateT s m Slot Source #

(Monoid w, MonadBlockChainWithoutValidation m) => MonadBlockChainWithoutValidation (WriterT w m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: WriterT w m [(TxOutRef, TxOut)] Source #

currentSlot :: WriterT w m Slot Source #

awaitSlot :: Slot -> WriterT w m Slot Source #

(MonadTrans t, MonadBlockChainWithoutValidation m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainWithoutValidation (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: AsTrans t m [(TxOutRef, TxOut)] Source #

currentSlot :: AsTrans t m Slot Source #

awaitSlot :: Slot -> AsTrans t m Slot Source #

class MonadBlockChainWithoutValidation m => MonadBlockChain m where Source #

The main abstraction of the blockchain.

Methods

validateTxSkel :: TxSkel -> m CardanoTx Source #

Generates, balances and validates a transaction from a skeleton. + enough.

Instances

Instances details
MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (ListT m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: ListT m [(TxOutRef, TxOut)] Source #

currentSlot :: ListT m Slot Source #

awaitSlot :: Slot -> ListT m Slot Source #

Monad m => MonadBlockChainWithoutValidation (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

allUtxosLedger :: MockChainT m [(TxOutRef, TxOut)] Source #

currentSlot :: MockChainT m Slot Source #

awaitSlot :: Slot -> MockChainT m Slot Source #

MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (ReaderT r m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: ReaderT r m [(TxOutRef, TxOut)] Source #

currentSlot :: ReaderT r m Slot Source #

awaitSlot :: Slot -> ReaderT r m Slot Source #

MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (StateT s m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: StateT s m [(TxOutRef, TxOut)] Source #

currentSlot :: StateT s m Slot Source #

awaitSlot :: Slot -> StateT s m Slot Source #

(Monoid w, MonadBlockChainWithoutValidation m) => MonadBlockChainWithoutValidation (WriterT w m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: WriterT w m [(TxOutRef, TxOut)] Source #

currentSlot :: WriterT w m Slot Source #

awaitSlot :: Slot -> WriterT w m Slot Source #

(MonadTrans t, MonadBlockChainWithoutValidation m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainWithoutValidation (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: AsTrans t m [(TxOutRef, TxOut)] Source #

currentSlot :: AsTrans t m Slot Source #

awaitSlot :: Slot -> AsTrans t m Slot Source #

class MonadBlockChainWithoutValidation m => MonadBlockChain m where Source #

The main abstraction of the blockchain.

Methods

validateTxSkel :: TxSkel -> m CardanoTx Source #

Generates, balances and validates a transaction from a skeleton. It returns the validated transaction and updates the state of the blockchain. In MockChainT, this means: - deletes the consumed outputs from mcstIndex - adds the produced outputs to msctIndex - deletes the consumed datums from mcstDatums - adds the produced datums to mcstDatums - - adds the validators on outputs to the mcstValidators.

Instances

Instances details
MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChain m => MonadBlockChain (ListT m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> ListT m CardanoTx Source #

Monad m => MonadBlockChain (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

validateTxSkel :: TxSkel -> MockChainT m CardanoTx Source #

MonadBlockChain m => MonadBlockChain (ReaderT r m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> ReaderT r m CardanoTx Source #

MonadBlockChain m => MonadBlockChain (StateT s m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> StateT s m CardanoTx Source #

(Monoid w, MonadBlockChain m) => MonadBlockChain (WriterT w m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> WriterT w m CardanoTx Source #

(MonadTrans t, MonadBlockChain m, MonadBlockChainWithoutValidation (AsTrans t m)) => MonadBlockChain (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> AsTrans t m CardanoTx Source #

newtype AsTrans t (m :: Type -> Type) a Source #

A newtype wrapper to be used with '-XDerivingVia' to derive instances of MonadBlockChain + - adds the validators on outputs to the mcstValidators.

Instances

Instances details
MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChain m => MonadBlockChain (ListT m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> ListT m CardanoTx Source #

Monad m => MonadBlockChain (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

validateTxSkel :: TxSkel -> MockChainT m CardanoTx Source #

MonadBlockChain m => MonadBlockChain (ReaderT r m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> ReaderT r m CardanoTx Source #

MonadBlockChain m => MonadBlockChain (StateT s m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> StateT s m CardanoTx Source #

(Monoid w, MonadBlockChain m) => MonadBlockChain (WriterT w m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> WriterT w m CardanoTx Source #

(MonadTrans t, MonadBlockChain m, MonadBlockChainWithoutValidation (AsTrans t m)) => MonadBlockChain (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> AsTrans t m CardanoTx Source #

newtype AsTrans t (m :: Type -> Type) a Source #

A newtype wrapper to be used with '-XDerivingVia' to derive instances of MonadBlockChain for any MonadTransControl.

For example, to derive 'MonadBlockChain m => MonadBlockChain (ReaderT r m)', you'd write

deriving via (AsTrans (ReaderT r) m) instance MonadBlockChain m => MonadBlockChain (ReaderT r m)

and avoid the boilerplate of defining all the methods of the class yourself.

Constructors

AsTrans 

Fields

Instances

Instances details
(MonadTransControl t, MonadError MockChainError m, Monad (t m)) => MonadError MockChainError (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

throwError :: MockChainError -> AsTrans t m a #

catchError :: AsTrans t m a -> (MockChainError -> AsTrans t m a) -> AsTrans t m a #

MonadTrans t => MonadTrans (AsTrans t) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

lift :: Monad m => m a -> AsTrans t m a #

MonadTransControl t => MonadTransControl (AsTrans t) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Associated Types

type StT (AsTrans t) a

Methods

liftWith :: Monad m => (Run (AsTrans t) -> m a) -> AsTrans t m a

restoreT :: Monad m => m (StT (AsTrans t) a) -> AsTrans t m a

Monad (t m) => Monad (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

(>>=) :: AsTrans t m a -> (a -> AsTrans t m b) -> AsTrans t m b #

(>>) :: AsTrans t m a -> AsTrans t m b -> AsTrans t m b #

return :: a -> AsTrans t m a #

Functor (t m) => Functor (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

fmap :: (a -> b) -> AsTrans t m a -> AsTrans t m b #

(<$) :: a -> AsTrans t m b -> AsTrans t m a #

(MonadTrans t, MonadFail m, Monad (t m)) => MonadFail (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

fail :: String -> AsTrans t m a #

Applicative (t m) => Applicative (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

pure :: a -> AsTrans t m a #

(<*>) :: AsTrans t m (a -> b) -> AsTrans t m a -> AsTrans t m b #

liftA2 :: (a -> b -> c) -> AsTrans t m a -> AsTrans t m b -> AsTrans t m c #

(*>) :: AsTrans t m a -> AsTrans t m b -> AsTrans t m b #

(<*) :: AsTrans t m a -> AsTrans t m b -> AsTrans t m a #

(MonadTrans t, MonadBlockChain m, MonadBlockChainWithoutValidation (AsTrans t m)) => MonadBlockChain (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> AsTrans t m CardanoTx Source #

(MonadTrans t, MonadBlockChainWithoutValidation m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainWithoutValidation (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: AsTrans t m [(TxOutRef, TxOut)] Source #

currentSlot :: AsTrans t m Slot Source #

awaitSlot :: Slot -> AsTrans t m Slot Source #

(MonadTrans t, MonadBlockChainBalancing m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainBalancing (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: AsTrans t m Params Source #

utxosAtLedger :: Address -> AsTrans t m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> AsTrans t m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> AsTrans t m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> AsTrans t m (Maybe TxOut) Source #

type StT (AsTrans t) a Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

type StT (AsTrans t) a = StT t a

allUtxos :: MonadBlockChainWithoutValidation m => m [(TxOutRef, TxOut)] Source #

currentTime :: MonadBlockChainWithoutValidation m => m (POSIXTime, POSIXTime) Source #

Returns the closed ms interval corresponding to the current slot

waitNSlots :: MonadBlockChainWithoutValidation m => Integer -> m Slot Source #

Moves n slots fowards

utxosAt :: MonadBlockChainBalancing m => Address -> m [(TxOutRef, TxOut)] Source #

txOutByRef :: MonadBlockChainBalancing m => TxOutRef -> m (Maybe TxOut) Source #

utxosFromCardanoTx :: CardanoTx -> [(TxOutRef, TxOut)] Source #

Retrieve the ordered list of outputs of the given CardanoTx.

This is useful when writing endpoints and/or traces to fetch utxos of interest right from the start and avoid querying the chain for them afterwards using allUtxos or similar functions.

txOutV2FromLedger :: TxOut -> TxOut Source #

typedDatumFromTxOutRef :: (FromData a, MonadBlockChainWithoutValidation m) => TxOutRef -> m (Maybe a) Source #

resolveDatum :: (IsAbstractOutput out, ToOutputDatum (DatumType out), MonadBlockChainBalancing m) => out -> m (Maybe (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out))) Source #

Try to resolve the datum on the output: If there's an inline datum, take diff --git a/Cooked-MockChain-Direct.html b/Cooked-MockChain-Direct.html index 5e8ae1b1f..633d2436c 100644 --- a/Cooked-MockChain-Direct.html +++ b/Cooked-MockChain-Direct.html @@ -2,7 +2,7 @@ simple way to call validator scripts directly, without the need for all the complexity the Contract monad introduces.

Running a MockChain produces a UtxoState, a simplified view on UtxoIndex, which we also keep in our state.

data MockChainSt Source #

Slightly more concrete version of UtxoState, used to actually run the - simulation.

Constructors

MockChainSt 

Fields

Instances

Instances details
Eq MockChainSt Source # 
Instance details

Defined in Cooked.MockChain.Direct

Show MockChainSt Source # 
Instance details

Defined in Cooked.MockChain.Direct

Default MockChainSt Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

def :: MockChainSt

Monad m => MonadState MockChainSt (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

newtype MockChainEnv Source #

Constructors

MockChainEnv 

Fields

Instances

Instances details
Show MockChainEnv Source # 
Instance details

Defined in Cooked.MockChain.Direct

Default MockChainEnv Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

def :: MockChainEnv

Monad m => MonadReader MockChainEnv (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

newtype MockChainT m a Source #

Instances

Instances details
MonadFail StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

fail :: String -> StagedMockChain a #

Alternative StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadTrans MockChainT Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

lift :: Monad m => m a -> MockChainT m a #

MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Monad m => MonadState MockChainSt (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Monad m => MonadReader MockChainEnv (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Monad m => MonadError MockChainError (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Monad m => Monad (MockChainT m) Source #

Custom monad instance made to increase the slot count automatically

Instance details

Defined in Cooked.MockChain.Direct

Methods

(>>=) :: MockChainT m a -> (a -> MockChainT m b) -> MockChainT m b #

(>>) :: MockChainT m a -> MockChainT m b -> MockChainT m b #

return :: a -> MockChainT m a #

Functor m => Functor (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

fmap :: (a -> b) -> MockChainT m a -> MockChainT m b #

(<$) :: a -> MockChainT m b -> MockChainT m a #

Monad m => MonadFail (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

fail :: String -> MockChainT m a #

Monad m => Applicative (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

pure :: a -> MockChainT m a #

(<*>) :: MockChainT m (a -> b) -> MockChainT m a -> MockChainT m b #

liftA2 :: (a -> b -> c) -> MockChainT m a -> MockChainT m b -> MockChainT m c #

(*>) :: MockChainT m a -> MockChainT m b -> MockChainT m b #

(<*) :: MockChainT m a -> MockChainT m b -> MockChainT m a #

MonadPlus m => MonadPlus (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

mzero :: MockChainT m a #

mplus :: MockChainT m a -> MockChainT m a -> MockChainT m a #

(Monad m, Alternative m) => Alternative (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

empty :: MockChainT m a #

(<|>) :: MockChainT m a -> MockChainT m a -> MockChainT m a #

some :: MockChainT m a -> MockChainT m [a] #

many :: MockChainT m a -> MockChainT m [a] #

Monad m => MonadBlockChain (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

validateTxSkel :: TxSkel -> MockChainT m CardanoTx Source #

Monad m => MonadBlockChainWithoutValidation (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

allUtxosLedger :: MockChainT m [(TxOutRef, TxOut)] Source #

currentSlot :: MockChainT m Slot Source #

awaitSlot :: Slot -> MockChainT m Slot Source #

Monad m => MonadBlockChainBalancing (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

getParams :: MockChainT m Params Source #

utxosAtLedger :: Address -> MockChainT m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> MockChainT m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> MockChainT m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> MockChainT m (Maybe TxOut) Source #

combineMockChainT :: Monad m => (forall a. m a -> m a -> m a) -> MockChainT m x -> MockChainT m x -> MockChainT m x Source #

runMockChainTRaw :: Monad m => MockChainEnv -> MockChainSt -> MockChainT m a -> m (Either MockChainError (a, MockChainSt)) Source #

Executes a MockChainT from some initial state and environment; does not + simulation.

Constructors

MockChainSt 

Fields

Instances

Instances details
Eq MockChainSt Source # 
Instance details

Defined in Cooked.MockChain.Direct

Show MockChainSt Source # 
Instance details

Defined in Cooked.MockChain.Direct

Default MockChainSt Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

def :: MockChainSt

Monad m => MonadState MockChainSt (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

newtype MockChainEnv Source #

Constructors

MockChainEnv 

Fields

Instances

Instances details
Show MockChainEnv Source # 
Instance details

Defined in Cooked.MockChain.Direct

Default MockChainEnv Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

def :: MockChainEnv

Monad m => MonadReader MockChainEnv (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

newtype MockChainT m a Source #

Instances

Instances details
MonadFail StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

fail :: String -> StagedMockChain a #

Alternative StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadTrans MockChainT Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

lift :: Monad m => m a -> MockChainT m a #

MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Monad m => MonadState MockChainSt (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Monad m => MonadReader MockChainEnv (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Monad m => MonadError MockChainError (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Monad m => Monad (MockChainT m) Source #

Custom monad instance made to increase the slot count automatically

Instance details

Defined in Cooked.MockChain.Direct

Methods

(>>=) :: MockChainT m a -> (a -> MockChainT m b) -> MockChainT m b #

(>>) :: MockChainT m a -> MockChainT m b -> MockChainT m b #

return :: a -> MockChainT m a #

Functor m => Functor (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

fmap :: (a -> b) -> MockChainT m a -> MockChainT m b #

(<$) :: a -> MockChainT m b -> MockChainT m a #

Monad m => MonadFail (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

fail :: String -> MockChainT m a #

Monad m => Applicative (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

pure :: a -> MockChainT m a #

(<*>) :: MockChainT m (a -> b) -> MockChainT m a -> MockChainT m b #

liftA2 :: (a -> b -> c) -> MockChainT m a -> MockChainT m b -> MockChainT m c #

(*>) :: MockChainT m a -> MockChainT m b -> MockChainT m b #

(<*) :: MockChainT m a -> MockChainT m b -> MockChainT m a #

MonadPlus m => MonadPlus (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

mzero :: MockChainT m a #

mplus :: MockChainT m a -> MockChainT m a -> MockChainT m a #

(Monad m, Alternative m) => Alternative (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

empty :: MockChainT m a #

(<|>) :: MockChainT m a -> MockChainT m a -> MockChainT m a #

some :: MockChainT m a -> MockChainT m [a] #

many :: MockChainT m a -> MockChainT m [a] #

Monad m => MonadBlockChain (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

validateTxSkel :: TxSkel -> MockChainT m CardanoTx Source #

Monad m => MonadBlockChainWithoutValidation (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

allUtxosLedger :: MockChainT m [(TxOutRef, TxOut)] Source #

currentSlot :: MockChainT m Slot Source #

awaitSlot :: Slot -> MockChainT m Slot Source #

Monad m => MonadBlockChainBalancing (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

getParams :: MockChainT m Params Source #

utxosAtLedger :: Address -> MockChainT m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> MockChainT m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> MockChainT m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> MockChainT m (Maybe TxOut) Source #

combineMockChainT :: Monad m => (forall a. m a -> m a -> m a) -> MockChainT m x -> MockChainT m x -> MockChainT m x Source #

runMockChainTRaw :: Monad m => MockChainEnv -> MockChainSt -> MockChainT m a -> m (Either MockChainError (a, MockChainSt)) Source #

Executes a MockChainT from some initial state and environment; does not convert the MockChainSt into a UtxoState.

runMockChainTFrom :: Monad m => InitialDistribution -> MockChainT m a -> m (Either MockChainError (a, UtxoState)) Source #

Executes a MockChainT from an initial state set up with the given initial value distribution. Similar to runMockChainT, uses the default environment. Returns a UtxoState instead of a MockChainSt. If you need diff --git a/Cooked-MockChain-Staged.html b/Cooked-MockChain-Staged.html index 569d37dca..3f361e3db 100644 --- a/Cooked-MockChain-Staged.html +++ b/Cooked-MockChain-Staged.html @@ -1,8 +1,8 @@ -Cooked.MockChain.Staged

cooked-validators-2.0.0
Safe HaskellNone
LanguageHaskell2010

Cooked.MockChain.Staged

Synopsis

Documentation

interpretAndRunWith :: (forall m. Monad m => MockChainT m a -> m res) -> StagedMockChain a -> [(res, MockChainLog)] Source #

Interprets the staged mockchain then runs the resulting computation with a +Cooked.MockChain.Staged

cooked-validators-2.0.0
Safe HaskellNone
LanguageHaskell2010

Cooked.MockChain.Staged

Synopsis

Documentation

interpretAndRunWith :: (forall m. Monad m => MockChainT m a -> m res) -> StagedMockChain a -> [(res, MockChainLog)] Source #

Interprets the staged mockchain then runs the resulting computation with a custom function. This can be used, for example, to supply a custom - InitialDistribution by providing runMockChainTFrom.

newtype MockChainLog Source #

Instances

Instances details
MonadFail StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

fail :: String -> StagedMockChain a #

Semigroup MockChainLog Source # 
Instance details

Defined in Cooked.MockChain.Staged

Monoid MockChainLog Source # 
Instance details

Defined in Cooked.MockChain.Staged

Alternative StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

PrettyCooked MockChainLog Source #

This pretty prints a MockChainLog that usually consists of the list of + InitialDistribution by providing runMockChainTFrom.

newtype MockChainLog Source #

Instances

Instances details
MonadFail StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

fail :: String -> StagedMockChain a #

Semigroup MockChainLog Source # 
Instance details

Defined in Cooked.MockChain.Staged

Monoid MockChainLog Source # 
Instance details

Defined in Cooked.MockChain.Staged

Alternative StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

PrettyCooked MockChainLog Source #

This pretty prints a MockChainLog that usually consists of the list of validated or submitted transactions. In the log, we know a transaction has - been validated if the MCLogSubmittedTxSkel is followed by a MCLogNewTx.

Instance details

Defined in Cooked.Pretty.Cooked

MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

type StagedMockChain = Staged MockChainOp Source #

type MonadModalBlockChain m = (MonadBlockChain m, MonadModal m, Modification m ~ UntypedTweak InterpMockChain) Source #

A modal mock chain is a mock chain that allows us to use LTL modifications + been validated if the MCLogSubmittedTxSkel is followed by a MCLogNewTx.

Instance details

Defined in Cooked.Pretty.Cooked

MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

type StagedMockChain = Staged MockChainOp Source #

type MonadModalBlockChain m = (MonadBlockChain m, MonadModal m, Modification m ~ UntypedTweak InterpMockChain) Source #

A modal mock chain is a mock chain that allows us to use LTL modifications with Tweaks

somewhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a Source #

Apply a Tweak to some transaction in the given Trace. The tweak must apply at least once.

runTweak :: Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)] Source #

everywhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a Source #

Apply a Tweak to every transaction in a given trace. This is also successful if there are no transactions at all.

withTweak :: MonadModalBlockChain m => m x -> Tweak InterpMockChain a -> m x Source #

Apply a Tweak to the next transaction in the given trace. The order of @@ -11,4 +11,5 @@ endpoint arguments `withTweak` someModification ...

where endpoint builds and validates a single transaction depending on the given arguments. Then withTweak says "I want to modify the transaction - returned by this endpoint in the following way".

Orphan instances

MonadPlus m => MonadPlus (MockChainT m) Source # 
Instance details

Methods

mzero :: MockChainT m a #

mplus :: MockChainT m a -> MockChainT m a -> MockChainT m a #

\ No newline at end of file + returned by this endpoint in the following way".

there :: MonadModalBlockChain m => Integer -> Tweak InterpMockChain b -> m a -> m a Source #

Apply a Tweak to the nth transaction in a given trace, 0 indexed. + Only successful when this transaction exists and can be modified.

Orphan instances

MonadPlus m => MonadPlus (MockChainT m) Source # 
Instance details

Methods

mzero :: MockChainT m a #

mplus :: MockChainT m a -> MockChainT m a -> MockChainT m a #

\ No newline at end of file diff --git a/Cooked-MockChain.html b/Cooked-MockChain.html index 3a59dd681..8ccdc7011 100644 --- a/Cooked-MockChain.html +++ b/Cooked-MockChain.html @@ -1,4 +1,4 @@ -Cooked.MockChain
cooked-validators-2.0.0
Safe HaskellNone
LanguageHaskell2010

Cooked.MockChain

Synopsis

Documentation

data UtxoState Source #

A description of who owns what in a blockchain. Owners are addresses +Cooked.MockChain

cooked-validators-2.0.0
Safe HaskellNone
LanguageHaskell2010

Cooked.MockChain

Synopsis

Documentation

data UtxoState Source #

A description of who owns what in a blockchain. Owners are addresses and they each own a UtxoPayloadSet.

Instances

Instances details
Eq UtxoState Source # 
Instance details

Defined in Cooked.MockChain.UtxoState

Semigroup UtxoState Source # 
Instance details

Defined in Cooked.MockChain.UtxoState

PrettyCooked UtxoState Source #

Pretty print a UtxoState. Print the known wallets first, then unknown pubkeys, then scripts.

Instance details

Defined in Cooked.Pretty.Cooked

Show a => PrettyCooked (Either MockChainError (a, UtxoState)) Source # 
Instance details

Defined in Cooked.Pretty.Cooked

Show a => PrettyCooked (a, UtxoState) Source # 
Instance details

Defined in Cooked.Pretty.Cooked

holdsInState :: Address -> UtxoState -> Value Source #

Total value accessible to what's pointed by the address.

newtype AsTrans t (m :: Type -> Type) a Source #

A newtype wrapper to be used with '-XDerivingVia' to derive instances of MonadBlockChain for any MonadTransControl.

For example, to derive 'MonadBlockChain m => MonadBlockChain (ReaderT r m)', you'd write

deriving via (AsTrans (ReaderT r) m) instance MonadBlockChain m => MonadBlockChain (ReaderT r m)

and avoid the boilerplate of defining all the methods of the class yourself.

Constructors

AsTrans 

Fields

Instances

Instances details
(MonadTransControl t, MonadError MockChainError m, Monad (t m)) => MonadError MockChainError (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

throwError :: MockChainError -> AsTrans t m a #

catchError :: AsTrans t m a -> (MockChainError -> AsTrans t m a) -> AsTrans t m a #

MonadTrans t => MonadTrans (AsTrans t) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

lift :: Monad m => m a -> AsTrans t m a #

MonadTransControl t => MonadTransControl (AsTrans t) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Associated Types

type StT (AsTrans t) a

Methods

liftWith :: Monad m => (Run (AsTrans t) -> m a) -> AsTrans t m a

restoreT :: Monad m => m (StT (AsTrans t) a) -> AsTrans t m a

Monad (t m) => Monad (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

(>>=) :: AsTrans t m a -> (a -> AsTrans t m b) -> AsTrans t m b #

(>>) :: AsTrans t m a -> AsTrans t m b -> AsTrans t m b #

return :: a -> AsTrans t m a #

Functor (t m) => Functor (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

fmap :: (a -> b) -> AsTrans t m a -> AsTrans t m b #

(<$) :: a -> AsTrans t m b -> AsTrans t m a #

(MonadTrans t, MonadFail m, Monad (t m)) => MonadFail (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

fail :: String -> AsTrans t m a #

Applicative (t m) => Applicative (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

pure :: a -> AsTrans t m a #

(<*>) :: AsTrans t m (a -> b) -> AsTrans t m a -> AsTrans t m b #

liftA2 :: (a -> b -> c) -> AsTrans t m a -> AsTrans t m b -> AsTrans t m c #

(*>) :: AsTrans t m a -> AsTrans t m b -> AsTrans t m b #

(<*) :: AsTrans t m a -> AsTrans t m b -> AsTrans t m a #

(MonadTrans t, MonadBlockChain m, MonadBlockChainWithoutValidation (AsTrans t m)) => MonadBlockChain (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> AsTrans t m CardanoTx Source #

(MonadTrans t, MonadBlockChainWithoutValidation m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainWithoutValidation (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: AsTrans t m [(TxOutRef, TxOut)] Source #

currentSlot :: AsTrans t m Slot Source #

awaitSlot :: Slot -> AsTrans t m Slot Source #

(MonadTrans t, MonadBlockChainBalancing m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainBalancing (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: AsTrans t m Params Source #

utxosAtLedger :: Address -> AsTrans t m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> AsTrans t m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> AsTrans t m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> AsTrans t m (Maybe TxOut) Source #

type StT (AsTrans t) a Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

type StT (AsTrans t) a = StT t a

class MonadBlockChainWithoutValidation m => MonadBlockChain m where Source #

The main abstraction of the blockchain.

Methods

validateTxSkel :: TxSkel -> m CardanoTx Source #

Generates, balances and validates a transaction from a skeleton. @@ -8,15 +8,15 @@ - adds the produced outputs to msctIndex - deletes the consumed datums from mcstDatums - adds the produced datums to mcstDatums - - adds the validators on outputs to the mcstValidators.

Instances

Instances details
MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChain m => MonadBlockChain (ListT m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> ListT m CardanoTx Source #

Monad m => MonadBlockChain (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

validateTxSkel :: TxSkel -> MockChainT m CardanoTx Source #

MonadBlockChain m => MonadBlockChain (ReaderT r m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> ReaderT r m CardanoTx Source #

MonadBlockChain m => MonadBlockChain (StateT s m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> StateT s m CardanoTx Source #

(Monoid w, MonadBlockChain m) => MonadBlockChain (WriterT w m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> WriterT w m CardanoTx Source #

(MonadTrans t, MonadBlockChain m, MonadBlockChainWithoutValidation (AsTrans t m)) => MonadBlockChain (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> AsTrans t m CardanoTx Source #

class MonadBlockChainBalancing m => MonadBlockChainWithoutValidation m where Source #

Methods

allUtxosLedger :: m [(TxOutRef, TxOut)] Source #

Returns a list of all currently known outputs.

currentSlot :: m Slot Source #

Returns the current slot number

awaitSlot :: Slot -> m Slot Source #

Waits until the current slot becomes greater or equal to the given slot, + - adds the validators on outputs to the mcstValidators.

Instances

Instances details
MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChain m => MonadBlockChain (ListT m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> ListT m CardanoTx Source #

Monad m => MonadBlockChain (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

validateTxSkel :: TxSkel -> MockChainT m CardanoTx Source #

MonadBlockChain m => MonadBlockChain (ReaderT r m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> ReaderT r m CardanoTx Source #

MonadBlockChain m => MonadBlockChain (StateT s m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> StateT s m CardanoTx Source #

(Monoid w, MonadBlockChain m) => MonadBlockChain (WriterT w m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> WriterT w m CardanoTx Source #

(MonadTrans t, MonadBlockChain m, MonadBlockChainWithoutValidation (AsTrans t m)) => MonadBlockChain (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

validateTxSkel :: TxSkel -> AsTrans t m CardanoTx Source #

class MonadBlockChainBalancing m => MonadBlockChainWithoutValidation m where Source #

Methods

allUtxosLedger :: m [(TxOutRef, TxOut)] Source #

Returns a list of all currently known outputs.

currentSlot :: m Slot Source #

Returns the current slot number

awaitSlot :: Slot -> m Slot Source #

Waits until the current slot becomes greater or equal to the given slot, and returns the current slot after waiting.

Note that it might not wait for anything if the current slot is large - enough.

Instances

Instances details
MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (ListT m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: ListT m [(TxOutRef, TxOut)] Source #

currentSlot :: ListT m Slot Source #

awaitSlot :: Slot -> ListT m Slot Source #

Monad m => MonadBlockChainWithoutValidation (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

allUtxosLedger :: MockChainT m [(TxOutRef, TxOut)] Source #

currentSlot :: MockChainT m Slot Source #

awaitSlot :: Slot -> MockChainT m Slot Source #

MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (ReaderT r m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: ReaderT r m [(TxOutRef, TxOut)] Source #

currentSlot :: ReaderT r m Slot Source #

awaitSlot :: Slot -> ReaderT r m Slot Source #

MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (StateT s m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: StateT s m [(TxOutRef, TxOut)] Source #

currentSlot :: StateT s m Slot Source #

awaitSlot :: Slot -> StateT s m Slot Source #

(Monoid w, MonadBlockChainWithoutValidation m) => MonadBlockChainWithoutValidation (WriterT w m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: WriterT w m [(TxOutRef, TxOut)] Source #

currentSlot :: WriterT w m Slot Source #

awaitSlot :: Slot -> WriterT w m Slot Source #

(MonadTrans t, MonadBlockChainWithoutValidation m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainWithoutValidation (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: AsTrans t m [(TxOutRef, TxOut)] Source #

currentSlot :: AsTrans t m Slot Source #

awaitSlot :: Slot -> AsTrans t m Slot Source #

class (MonadFail m, MonadError MockChainError m) => MonadBlockChainBalancing m where Source #

Contains methods needed for balancing.

Methods

getParams :: m Params Source #

Returns the parameters of the chain.

utxosAtLedger :: Address -> m [(TxOutRef, TxOut)] Source #

Returns a list of all UTxOs at a certain address.

datumFromHash :: DatumHash -> m (Maybe Datum) Source #

Returns the datum with the given hash or Nothing if there is none

validatorFromHash :: ValidatorHash -> m (Maybe (Versioned Validator)) Source #

Returns the full validator corresponding to hash, if that validator owns - something or if it is stored in the reference script field of some UTxO.

txOutByRefLedger :: TxOutRef -> m (Maybe TxOut) Source #

Returns an output given a reference to it

Instances

Instances details
MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadBlockChainBalancing m => MonadBlockChainBalancing (ListT m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: ListT m Params Source #

utxosAtLedger :: Address -> ListT m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> ListT m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> ListT m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> ListT m (Maybe TxOut) Source #

Monad m => MonadBlockChainBalancing (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

getParams :: MockChainT m Params Source #

utxosAtLedger :: Address -> MockChainT m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> MockChainT m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> MockChainT m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> MockChainT m (Maybe TxOut) Source #

MonadBlockChainBalancing m => MonadBlockChainBalancing (ReaderT r m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: ReaderT r m Params Source #

utxosAtLedger :: Address -> ReaderT r m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> ReaderT r m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> ReaderT r m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> ReaderT r m (Maybe TxOut) Source #

MonadBlockChainBalancing m => MonadBlockChainBalancing (StateT s m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: StateT s m Params Source #

utxosAtLedger :: Address -> StateT s m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StateT s m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StateT s m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StateT s m (Maybe TxOut) Source #

(Monoid w, MonadBlockChainBalancing m) => MonadBlockChainBalancing (WriterT w m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: WriterT w m Params Source #

utxosAtLedger :: Address -> WriterT w m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> WriterT w m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> WriterT w m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> WriterT w m (Maybe TxOut) Source #

(MonadTrans t, MonadBlockChainBalancing m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainBalancing (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: AsTrans t m Params Source #

utxosAtLedger :: Address -> AsTrans t m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> AsTrans t m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> AsTrans t m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> AsTrans t m (Maybe TxOut) Source #

data MCEUnbalanceableError Source #

Constructors

MCEUnbalNotEnoughFunds Wallet Value

The balancing wallet misses some value to pay what is needed to balance + enough.

Instances

Instances details
MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (ListT m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: ListT m [(TxOutRef, TxOut)] Source #

currentSlot :: ListT m Slot Source #

awaitSlot :: Slot -> ListT m Slot Source #

Monad m => MonadBlockChainWithoutValidation (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

allUtxosLedger :: MockChainT m [(TxOutRef, TxOut)] Source #

currentSlot :: MockChainT m Slot Source #

awaitSlot :: Slot -> MockChainT m Slot Source #

MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (ReaderT r m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: ReaderT r m [(TxOutRef, TxOut)] Source #

currentSlot :: ReaderT r m Slot Source #

awaitSlot :: Slot -> ReaderT r m Slot Source #

MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (StateT s m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: StateT s m [(TxOutRef, TxOut)] Source #

currentSlot :: StateT s m Slot Source #

awaitSlot :: Slot -> StateT s m Slot Source #

(Monoid w, MonadBlockChainWithoutValidation m) => MonadBlockChainWithoutValidation (WriterT w m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: WriterT w m [(TxOutRef, TxOut)] Source #

currentSlot :: WriterT w m Slot Source #

awaitSlot :: Slot -> WriterT w m Slot Source #

(MonadTrans t, MonadBlockChainWithoutValidation m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainWithoutValidation (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

allUtxosLedger :: AsTrans t m [(TxOutRef, TxOut)] Source #

currentSlot :: AsTrans t m Slot Source #

awaitSlot :: Slot -> AsTrans t m Slot Source #

class (MonadFail m, MonadError MockChainError m) => MonadBlockChainBalancing m where Source #

Contains methods needed for balancing.

Methods

getParams :: m Params Source #

Returns the parameters of the chain.

utxosAtLedger :: Address -> m [(TxOutRef, TxOut)] Source #

Returns a list of all UTxOs at a certain address.

datumFromHash :: DatumHash -> m (Maybe Datum) Source #

Returns the datum with the given hash or Nothing if there is none

validatorFromHash :: ValidatorHash -> m (Maybe (Versioned Validator)) Source #

Returns the full validator corresponding to hash, if that validator owns + something or if it is stored in the reference script field of some UTxO.

txOutByRefLedger :: TxOutRef -> m (Maybe TxOut) Source #

Returns an output given a reference to it

Instances

Instances details
MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadBlockChainBalancing m => MonadBlockChainBalancing (ListT m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: ListT m Params Source #

utxosAtLedger :: Address -> ListT m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> ListT m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> ListT m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> ListT m (Maybe TxOut) Source #

Monad m => MonadBlockChainBalancing (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

getParams :: MockChainT m Params Source #

utxosAtLedger :: Address -> MockChainT m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> MockChainT m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> MockChainT m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> MockChainT m (Maybe TxOut) Source #

MonadBlockChainBalancing m => MonadBlockChainBalancing (ReaderT r m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: ReaderT r m Params Source #

utxosAtLedger :: Address -> ReaderT r m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> ReaderT r m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> ReaderT r m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> ReaderT r m (Maybe TxOut) Source #

MonadBlockChainBalancing m => MonadBlockChainBalancing (StateT s m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: StateT s m Params Source #

utxosAtLedger :: Address -> StateT s m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StateT s m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StateT s m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StateT s m (Maybe TxOut) Source #

(Monoid w, MonadBlockChainBalancing m) => MonadBlockChainBalancing (WriterT w m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: WriterT w m Params Source #

utxosAtLedger :: Address -> WriterT w m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> WriterT w m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> WriterT w m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> WriterT w m (Maybe TxOut) Source #

(MonadTrans t, MonadBlockChainBalancing m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainBalancing (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

getParams :: AsTrans t m Params Source #

utxosAtLedger :: Address -> AsTrans t m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> AsTrans t m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> AsTrans t m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> AsTrans t m (Maybe TxOut) Source #

data MCEUnbalanceableError Source #

Constructors

MCEUnbalNotEnoughFunds Wallet Value

The balancing wallet misses some value to pay what is needed to balance the transaction.

MCEUnbalNotEnoughReturning (Value, [TxOutRef]) (Value, [TxOutRef]) Value

There is value to return to the balancing wallet but not enough to fullfill the min ada requirement and there is not enough in additional inputs to make it possible.

data MockChainError where Source #

The errors that can be produced by the MockChainT monad

Constructors

MCEValidationError :: ValidationErrorInPhase -> MockChainError 
MCEUnbalanceable :: MCEUnbalanceableError -> TxSkel -> MockChainError 
MCENoSuitableCollateral :: MockChainError

Thrown when the balancing wallet owns no output that is pure Ada and with no datum.

MCEGenerationError :: GenerateTxError -> MockChainError 
MCECalcFee :: MockChainError -> MockChainError

Errors happening at fee calculation time.

MCEUnknownOutRefError :: String -> TxOutRef -> MockChainError

Thrown when an output reference should be in the state of the mockchain, - but isn't.

MCEUnknownValidator :: String -> ValidatorHash -> MockChainError

Same as MCEUnknownOutRefError for validators.

MCEUnknownDatum :: String -> DatumHash -> MockChainError

Same as MCEUnknownOutRefError for datums.

FailWith :: String -> MockChainError

Used to provide MonadFail instances.

OtherMockChainError :: (Show err, Eq err) => err -> MockChainError 

Instances

Instances details
Eq MockChainError Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Show MockChainError Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

PrettyCooked MockChainError Source # 
Instance details

Defined in Cooked.Pretty.Cooked

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Monad m => MonadError MockChainError (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

(MonadTransControl t, MonadError MockChainError m, Monad (t m)) => MonadError MockChainError (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

throwError :: MockChainError -> AsTrans t m a #

catchError :: AsTrans t m a -> (MockChainError -> AsTrans t m a) -> AsTrans t m a #

Show a => PrettyCooked (Either MockChainError (a, UtxoState)) Source # 
Instance details

Defined in Cooked.Pretty.Cooked

allUtxos :: MonadBlockChainWithoutValidation m => m [(TxOutRef, TxOut)] Source #

utxosAt :: MonadBlockChainBalancing m => Address -> m [(TxOutRef, TxOut)] Source #

txOutByRef :: MonadBlockChainBalancing m => TxOutRef -> m (Maybe TxOut) Source #

utxosFromCardanoTx :: CardanoTx -> [(TxOutRef, TxOut)] Source #

Retrieve the ordered list of outputs of the given CardanoTx.

This is useful when writing endpoints and/or traces to fetch utxos of + but isn't.

MCEUnknownValidator :: String -> ValidatorHash -> MockChainError

Same as MCEUnknownOutRefError for validators.

MCEUnknownDatum :: String -> DatumHash -> MockChainError

Same as MCEUnknownOutRefError for datums.

FailWith :: String -> MockChainError

Used to provide MonadFail instances.

OtherMockChainError :: (Show err, Eq err) => err -> MockChainError 

Instances

Instances details
Eq MockChainError Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Show MockChainError Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

PrettyCooked MockChainError Source # 
Instance details

Defined in Cooked.Pretty.Cooked

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Monad m => MonadError MockChainError (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

(MonadTransControl t, MonadError MockChainError m, Monad (t m)) => MonadError MockChainError (AsTrans t m) Source # 
Instance details

Defined in Cooked.MockChain.BlockChain

Methods

throwError :: MockChainError -> AsTrans t m a #

catchError :: AsTrans t m a -> (MockChainError -> AsTrans t m a) -> AsTrans t m a #

Show a => PrettyCooked (Either MockChainError (a, UtxoState)) Source # 
Instance details

Defined in Cooked.Pretty.Cooked

allUtxos :: MonadBlockChainWithoutValidation m => m [(TxOutRef, TxOut)] Source #

utxosAt :: MonadBlockChainBalancing m => Address -> m [(TxOutRef, TxOut)] Source #

txOutByRef :: MonadBlockChainBalancing m => TxOutRef -> m (Maybe TxOut) Source #

utxosFromCardanoTx :: CardanoTx -> [(TxOutRef, TxOut)] Source #

Retrieve the ordered list of outputs of the given CardanoTx.

This is useful when writing endpoints and/or traces to fetch utxos of interest right from the start and avoid querying the chain for them afterwards using allUtxos or similar functions.

txOutV2FromLedger :: TxOut -> TxOut Source #

resolveDatum :: (IsAbstractOutput out, ToOutputDatum (DatumType out), MonadBlockChainBalancing m) => out -> m (Maybe (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out))) Source #

Try to resolve the datum on the output: If there's an inline datum, take that; if there's a datum hash, look the corresponding datum up (with @@ -38,7 +38,7 @@ TxOutRefs. Any TxOutRef that doesn't correspond to a known output will be filtered out.

filterWith :: Monad m => UtxoSearch m a -> (a -> m (Maybe b)) -> UtxoSearch m b Source #

Transform a UtxoSearch by applying a possibly failing monadic "lookup" on every output.

filterWithPure :: Monad m => UtxoSearch m a -> (a -> Maybe b) -> UtxoSearch m b Source #

filterWithOptic :: (Is k An_AffineFold, Monad m) => UtxoSearch m a -> Optic' k is a b -> UtxoSearch m b Source #

filterWithPred :: Monad m => UtxoSearch m a -> (a -> Bool) -> UtxoSearch m a Source #

balancedTx :: MonadBlockChainBalancing m => (TxSkel, Fee, Set TxOutRef) -> m (Tx BabbageEra) Source #

Take the output of balancedTxSkel and turn it into an actual Cardano - transaction.

txSkelInputData :: MonadBlockChainBalancing m => TxSkel -> m (Map DatumHash Datum) Source #

Look up the data on UTxOs the transaction consumes.

newtype MockChainT m a Source #

Instances

Instances details
MonadFail StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

fail :: String -> StagedMockChain a #

Alternative StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadTrans MockChainT Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

lift :: Monad m => m a -> MockChainT m a #

MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Monad m => MonadState MockChainSt (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Monad m => MonadReader MockChainEnv (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Monad m => MonadError MockChainError (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Monad m => Monad (MockChainT m) Source #

Custom monad instance made to increase the slot count automatically

Instance details

Defined in Cooked.MockChain.Direct

Methods

(>>=) :: MockChainT m a -> (a -> MockChainT m b) -> MockChainT m b #

(>>) :: MockChainT m a -> MockChainT m b -> MockChainT m b #

return :: a -> MockChainT m a #

Functor m => Functor (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

fmap :: (a -> b) -> MockChainT m a -> MockChainT m b #

(<$) :: a -> MockChainT m b -> MockChainT m a #

Monad m => MonadFail (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

fail :: String -> MockChainT m a #

Monad m => Applicative (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

pure :: a -> MockChainT m a #

(<*>) :: MockChainT m (a -> b) -> MockChainT m a -> MockChainT m b #

liftA2 :: (a -> b -> c) -> MockChainT m a -> MockChainT m b -> MockChainT m c #

(*>) :: MockChainT m a -> MockChainT m b -> MockChainT m b #

(<*) :: MockChainT m a -> MockChainT m b -> MockChainT m a #

MonadPlus m => MonadPlus (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

mzero :: MockChainT m a #

mplus :: MockChainT m a -> MockChainT m a -> MockChainT m a #

(Monad m, Alternative m) => Alternative (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

empty :: MockChainT m a #

(<|>) :: MockChainT m a -> MockChainT m a -> MockChainT m a #

some :: MockChainT m a -> MockChainT m [a] #

many :: MockChainT m a -> MockChainT m [a] #

Monad m => MonadBlockChain (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

validateTxSkel :: TxSkel -> MockChainT m CardanoTx Source #

Monad m => MonadBlockChainWithoutValidation (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

allUtxosLedger :: MockChainT m [(TxOutRef, TxOut)] Source #

currentSlot :: MockChainT m Slot Source #

awaitSlot :: Slot -> MockChainT m Slot Source #

Monad m => MonadBlockChainBalancing (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

getParams :: MockChainT m Params Source #

utxosAtLedger :: Address -> MockChainT m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> MockChainT m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> MockChainT m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> MockChainT m (Maybe TxOut) Source #

newtype MockChainEnv Source #

Constructors

MockChainEnv 

Fields

Instances

Instances details
Show MockChainEnv Source # 
Instance details

Defined in Cooked.MockChain.Direct

Default MockChainEnv Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

def :: MockChainEnv

Monad m => MonadReader MockChainEnv (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

data MockChainSt Source #

Slightly more concrete version of UtxoState, used to actually run the + transaction.

txSkelInputData :: MonadBlockChainBalancing m => TxSkel -> m (Map DatumHash Datum) Source #

Look up the data on UTxOs the transaction consumes.

newtype MockChainT m a Source #

Instances

Instances details
MonadFail StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

fail :: String -> StagedMockChain a #

Alternative StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadTrans MockChainT Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

lift :: Monad m => m a -> MockChainT m a #

MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Monad m => MonadState MockChainSt (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Monad m => MonadReader MockChainEnv (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Monad m => MonadError MockChainError (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Monad m => Monad (MockChainT m) Source #

Custom monad instance made to increase the slot count automatically

Instance details

Defined in Cooked.MockChain.Direct

Methods

(>>=) :: MockChainT m a -> (a -> MockChainT m b) -> MockChainT m b #

(>>) :: MockChainT m a -> MockChainT m b -> MockChainT m b #

return :: a -> MockChainT m a #

Functor m => Functor (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

fmap :: (a -> b) -> MockChainT m a -> MockChainT m b #

(<$) :: a -> MockChainT m b -> MockChainT m a #

Monad m => MonadFail (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

fail :: String -> MockChainT m a #

Monad m => Applicative (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

pure :: a -> MockChainT m a #

(<*>) :: MockChainT m (a -> b) -> MockChainT m a -> MockChainT m b #

liftA2 :: (a -> b -> c) -> MockChainT m a -> MockChainT m b -> MockChainT m c #

(*>) :: MockChainT m a -> MockChainT m b -> MockChainT m b #

(<*) :: MockChainT m a -> MockChainT m b -> MockChainT m a #

MonadPlus m => MonadPlus (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

mzero :: MockChainT m a #

mplus :: MockChainT m a -> MockChainT m a -> MockChainT m a #

(Monad m, Alternative m) => Alternative (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

empty :: MockChainT m a #

(<|>) :: MockChainT m a -> MockChainT m a -> MockChainT m a #

some :: MockChainT m a -> MockChainT m [a] #

many :: MockChainT m a -> MockChainT m [a] #

Monad m => MonadBlockChain (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

validateTxSkel :: TxSkel -> MockChainT m CardanoTx Source #

Monad m => MonadBlockChainWithoutValidation (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

allUtxosLedger :: MockChainT m [(TxOutRef, TxOut)] Source #

currentSlot :: MockChainT m Slot Source #

awaitSlot :: Slot -> MockChainT m Slot Source #

Monad m => MonadBlockChainBalancing (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

getParams :: MockChainT m Params Source #

utxosAtLedger :: Address -> MockChainT m [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> MockChainT m (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> MockChainT m (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> MockChainT m (Maybe TxOut) Source #

newtype MockChainEnv Source #

Constructors

MockChainEnv 

Fields

Instances

Instances details
Show MockChainEnv Source # 
Instance details

Defined in Cooked.MockChain.Direct

Default MockChainEnv Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

def :: MockChainEnv

Monad m => MonadReader MockChainEnv (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

data MockChainSt Source #

Slightly more concrete version of UtxoState, used to actually run the simulation.

Constructors

MockChainSt 

Fields

Instances

Instances details
Eq MockChainSt Source # 
Instance details

Defined in Cooked.MockChain.Direct

Show MockChainSt Source # 
Instance details

Defined in Cooked.MockChain.Direct

Default MockChainSt Source # 
Instance details

Defined in Cooked.MockChain.Direct

Methods

def :: MockChainSt

Monad m => MonadState MockChainSt (MockChainT m) Source # 
Instance details

Defined in Cooked.MockChain.Direct

combineMockChainT :: Monad m => (forall a. m a -> m a -> m a) -> MockChainT m x -> MockChainT m x -> MockChainT m x Source #

runMockChainTRaw :: Monad m => MockChainEnv -> MockChainSt -> MockChainT m a -> m (Either MockChainError (a, MockChainSt)) Source #

Executes a MockChainT from some initial state and environment; does not convert the MockChainSt into a UtxoState.

runMockChainTFrom :: Monad m => InitialDistribution -> MockChainT m a -> m (Either MockChainError (a, UtxoState)) Source #

Executes a MockChainT from an initial state set up with the given initial value distribution. Similar to runMockChainT, uses the default @@ -53,7 +53,8 @@ custom function. This can be used, for example, to supply a custom InitialDistribution by providing runMockChainTFrom.

runTweak :: Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)] Source #

somewhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a Source #

Apply a Tweak to some transaction in the given Trace. The tweak must apply at least once.

everywhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a Source #

Apply a Tweak to every transaction in a given trace. This is also - successful if there are no transactions at all.

withTweak :: MonadModalBlockChain m => m x -> Tweak InterpMockChain a -> m x Source #

Apply a Tweak to the next transaction in the given trace. The order of + successful if there are no transactions at all.

there :: MonadModalBlockChain m => Integer -> Tweak InterpMockChain b -> m a -> m a Source #

Apply a Tweak to the nth transaction in a given trace, 0 indexed. + Only successful when this transaction exists and can be modified.

withTweak :: MonadModalBlockChain m => m x -> Tweak InterpMockChain a -> m x Source #

Apply a Tweak to the next transaction in the given trace. The order of arguments is reversed compared to somewhere and everywhere, because that enables an idiom like

do ...
    endpoint arguments `withTweak` someModification
diff --git a/Cooked-Tweak-Common.html b/Cooked-Tweak-Common.html
index 891c42cdb..3327f56c5 100644
--- a/Cooked-Tweak-Common.html
+++ b/Cooked-Tweak-Common.html
@@ -13,7 +13,7 @@
  to a transaction skeleton and get all results as a list.

If you're trying to apply a tweak to a transaction directly before it's modified, consider using MonadModalBlockChain and idioms like withTweak, somewhere, or everywhere.

type Tweak m = StateT TxSkel (ListT m) Source #

data UntypedTweak m where Source #

This is a wrapper type used in the implementation of the Staged monad. You - will probably never use it while you're building Tweaks.

Constructors

UntypedTweak :: Tweak m a -> UntypedTweak m 

Instances

Instances details
MonadFail StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

fail :: String -> StagedMockChain a #

Alternative StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Monad m => Semigroup (UntypedTweak m) Source # 
Instance details

Defined in Cooked.Tweak.Common

Monad m => Monoid (UntypedTweak m) Source # 
Instance details

Defined in Cooked.Tweak.Common

User API

class (MonadPlus m, MonadBlockChainWithoutValidation m) => MonadTweak m where Source #

Instances

Instances details
MonadBlockChainWithoutValidation m => MonadTweak (Tweak m) Source # 
Instance details

Defined in Cooked.Tweak.Common

failingTweak :: MonadTweak m => m a Source #

The never-applicable tweak.

doNothingTweak :: MonadTweak m => m () Source #

The tweak that always applies and leaves the transaction unchanged.

viewTweak :: (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a Source #

The "tweak" that obtains some value from the TxSkel. This does *not* + will probably never use it while you're building Tweaks.

Constructors

UntypedTweak :: Tweak m a -> UntypedTweak m 

Instances

Instances details
MonadFail StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

fail :: String -> StagedMockChain a #

Alternative StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChain StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainWithoutValidation StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

MonadBlockChainBalancing StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Methods

getParams :: StagedMockChain Params Source #

utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] Source #

datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) Source #

validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) Source #

txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) Source #

MonadError MockChainError StagedMockChain Source # 
Instance details

Defined in Cooked.MockChain.Staged

Monad m => Semigroup (UntypedTweak m) Source # 
Instance details

Defined in Cooked.Tweak.Common

Monad m => Monoid (UntypedTweak m) Source # 
Instance details

Defined in Cooked.Tweak.Common

User API

class (MonadPlus m, MonadBlockChainWithoutValidation m) => MonadTweak m where Source #

Instances

Instances details
MonadBlockChainWithoutValidation m => MonadTweak (Tweak m) Source # 
Instance details

Defined in Cooked.Tweak.Common

failingTweak :: MonadTweak m => m a Source #

The never-applicable tweak.

doNothingTweak :: MonadTweak m => m () Source #

The tweak that always applies and leaves the transaction unchanged.

viewTweak :: (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a Source #

The "tweak" that obtains some value from the TxSkel. This does *not* modify the transaction.

viewAllTweak :: (MonadTweak m, Is k A_Fold) => Optic' k is TxSkel a -> m [a] Source #

Like the viewTweak, but returns a list of all foci

setTweak :: (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> a -> m () Source #

The tweak that sets a certain value in the TxSkel.

overTweak :: (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> (a -> a) -> m () Source #

The tweak that modifies a certain value in the TxSkel.

overMaybeTweak :: (MonadTweak m, Is k A_Traversal) => Optic' k is TxSkel a -> (a -> Maybe a) -> m [a] Source #

Like overTweak, but only modifies foci on which the argument function returns Just the new focus. Returns a list of the foci that were modified, as they were before the tweak, and in the order in which they occurred on diff --git a/cooked-validators.haddock b/cooked-validators.haddock index 3405249e325c70c80e829effc46df683ee11314c..bba46cc5f7e85eb468ca0c0836e4ee9460c82040 100644 GIT binary patch delta 2503 zcmaJ@dr*|u6~E`Z-(7hu3oE)TAn*Z3G7W-O6JJ%diP~l|ZA>yw+DsBQuoR}a7#0&u z97UsoV(Q}-H&Ue}K3b{?!lebB2}T=+wYHae&>15 zIrr{?FUv^Z31X-lVTscaOx=aRH?XG2aLNJOp`IQIJIv`T;bBnEQo>)t+`nX+JK%fzXQ|~G zKiV8I4CmQ*&#qD70$now7<^A}On)D4vDm0`00Rq|5v<}ZYC4^nV5V=*ehV5{$!vE8 z8d>=Z9so@g=6y_Gnrnh)`qtdTQa*|s$U2dnRnChBJRcvVMK4ZfUJF(#xLJ)PE8*}y0O6SEc40I9| zc%S(6<<*@Xjhf1(T)mPprM2zoVAo1rDy;;re{ z_$UwUx3=W9nte@NoYihmSd%PXj*Yt~*|oG(i_LC{OG`?zY1Z^4dzxLd*y6P~i%oma zs;x?iPfAGQDSBlKLl+VOdg<>P-T@;mYtV47YNRar=%=J=t^+W*t<%ww2FSpvPsg~rVkF0jF zRC3wnE42XopE%I!s}J~i&h%Cp_KCT9XuN#kM|1l^AWv3P-xmWvP@ikFj8_Qq-%56n zY_gqfBUvPqw)cno*$hO0l1JD z1P?Cc`yHXFg7EK0k8_yo7CGvDAa>mUslZdE4F60W^~1$H=VVqqoC&}Ll-u<65rYE9 z*?V_Q044I!UH9^#n9aOj4VV#yp67o?COupUla7-jQcM^rA(9EPgsy+&uRXdJ}CoD%=q|iMPEivkduV#ILP@3LRAk3-`;$lIsbx#P$5bw!m(!pIH97{<_7B^vYebErwMmCO$4lvvj}mG;zzRp??q58a*Fm!qdj0T zz*)y?Pq5%>S(VE$;0cEm{aI2)stGr6;5c9a^J4EmAmshDRafm#j&`}rBd7hBgTFxN zOzDUL3KYJ^RfUgcAx2vR=^pR`iI_W0^uPlT1cT*o&WSj;(m6#i(C8~o8;i5;8kP&!xjdnNkOQVOToBKP>>WmKI7gSf>9&ah2SPZK~mH#FuEvd3qh^K zNpRaZZ|7PCU2;jNW1M#q)I}~6+%0$y!TjglMSdXos<8JG)JKqL7WWe*+Z`105J5LL z2!~q)4GVsoz{q%_J1!1)$N4>i?vn=uKNNnC2p)C$94{+J^usS CnuiYn delta 2416 zcmah~dr*|u6~E`Z_pU51%PV1bVS$CUpbeq|X-t%8CJAveO&Z${>DZBB6S0^^6d|cp z62bVuM~rZS8_i@YC7Ps>DEXXOw=)GgaTGP6iSlLzRPYJNL!+qB``z6%nJF{fKhF7` zbIePKILW{@s!qn8Dc!1MtR`6pA ze5;m*E@#l7-Zka>2Y<^!@k_A%B|B?PmJJwb#CKw6!WsNBcE6B|?Xhr1&9^^CMZ7ys z4|K#Z9dnaS*cm?pXVtUQ-(v6`rp-JE-{Z*4T-r}x(~i}56ZZqv>$7F|`LlJ57O}OM z8)U|%DSw1>syjumzGYGcfIdzuap>7c z)sT7V3cX@DAdRBbQ+{-%Ql}YMl*({<+EdV?R-{D&Tu^IYm|@Vhas?8*MSw}=zn^P> zHhelW722^d(_-!53ti1m!Mmn%M(*kYk>C7|*I@FNYzX+pNHi$(_Olng> zC9u78BbC$Px@;XwiYXPA;AYy837zWN4WDpmRl`cs7tV|UmO>@K^9yeBE*uAxzIVG027bsDf7|j^Yi#-1j{L+A zW!5X*)llxsO2t=u<{w)rWl~=o z-30KpcEwb_Y6t8?G)M*pB zq80cUXdP#m+hBGzQFwzvopYfdbU>ZUs)s^I_!qC?wOoYMat+pre0bI;K%mf0x~IXlGIT` zzM({X<{8&b@zeWHHH4YWmhcE`WYqK-zkJM969_vM-v?#VyC|QqHR8u*Ptx3ZE(B(U zholqY*T=8$tNa?j&TsIWyq^aCA?%ST+8}&UASG?oFmW!jL+tu! z+9a%KkdicOn6yaQ%1Ik<=d{D8JB3#v9i<-W~srVjr^IlH-wDT*R zT;)WgNpEl>i4JJ?ASbu9^C7;T3~OM7!>F&&ZLfwqKK%nHclkX|$F#WnoIdcz(}$WK z=VZc{U!)U_i*&O;eiH>gdYH~=Bh$q`bOgz~xq%(UO#6p>? PbQ)A7xaKZ~>Z$($X>LMc diff --git a/doc-index-All.html b/doc-index-All.html index 7e74cfedf..116842889 100644 --- a/doc-index-All.html +++ b/doc-index-All.html @@ -1 +1 @@ -cooked-validators-2.0.0 (Index)

cooked-validators-2.0.0

Index

.&&.Cooked.MockChain.Testing, Cooked.MockChain, Cooked
.==.Cooked.MockChain.Testing, Cooked.MockChain, Cooked
.||.Cooked.MockChain.Testing, Cooked.MockChain, Cooked
adaLCooked.ValueUtils, Cooked
addFirstSignerTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
addInputTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
addLabelTweakCooked.Tweak.Labels, Cooked.Tweak, Cooked
addLastSignerTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
addMintTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
addOutputTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
addSignersTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
addTokenAttackCooked.Attack.AddToken, Cooked.Attack, Cooked
AddTokenLbl 
1 (Type/Class)Cooked.Attack.AddToken, Cooked.Attack, Cooked
2 (Data Constructor)Cooked.Attack.AddToken, Cooked.Attack, Cooked
addToTxSkelMintsCooked.Skeleton, Cooked
AdjustExistingOutputCooked.Skeleton, Cooked
allOutPermutsTweakCooked.Tweak.OutPermutations, Cooked.Tweak, Cooked
allUtxosCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
allUtxosLedgerCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
allUtxosLedgerSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
allUtxosSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
applyEmulatorParamsModificationCooked.Skeleton, Cooked
applyRawModOnBalancedTxCooked.Skeleton, Cooked
app_precCooked.ShowBS, Cooked
assertionToMaybeCooked.MockChain.Testing, Cooked.MockChain, Cooked
AsTrans 
1 (Type/Class)Cooked.MockChain.BlockChain, Cooked.MockChain, Cooked
2 (Data Constructor)Cooked.MockChain.BlockChain, Cooked.MockChain, Cooked
awaitEnclosingSlotCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
awaitSlotCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
balancedTxCooked.MockChain.Balancing, Cooked.MockChain, Cooked
balancedTxSkelCooked.MockChain.Balancing, Cooked.MockChain, Cooked
BalanceOutputPolicyCooked.Skeleton, Cooked
BalanceWithCooked.Skeleton, Cooked
BalanceWithFirstSignerCooked.Skeleton, Cooked
BalancingUtxosCooked.Skeleton, Cooked
BalancingUtxosAllCooked.Skeleton, Cooked
BalancingUtxosAllowlistCooked.Skeleton, Cooked
BalancingUtxosBlocklistCooked.Skeleton, Cooked
BalancingUtxosDatumlessCooked.Skeleton, Cooked
BalancingWalletCooked.Skeleton, Cooked
BuiltinCooked.Ltl
centerAroundValidityRangeTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
combineMockChainTCooked.MockChain.Direct, Cooked.MockChain, Cooked
combineModsTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
ConcreteOutput 
1 (Type/Class)Cooked.Output, Cooked
2 (Data Constructor)Cooked.Output, Cooked
currentSlotCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
currentTimeCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
datumFromHashCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
datumFromTxOutRefCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
datumHijackingAttackCooked.Attack.DatumHijacking, Cooked.Attack, Cooked
DatumHijackingLbl 
1 (Type/Class)Cooked.Attack.DatumHijacking, Cooked.Attack, Cooked
2 (Data Constructor)Cooked.Attack.DatumHijacking, Cooked.Attack, Cooked
datumHijackingTargetCooked.Attack.DatumHijacking, Cooked.Attack, Cooked
DatumTypeCooked.Output, Cooked, Cooked
distinctPermutationsCooked.Tweak.OutPermutations
DocCookedCooked.Pretty.Common, Cooked.Pretty, Cooked
doNothingTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
DontAdjustExistingOutputCooked.Skeleton, Cooked
doubleSatAttackCooked.Attack.DoubleSat, Cooked.Attack, Cooked
DoubleSatDeltaCooked.Attack.DoubleSat, Cooked.Attack, Cooked
DoubleSatLbl 
1 (Type/Class)Cooked.Attack.DoubleSat, Cooked.Attack, Cooked
2 (Data Constructor)Cooked.Attack.DoubleSat, Cooked.Attack, Cooked
dupTokenAttackCooked.Attack.DupToken, Cooked.Attack, Cooked
DupTokenLbl 
1 (Type/Class)Cooked.Attack.DupToken, Cooked.Attack, Cooked
2 (Data Constructor)Cooked.Attack.DupToken, Cooked.Attack, Cooked
EmulatorParamsModification 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
ensureInputTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
ensureOutputTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
everywhereCooked.MockChain.Staged, Cooked.MockChain, Cooked
failingTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
FailWithCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
Fee 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
feeLovelaceCooked.Skeleton, Cooked
filterWithCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
filterWithOpticCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
filterWithPredCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
filterWithPureCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
flattenValueICooked.ValueUtils, Cooked
forAllCooked.MockChain.Testing, Cooked.MockChain, Cooked
generateTxCooked.MockChain.GenerateTx
generateTxBodyContentCooked.MockChain.GenerateTx
GenerateTxErrorCooked.MockChain.GenerateTx
GenerateTxErrorGeneralCooked.MockChain.GenerateTx
GenTxParamsCooked.MockChain.GenerateTx
getEnclosingSlotCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
getIndexCooked.MockChain.Direct, Cooked.MockChain, Cooked
getParamsCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
getSignersTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
getTransCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
getTxSkelCooked.Tweak.Common, Cooked.Tweak, Cooked
getValidityRangeTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
gtpCollateralInsCooked.MockChain.GenerateTx
gtpFeeCooked.MockChain.GenerateTx
hasEmptyTimeRangeTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
hasFullTimeRangeTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
hasLabelTweakCooked.Tweak.Labels, Cooked.Tweak, Cooked
hasSignersTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
holdsInStateCooked.MockChain.UtxoState, Cooked.MockChain, Cooked
InitialDistribution 
1 (Type/Class)Cooked.Wallet, Cooked
2 (Data Constructor)Cooked.Wallet, Cooked
initialDistributionCooked.Wallet, Cooked
InstrCooked.Ltl
interpBuiltinCooked.Ltl
InterpLtlCooked.Ltl
interpLtlCooked.Ltl
interpLtlAndPruneUnfinishedCooked.Ltl
interpretAndRunCooked.MockChain.Staged, Cooked.MockChain, Cooked
interpretAndRunWithCooked.MockChain.Staged, Cooked.MockChain, Cooked
intersectValidityRangeTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
IsAbstractOutputCooked.Output, Cooked
isCekEvaluationFailureCooked.MockChain.Testing, Cooked.MockChain, Cooked
isCekEvaluationFailureWithMsgCooked.MockChain.Testing, Cooked.MockChain, Cooked
isOnlyAdaOutputCooked.Output, Cooked
isOutputWithDatumHashCooked.Output, Cooked
isOutputWithInlineDatumCooked.Output, Cooked
isOutputWithInlineDatumOfTypeCooked.Output, Cooked
isOutputWithoutDatumCooked.Output, Cooked
isPKOutputFromCooked.Output, Cooked
IsPropCooked.MockChain.Testing, Cooked.MockChain, Cooked
isScriptOutputFromCooked.Output, Cooked
isSignerTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
IsTxInfoOutputCooked.Output, Cooked
isValidAtTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
isValidDuringTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
isValidNowTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
iviewTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
KeepIdentityCooked.Tweak.OutPermutations, Cooked.Tweak, Cooked
knownWalletsCooked.Wallet, Cooked
LabelConstrsCooked.Skeleton, Cooked
LtlCooked.Ltl, Cooked
LtlAndCooked.Ltl, Cooked
LtlAtomCooked.Ltl, Cooked
LtlFalsityCooked.Ltl, Cooked
LtlNextCooked.Ltl, Cooked
LtlOpCooked.Ltl
LtlOrCooked.Ltl, Cooked
LtlReleaseCooked.Ltl, Cooked
LtlTruthCooked.Ltl, Cooked
LtlUntilCooked.Ltl, Cooked
makeValidityRangeNowTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
makeValidityRangeSingletonTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
MalformDatumLbl 
1 (Type/Class)Cooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
2 (Data Constructor)Cooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
malformDatumTweakCooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
mapMockChainTCooked.MockChain.Direct, Cooked.MockChain, Cooked
MCECalcFeeCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEGenerationErrorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCENoSuitableCollateralCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
mceParamsCooked.MockChain.Direct, Cooked.MockChain, Cooked
MCEUnbalanceableCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEUnbalanceableErrorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEUnbalNotEnoughFundsCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEUnbalNotEnoughReturningCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEUnknownDatumCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEUnknownOutRefErrorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEUnknownValidatorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEValidationErrorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCLogFailCooked.MockChain.Staged, Cooked.MockChain, Cooked
MCLogNewTxCooked.MockChain.Staged, Cooked.MockChain, Cooked
MCLogSubmittedTxSkelCooked.MockChain.Staged, Cooked.MockChain, Cooked
mcstCurrentSlotCooked.MockChain.Direct, Cooked.MockChain, Cooked
mcstDatumsCooked.MockChain.Direct, Cooked.MockChain, Cooked
mcstIndexCooked.MockChain.Direct, Cooked.MockChain, Cooked
mcstToUtxoStateCooked.MockChain.Direct, Cooked.MockChain, Cooked
mcstValidatorsCooked.MockChain.Direct, Cooked.MockChain, Cooked
MintsConstrsCooked.Skeleton, Cooked
MintsRedeemerCooked.Skeleton, Cooked
MockChainCooked.MockChain.Direct, Cooked.MockChain, Cooked
MockChainEnv 
1 (Type/Class)Cooked.MockChain.Direct, Cooked.MockChain, Cooked
2 (Data Constructor)Cooked.MockChain.Direct, Cooked.MockChain, Cooked
MockChainErrorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MockChainLog 
1 (Type/Class)Cooked.MockChain.Staged
2 (Data Constructor)Cooked.MockChain.Staged
MockChainLogEntryCooked.MockChain.Staged
MockChainSt 
1 (Type/Class)Cooked.MockChain.Direct, Cooked.MockChain, Cooked
2 (Data Constructor)Cooked.MockChain.Direct, Cooked.MockChain, Cooked
mockChainSt0Cooked.MockChain.Direct, Cooked.MockChain, Cooked
mockChainSt0FromCooked.MockChain.Direct, Cooked.MockChain, Cooked
MockChainT 
1 (Type/Class)Cooked.MockChain.Direct, Cooked.MockChain, Cooked
2 (Data Constructor)Cooked.MockChain.Direct, Cooked.MockChain, Cooked
ModificationCooked.Ltl, Cooked
modifyLtlCooked.Ltl, Cooked
modifySignersTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
MonadBlockChainCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MonadBlockChainBalancingCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MonadBlockChainWithoutValidationCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MonadModalCooked.Ltl, Cooked
MonadModalBlockChainCooked.MockChain.Staged, Cooked.MockChain, Cooked
MonadTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
mPrettyTxOptsCooked.Pretty.Cooked, Cooked.Pretty, Cooked
negativePartCooked.ValueUtils, Cooked
NoMintsRedeemerCooked.Skeleton, Cooked
nowLaterCooked.Ltl
nowLaterListCooked.Ltl
OmitIdentityCooked.Tweak.OutPermutations, Cooked.Tweak, Cooked
OtherMockChainErrorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
outputAddressCooked.Output, Cooked
outputDatumFromTxOutRefCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
outputDatumLCooked.Output, Cooked
outputOutputDatumCooked.Output, Cooked
outputOwnerLCooked.Output, Cooked
outputReferenceScriptHashCooked.Output, Cooked
outputReferenceScriptLCooked.Output, Cooked
outputStakingCredentialLCooked.Output, Cooked
outputTxOutCooked.Output, Cooked
outputValueCooked.Output, Cooked
outputValueLCooked.Output, Cooked
overMaybeSelectingTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
overMaybeTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
overTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
OwnerTypeCooked.Output, Cooked, Cooked
PaysCooked.Skeleton, Cooked
paysPKCooked.Skeleton, Cooked
paysScriptCooked.Skeleton, Cooked
paysScriptDatumHashCooked.Skeleton, Cooked
paysScriptInlineDatumCooked.Skeleton, Cooked
paysScriptNoDatumCooked.Skeleton, Cooked
pcOptNumericUnderscoresCooked.Pretty.Options, Cooked.Pretty, Cooked
pcOptPrintDefaultTxOptsCooked.Pretty.Options, Cooked.Pretty, Cooked
pcOptPrintedHashLengthCooked.Pretty.Options, Cooked.Pretty, Cooked
pcOptPrintTxHashesCooked.Pretty.Options, Cooked.Pretty, Cooked
pcOptPrintTxOutRefsCooked.Pretty.Options, Cooked.Pretty, Cooked
PCOptTxOutRefsCooked.Pretty.Options, Cooked.Pretty, Cooked
PCOptTxOutRefsFullCooked.Pretty.Options, Cooked.Pretty, Cooked
PCOptTxOutRefsHiddenCooked.Pretty.Options, Cooked.Pretty, Cooked
PCOptTxOutRefsPartialCooked.Pretty.Options, Cooked.Pretty, Cooked
permanentAssetClassCooked.Currencies, Cooked
permanentCurrencyPolicyCooked.Currencies, Cooked
permanentCurrencySymbolCooked.Currencies, Cooked
permanentTokenNameCooked.Currencies, Cooked
permanentValueCooked.Currencies, Cooked
PermutOutTweakModeCooked.Tweak.OutPermutations, Cooked.Tweak, Cooked
positivePartCooked.ValueUtils, Cooked
prettyAddressStateCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyBalancingWalletCooked.Pretty.Cooked, Cooked.Pretty, Cooked
PrettyCookedCooked.Pretty.Class, Cooked.Pretty, Cooked
prettyCookedCooked.Pretty.Class, Cooked.Pretty, Cooked
prettyCookedOptCooked.Pretty.Class, Cooked.Pretty, Cooked
PrettyCookedOpts 
1 (Type/Class)Cooked.Pretty.Options, Cooked.Pretty, Cooked
2 (Data Constructor)Cooked.Pretty.Options, Cooked.Pretty, Cooked
prettyEnumerateCooked.Pretty.Common, Cooked.Pretty, Cooked
prettyHashCooked.Pretty.Common, Cooked.Pretty, Cooked
prettyItemizeCooked.Pretty.Common, Cooked.Pretty, Cooked
prettyItemizeNonEmptyCooked.Pretty.Common, Cooked.Pretty, Cooked
prettyItemizeNoTitleCooked.Pretty.Common, Cooked.Pretty, Cooked
prettyMintsCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyPayloadCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyPayloadGroupedCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyReferenceScriptHashCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettySignersCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyTxSkelCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyTxSkelInCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyTxSkelInReferenceCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyTxSkelOutCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyTxSkelOutDatumMaybeCooked.Pretty.Cooked, Cooked.Pretty, Cooked
printCookedCooked.Pretty.Class, Cooked.Pretty, Cooked
printCookedOptCooked.Pretty.Class, Cooked.Pretty, Cooked
PrivateKeyCooked.Wallet, Cooked
producedOutputCooked.Skeleton, Cooked
putTxSkelCooked.Tweak.Common, Cooked.Tweak, Cooked
quickAssetClassCooked.Currencies, Cooked
quickCurrencyPolicyCooked.Currencies, Cooked
quickCurrencySymbolCooked.Currencies, Cooked
quickTokenNameCooked.Currencies, Cooked
quickValueCooked.Currencies, Cooked
RawModTxCooked.Skeleton, Cooked
RawModTxAfterBalancingCooked.Skeleton, Cooked
redirectScriptOutputTweakCooked.Attack.DatumHijacking, Cooked.Attack, Cooked
ReferenceScriptTypeCooked.Output, Cooked, Cooked
removeInputTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
removeLabelTweakCooked.Tweak.Labels, Cooked.Tweak, Cooked
removeMintTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
removeOutputTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
removeSignersTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
removeSignerTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
renderStringCooked.Pretty.Common, Cooked.Pretty, Cooked
replaceFirstSignerTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
resolveDatumCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
resolveReferenceScriptCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
resolveTypedDatumCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
resolveValidatorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
ReturnCooked.Ltl
runMockChainCooked.MockChain.Direct, Cooked.MockChain, Cooked
runMockChainFromCooked.MockChain.Direct, Cooked.MockChain, Cooked
runMockChainRawCooked.MockChain.Direct, Cooked.MockChain, Cooked
runMockChainTCooked.MockChain.Direct, Cooked.MockChain, Cooked
runMockChainTFromCooked.MockChain.Direct, Cooked.MockChain, Cooked
runMockChainTRawCooked.MockChain.Direct, Cooked.MockChain, Cooked
runTransactionValidationCooked.MockChain.Direct, Cooked.MockChain, Cooked
runTweakCooked.MockChain.Staged, Cooked.MockChain, Cooked
runTweakFromCooked.MockChain.Staged, Cooked.MockChain, Cooked
runTweakInChainCooked.Tweak.Common
runTweakInChain'Cooked.Tweak.Common
runUtxoSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
selectPCooked.Tweak.Common, Cooked.Tweak, Cooked
setAlwaysValidRangeTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
setSignersTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
setTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
setValidityRangeTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
ShowBSCooked.ShowBS, Cooked
showBSCooked.ShowBS, Cooked
showBSsCooked.ShowBS, Cooked
showBSsPrecCooked.ShowBS, Cooked
signersSatisfyTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
singleOutPermutTweakCooked.Tweak.OutPermutations, Cooked.Tweak, Cooked
SkelContext 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
skelContextTxOutsCooked.Skeleton, Cooked
skelContextTxSkelOutDatumsCooked.Skeleton, Cooked
slotRangeAfterCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
slotRangeBeforeCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
slotToTimeIntervalCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
SomeMintsRedeemerCooked.Skeleton, Cooked
somewhereCooked.MockChain.Staged, Cooked.MockChain, Cooked
StagedCooked.Ltl
StagedMockChainCooked.MockChain.Staged
StartLtlCooked.Ltl
StopLtlCooked.Ltl
TamperDatumLbl 
1 (Type/Class)Cooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
2 (Data Constructor)Cooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
tamperDatumTweakCooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
testAllCooked.MockChain.Testing, Cooked.MockChain, Cooked
testAllSatisfiesFromCooked.MockChain.Testing, Cooked.MockChain, Cooked
testBinaryRelatedByCooked.MockChain.Testing, Cooked.MockChain, Cooked
testBoolCooked.MockChain.Testing, Cooked.MockChain, Cooked
testConjoinCooked.MockChain.Testing, Cooked.MockChain, Cooked
testCounterexampleCooked.MockChain.Testing, Cooked.MockChain, Cooked
testDisjoinCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailsCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailsFromCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailureCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailureMsgCooked.MockChain.Testing, Cooked.MockChain, Cooked
testOneEquivClassCooked.MockChain.Testing, Cooked.MockChain, Cooked
testSatisfiesFrom'Cooked.MockChain.Testing, Cooked.MockChain, Cooked
testSucceedsCooked.MockChain.Testing, Cooked.MockChain, Cooked
testSucceedsFromCooked.MockChain.Testing, Cooked.MockChain, Cooked
testSucceedsFrom'Cooked.MockChain.Testing, Cooked.MockChain, Cooked
testSuccessCooked.MockChain.Testing, Cooked.MockChain, Cooked
ToCardanoErrorCooked.MockChain.GenerateTx
ToCredentialCooked.Output, Cooked
toCredentialCooked.Output, Cooked
ToOutputDatumCooked.Output, Cooked
toOutputDatumCooked.Output, Cooked
toOutputWithReferenceScriptHashCooked.Output, Cooked
ToScriptCooked.Output, Cooked
toScriptCooked.Output, Cooked
ToScriptHashCooked.Output, Cooked
toScriptHashCooked.Output, Cooked
ToValueCooked.Output, Cooked
toValueCooked.Output, Cooked
TweakCooked.Tweak.Common
TxBodyErrorCooked.MockChain.GenerateTx
TxLabel 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
txOptAutoSlotIncreaseCooked.Skeleton, Cooked
txOptAutoSlotIncreaseLCooked.Skeleton, Cooked
txOptAwaitTxConfirmedCooked.Skeleton, Cooked
txOptAwaitTxConfirmedLCooked.Skeleton, Cooked
txOptBalanceCooked.Skeleton, Cooked
txOptBalanceLCooked.Skeleton, Cooked
txOptBalanceOutputPolicyCooked.Skeleton, Cooked
txOptBalanceOutputPolicyLCooked.Skeleton, Cooked
txOptBalanceWalletCooked.Skeleton, Cooked
txOptBalanceWalletLCooked.Skeleton, Cooked
txOptBalancingUtxosCooked.Skeleton, Cooked
txOptBalancingUtxosLCooked.Skeleton, Cooked
txOptEmulatorParamsModificationCooked.Skeleton, Cooked
txOptEmulatorParamsModificationLCooked.Skeleton, Cooked
txOptEnsureMinAdaCooked.Skeleton, Cooked
txOptEnsureMinAdaLCooked.Skeleton, Cooked
TxOpts 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
txOptUnsafeModTxCooked.Skeleton, Cooked
txOptUnsafeModTxLCooked.Skeleton, Cooked
txOutByRefCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
txOutByRefLedgerCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
txOutByRefSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
txOutV2FromLedgerCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
TxSkel 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
txSkelInputDataCooked.MockChain.Balancing, Cooked.MockChain, Cooked
txSkelInsCooked.Skeleton, Cooked
txSkelInsLCooked.Skeleton, Cooked
txSkelInsReferenceCooked.Skeleton, Cooked
txSkelInsReferenceLCooked.Skeleton, Cooked
txSkelLabelCooked.Skeleton, Cooked
txSkelLabelLCooked.Skeleton, Cooked
TxSkelMintsCooked.Skeleton, Cooked
txSkelMintsCooked.Skeleton, Cooked
txSkelMintsFromListCooked.Skeleton, Cooked
txSkelMintsLCooked.Skeleton, Cooked
txSkelMintsToListCooked.Skeleton, Cooked
txSkelMintsValueCooked.Skeleton, Cooked
TxSkelNoRedeemerForPKCooked.Skeleton, Cooked
txSkelOptsCooked.Skeleton, Cooked
txSkelOptsLCooked.Skeleton, Cooked
TxSkelOutCooked.Skeleton, Cooked
TxSkelOutDatum 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
TxSkelOutDatumConstrsCooked.Skeleton, Cooked
TxSkelOutDatumHashCooked.Skeleton, Cooked
txSkelOutDatumLCooked.Skeleton, Cooked
TxSkelOutInlineDatumCooked.Skeleton, Cooked
TxSkelOutNoDatumCooked.Skeleton, Cooked
txSkelOutOwnerTypePCooked.Skeleton, Cooked
txSkelOutputDataCooked.Skeleton, Cooked
txSkelOutputDatumTypeATCooked.Skeleton, Cooked
txSkelOutputValueCooked.Skeleton, Cooked
txSkelOutReferenceScriptsCooked.Skeleton, Cooked
txSkelOutsCooked.Skeleton, Cooked
txSkelOutsLCooked.Skeleton, Cooked
txSkelOutToCardanoTxOutCooked.MockChain.GenerateTx
txSkelOutTypedDatumCooked.Skeleton, Cooked
txSkelOutUntypedDatumCooked.Skeleton, Cooked
txSkelOutValidatorCooked.Skeleton, Cooked
txSkelOutValidatorsCooked.Skeleton, Cooked
txSkelOutValueCooked.Skeleton, Cooked
txSkelOutValueLCooked.Skeleton, Cooked
TxSkelRedeemerCooked.Skeleton, Cooked
TxSkelRedeemerForReferencedScriptCooked.Skeleton, Cooked
TxSkelRedeemerForScriptCooked.Skeleton, Cooked
txSkelSignersCooked.Skeleton, Cooked
txSkelSignersLCooked.Skeleton, Cooked
txSkelTemplateCooked.Skeleton, Cooked
txSkelTypedRedeemerCooked.Skeleton, Cooked
txSkelValidityRangeCooked.Skeleton, Cooked
txSkelValidityRangeLCooked.Skeleton, Cooked
typedDatumFromTxOutRefCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
typedValidatorFromBSCooked.RawUPLC, Cooked
typedValidatorFromUPLCCooked.RawUPLC, Cooked
unInitialDistributionCooked.Wallet, Cooked
unMockChainCooked.MockChain.Direct, Cooked.MockChain, Cooked
unMockChainLogCooked.MockChain.Staged, Cooked.MockChain, Cooked
unsafeTypedValidatorFromBSCooked.RawUPLC, Cooked
unsafeTypedValidatorFromUPLCCooked.RawUPLC, Cooked
UntypedTweak 
1 (Type/Class)Cooked.Tweak.Common
2 (Data Constructor)Cooked.Tweak.Common
utxoIndex0Cooked.MockChain.Direct, Cooked.MockChain, Cooked
utxoIndex0FromCooked.MockChain.Direct, Cooked.MockChain, Cooked
UtxoPayload 
1 (Type/Class)Cooked.MockChain.UtxoState
2 (Data Constructor)Cooked.MockChain.UtxoState
utxoPayloadReferenceScriptCooked.MockChain.UtxoState, Cooked.MockChain, Cooked
UtxoPayloadSet 
1 (Type/Class)Cooked.MockChain.UtxoState
2 (Data Constructor)Cooked.MockChain.UtxoState
utxoPayloadSetCooked.MockChain.UtxoState, Cooked.MockChain, Cooked
utxoPayloadSkelOutDatumCooked.MockChain.UtxoState, Cooked.MockChain, Cooked
utxoPayloadTxOutRefCooked.MockChain.UtxoState, Cooked.MockChain, Cooked
utxoPayloadValueCooked.MockChain.UtxoState, Cooked.MockChain, Cooked
utxosAtCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
utxosAtLedgerCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
utxosAtLedgerSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
utxosAtSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
utxosFromCardanoTxCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
utxosFromCardanoTxSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
UtxoState 
1 (Type/Class)Cooked.MockChain.UtxoState, Cooked.MockChain, Cooked
2 (Data Constructor)Cooked.MockChain.UtxoState
utxoStateCooked.MockChain.UtxoState
utxoState0Cooked.MockChain.Direct, Cooked.MockChain, Cooked
validateTxSkelCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
validatorFromHashCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
validityRangeSatisfiesTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
valueFromTxOutRefCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
ValueTypeCooked.Output, Cooked, Cooked
viewAllTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
viewTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
waitNSlotsCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
waitUntilValidTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
WalletCooked.Wallet, Cooked
walletCooked.Wallet, Cooked
walletAddressCooked.Wallet, Cooked
walletPKCooked.Wallet, Cooked
walletPKHashCooked.Wallet, Cooked
walletPKHashToIdCooked.Wallet, Cooked
walletSKCooked.Wallet, Cooked
walletStakingPKCooked.Wallet, Cooked
walletStakingPKHashCooked.Wallet, Cooked
walletStakingSKCooked.Wallet, Cooked
withDatumCooked.Skeleton, Cooked
withDatumHashCooked.Skeleton, Cooked
withInlineDatumCooked.Skeleton, Cooked
withReferenceScriptCooked.Skeleton, Cooked
withStakingCredentialCooked.Skeleton, Cooked
withTweakCooked.MockChain.Staged, Cooked.MockChain, Cooked
\ No newline at end of file +cooked-validators-2.0.0 (Index)
cooked-validators-2.0.0

Index

.&&.Cooked.MockChain.Testing, Cooked.MockChain, Cooked
.==.Cooked.MockChain.Testing, Cooked.MockChain, Cooked
.||.Cooked.MockChain.Testing, Cooked.MockChain, Cooked
adaLCooked.ValueUtils, Cooked
addFirstSignerTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
addInputTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
addLabelTweakCooked.Tweak.Labels, Cooked.Tweak, Cooked
addLastSignerTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
addMintTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
addOutputTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
addSignersTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
addTokenAttackCooked.Attack.AddToken, Cooked.Attack, Cooked
AddTokenLbl 
1 (Type/Class)Cooked.Attack.AddToken, Cooked.Attack, Cooked
2 (Data Constructor)Cooked.Attack.AddToken, Cooked.Attack, Cooked
addToTxSkelMintsCooked.Skeleton, Cooked
AdjustExistingOutputCooked.Skeleton, Cooked
allOutPermutsTweakCooked.Tweak.OutPermutations, Cooked.Tweak, Cooked
allUtxosCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
allUtxosLedgerCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
allUtxosLedgerSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
allUtxosSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
applyEmulatorParamsModificationCooked.Skeleton, Cooked
applyRawModOnBalancedTxCooked.Skeleton, Cooked
app_precCooked.ShowBS, Cooked
assertionToMaybeCooked.MockChain.Testing, Cooked.MockChain, Cooked
AsTrans 
1 (Type/Class)Cooked.MockChain.BlockChain, Cooked.MockChain, Cooked
2 (Data Constructor)Cooked.MockChain.BlockChain, Cooked.MockChain, Cooked
awaitEnclosingSlotCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
awaitSlotCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
balancedTxCooked.MockChain.Balancing, Cooked.MockChain, Cooked
balancedTxSkelCooked.MockChain.Balancing, Cooked.MockChain, Cooked
BalanceOutputPolicyCooked.Skeleton, Cooked
BalanceWithCooked.Skeleton, Cooked
BalanceWithFirstSignerCooked.Skeleton, Cooked
BalancingUtxosCooked.Skeleton, Cooked
BalancingUtxosAllCooked.Skeleton, Cooked
BalancingUtxosAllowlistCooked.Skeleton, Cooked
BalancingUtxosBlocklistCooked.Skeleton, Cooked
BalancingUtxosDatumlessCooked.Skeleton, Cooked
BalancingWalletCooked.Skeleton, Cooked
BuiltinCooked.Ltl
centerAroundValidityRangeTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
combineMockChainTCooked.MockChain.Direct, Cooked.MockChain, Cooked
combineModsTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
ConcreteOutput 
1 (Type/Class)Cooked.Output, Cooked
2 (Data Constructor)Cooked.Output, Cooked
currentSlotCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
currentTimeCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
datumFromHashCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
datumFromTxOutRefCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
datumHijackingAttackCooked.Attack.DatumHijacking, Cooked.Attack, Cooked
DatumHijackingLbl 
1 (Type/Class)Cooked.Attack.DatumHijacking, Cooked.Attack, Cooked
2 (Data Constructor)Cooked.Attack.DatumHijacking, Cooked.Attack, Cooked
datumHijackingTargetCooked.Attack.DatumHijacking, Cooked.Attack, Cooked
DatumTypeCooked.Output, Cooked, Cooked
distinctPermutationsCooked.Tweak.OutPermutations
DocCookedCooked.Pretty.Common, Cooked.Pretty, Cooked
doNothingTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
DontAdjustExistingOutputCooked.Skeleton, Cooked
doubleSatAttackCooked.Attack.DoubleSat, Cooked.Attack, Cooked
DoubleSatDeltaCooked.Attack.DoubleSat, Cooked.Attack, Cooked
DoubleSatLbl 
1 (Type/Class)Cooked.Attack.DoubleSat, Cooked.Attack, Cooked
2 (Data Constructor)Cooked.Attack.DoubleSat, Cooked.Attack, Cooked
dupTokenAttackCooked.Attack.DupToken, Cooked.Attack, Cooked
DupTokenLbl 
1 (Type/Class)Cooked.Attack.DupToken, Cooked.Attack, Cooked
2 (Data Constructor)Cooked.Attack.DupToken, Cooked.Attack, Cooked
EmulatorParamsModification 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
ensureInputTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
ensureOutputTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
everywhereCooked.MockChain.Staged, Cooked.MockChain, Cooked
failingTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
FailWithCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
Fee 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
feeLovelaceCooked.Skeleton, Cooked
filterWithCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
filterWithOpticCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
filterWithPredCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
filterWithPureCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
flattenValueICooked.ValueUtils, Cooked
forAllCooked.MockChain.Testing, Cooked.MockChain, Cooked
generateTxCooked.MockChain.GenerateTx
generateTxBodyContentCooked.MockChain.GenerateTx
GenerateTxErrorCooked.MockChain.GenerateTx
GenerateTxErrorGeneralCooked.MockChain.GenerateTx
GenTxParamsCooked.MockChain.GenerateTx
getEnclosingSlotCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
getIndexCooked.MockChain.Direct, Cooked.MockChain, Cooked
getParamsCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
getSignersTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
getTransCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
getTxSkelCooked.Tweak.Common, Cooked.Tweak, Cooked
getValidityRangeTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
gtpCollateralInsCooked.MockChain.GenerateTx
gtpFeeCooked.MockChain.GenerateTx
hasEmptyTimeRangeTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
hasFullTimeRangeTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
hasLabelTweakCooked.Tweak.Labels, Cooked.Tweak, Cooked
hasSignersTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
holdsInStateCooked.MockChain.UtxoState, Cooked.MockChain, Cooked
InitialDistribution 
1 (Type/Class)Cooked.Wallet, Cooked
2 (Data Constructor)Cooked.Wallet, Cooked
initialDistributionCooked.Wallet, Cooked
InstrCooked.Ltl
interpBuiltinCooked.Ltl
InterpLtlCooked.Ltl
interpLtlCooked.Ltl
interpLtlAndPruneUnfinishedCooked.Ltl
interpretAndRunCooked.MockChain.Staged, Cooked.MockChain, Cooked
interpretAndRunWithCooked.MockChain.Staged, Cooked.MockChain, Cooked
intersectValidityRangeTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
IsAbstractOutputCooked.Output, Cooked
isCekEvaluationFailureCooked.MockChain.Testing, Cooked.MockChain, Cooked
isCekEvaluationFailureWithMsgCooked.MockChain.Testing, Cooked.MockChain, Cooked
isOnlyAdaOutputCooked.Output, Cooked
isOutputWithDatumHashCooked.Output, Cooked
isOutputWithInlineDatumCooked.Output, Cooked
isOutputWithInlineDatumOfTypeCooked.Output, Cooked
isOutputWithoutDatumCooked.Output, Cooked
isPKOutputFromCooked.Output, Cooked
IsPropCooked.MockChain.Testing, Cooked.MockChain, Cooked
isScriptOutputFromCooked.Output, Cooked
isSignerTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
IsTxInfoOutputCooked.Output, Cooked
isValidAtTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
isValidDuringTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
isValidNowTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
iviewTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
KeepIdentityCooked.Tweak.OutPermutations, Cooked.Tweak, Cooked
knownWalletsCooked.Wallet, Cooked
LabelConstrsCooked.Skeleton, Cooked
LtlCooked.Ltl, Cooked
LtlAndCooked.Ltl, Cooked
LtlAtomCooked.Ltl, Cooked
LtlFalsityCooked.Ltl, Cooked
LtlNextCooked.Ltl, Cooked
LtlOpCooked.Ltl
LtlOrCooked.Ltl, Cooked
LtlReleaseCooked.Ltl, Cooked
LtlTruthCooked.Ltl, Cooked
LtlUntilCooked.Ltl, Cooked
makeValidityRangeNowTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
makeValidityRangeSingletonTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
MalformDatumLbl 
1 (Type/Class)Cooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
2 (Data Constructor)Cooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
malformDatumTweakCooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
mapMockChainTCooked.MockChain.Direct, Cooked.MockChain, Cooked
MCECalcFeeCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEGenerationErrorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCENoSuitableCollateralCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
mceParamsCooked.MockChain.Direct, Cooked.MockChain, Cooked
MCEUnbalanceableCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEUnbalanceableErrorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEUnbalNotEnoughFundsCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEUnbalNotEnoughReturningCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEUnknownDatumCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEUnknownOutRefErrorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEUnknownValidatorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCEValidationErrorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MCLogFailCooked.MockChain.Staged, Cooked.MockChain, Cooked
MCLogNewTxCooked.MockChain.Staged, Cooked.MockChain, Cooked
MCLogSubmittedTxSkelCooked.MockChain.Staged, Cooked.MockChain, Cooked
mcstCurrentSlotCooked.MockChain.Direct, Cooked.MockChain, Cooked
mcstDatumsCooked.MockChain.Direct, Cooked.MockChain, Cooked
mcstIndexCooked.MockChain.Direct, Cooked.MockChain, Cooked
mcstToUtxoStateCooked.MockChain.Direct, Cooked.MockChain, Cooked
mcstValidatorsCooked.MockChain.Direct, Cooked.MockChain, Cooked
MintsConstrsCooked.Skeleton, Cooked
MintsRedeemerCooked.Skeleton, Cooked
MockChainCooked.MockChain.Direct, Cooked.MockChain, Cooked
MockChainEnv 
1 (Type/Class)Cooked.MockChain.Direct, Cooked.MockChain, Cooked
2 (Data Constructor)Cooked.MockChain.Direct, Cooked.MockChain, Cooked
MockChainErrorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MockChainLog 
1 (Type/Class)Cooked.MockChain.Staged
2 (Data Constructor)Cooked.MockChain.Staged
MockChainLogEntryCooked.MockChain.Staged
MockChainSt 
1 (Type/Class)Cooked.MockChain.Direct, Cooked.MockChain, Cooked
2 (Data Constructor)Cooked.MockChain.Direct, Cooked.MockChain, Cooked
mockChainSt0Cooked.MockChain.Direct, Cooked.MockChain, Cooked
mockChainSt0FromCooked.MockChain.Direct, Cooked.MockChain, Cooked
MockChainT 
1 (Type/Class)Cooked.MockChain.Direct, Cooked.MockChain, Cooked
2 (Data Constructor)Cooked.MockChain.Direct, Cooked.MockChain, Cooked
ModificationCooked.Ltl, Cooked
modifyLtlCooked.Ltl, Cooked
modifySignersTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
MonadBlockChainCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MonadBlockChainBalancingCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MonadBlockChainWithoutValidationCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
MonadModalCooked.Ltl, Cooked
MonadModalBlockChainCooked.MockChain.Staged, Cooked.MockChain, Cooked
MonadTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
mPrettyTxOptsCooked.Pretty.Cooked, Cooked.Pretty, Cooked
negativePartCooked.ValueUtils, Cooked
NoMintsRedeemerCooked.Skeleton, Cooked
nowLaterCooked.Ltl
nowLaterListCooked.Ltl
OmitIdentityCooked.Tweak.OutPermutations, Cooked.Tweak, Cooked
OtherMockChainErrorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
outputAddressCooked.Output, Cooked
outputDatumFromTxOutRefCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
outputDatumLCooked.Output, Cooked
outputOutputDatumCooked.Output, Cooked
outputOwnerLCooked.Output, Cooked
outputReferenceScriptHashCooked.Output, Cooked
outputReferenceScriptLCooked.Output, Cooked
outputStakingCredentialLCooked.Output, Cooked
outputTxOutCooked.Output, Cooked
outputValueCooked.Output, Cooked
outputValueLCooked.Output, Cooked
overMaybeSelectingTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
overMaybeTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
overTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
OwnerTypeCooked.Output, Cooked, Cooked
PaysCooked.Skeleton, Cooked
paysPKCooked.Skeleton, Cooked
paysScriptCooked.Skeleton, Cooked
paysScriptDatumHashCooked.Skeleton, Cooked
paysScriptInlineDatumCooked.Skeleton, Cooked
paysScriptNoDatumCooked.Skeleton, Cooked
pcOptNumericUnderscoresCooked.Pretty.Options, Cooked.Pretty, Cooked
pcOptPrintDefaultTxOptsCooked.Pretty.Options, Cooked.Pretty, Cooked
pcOptPrintedHashLengthCooked.Pretty.Options, Cooked.Pretty, Cooked
pcOptPrintTxHashesCooked.Pretty.Options, Cooked.Pretty, Cooked
pcOptPrintTxOutRefsCooked.Pretty.Options, Cooked.Pretty, Cooked
PCOptTxOutRefsCooked.Pretty.Options, Cooked.Pretty, Cooked
PCOptTxOutRefsFullCooked.Pretty.Options, Cooked.Pretty, Cooked
PCOptTxOutRefsHiddenCooked.Pretty.Options, Cooked.Pretty, Cooked
PCOptTxOutRefsPartialCooked.Pretty.Options, Cooked.Pretty, Cooked
permanentAssetClassCooked.Currencies, Cooked
permanentCurrencyPolicyCooked.Currencies, Cooked
permanentCurrencySymbolCooked.Currencies, Cooked
permanentTokenNameCooked.Currencies, Cooked
permanentValueCooked.Currencies, Cooked
PermutOutTweakModeCooked.Tweak.OutPermutations, Cooked.Tweak, Cooked
positivePartCooked.ValueUtils, Cooked
prettyAddressStateCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyBalancingWalletCooked.Pretty.Cooked, Cooked.Pretty, Cooked
PrettyCookedCooked.Pretty.Class, Cooked.Pretty, Cooked
prettyCookedCooked.Pretty.Class, Cooked.Pretty, Cooked
prettyCookedOptCooked.Pretty.Class, Cooked.Pretty, Cooked
PrettyCookedOpts 
1 (Type/Class)Cooked.Pretty.Options, Cooked.Pretty, Cooked
2 (Data Constructor)Cooked.Pretty.Options, Cooked.Pretty, Cooked
prettyEnumerateCooked.Pretty.Common, Cooked.Pretty, Cooked
prettyHashCooked.Pretty.Common, Cooked.Pretty, Cooked
prettyItemizeCooked.Pretty.Common, Cooked.Pretty, Cooked
prettyItemizeNonEmptyCooked.Pretty.Common, Cooked.Pretty, Cooked
prettyItemizeNoTitleCooked.Pretty.Common, Cooked.Pretty, Cooked
prettyMintsCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyPayloadCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyPayloadGroupedCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyReferenceScriptHashCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettySignersCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyTxSkelCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyTxSkelInCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyTxSkelInReferenceCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyTxSkelOutCooked.Pretty.Cooked, Cooked.Pretty, Cooked
prettyTxSkelOutDatumMaybeCooked.Pretty.Cooked, Cooked.Pretty, Cooked
printCookedCooked.Pretty.Class, Cooked.Pretty, Cooked
printCookedOptCooked.Pretty.Class, Cooked.Pretty, Cooked
PrivateKeyCooked.Wallet, Cooked
producedOutputCooked.Skeleton, Cooked
putTxSkelCooked.Tweak.Common, Cooked.Tweak, Cooked
quickAssetClassCooked.Currencies, Cooked
quickCurrencyPolicyCooked.Currencies, Cooked
quickCurrencySymbolCooked.Currencies, Cooked
quickTokenNameCooked.Currencies, Cooked
quickValueCooked.Currencies, Cooked
RawModTxCooked.Skeleton, Cooked
RawModTxAfterBalancingCooked.Skeleton, Cooked
redirectScriptOutputTweakCooked.Attack.DatumHijacking, Cooked.Attack, Cooked
ReferenceScriptTypeCooked.Output, Cooked, Cooked
removeInputTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
removeLabelTweakCooked.Tweak.Labels, Cooked.Tweak, Cooked
removeMintTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
removeOutputTweakCooked.Tweak.AddInputsAndOutputs, Cooked.Tweak, Cooked
removeSignersTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
removeSignerTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
renderStringCooked.Pretty.Common, Cooked.Pretty, Cooked
replaceFirstSignerTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
resolveDatumCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
resolveReferenceScriptCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
resolveTypedDatumCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
resolveValidatorCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
ReturnCooked.Ltl
runMockChainCooked.MockChain.Direct, Cooked.MockChain, Cooked
runMockChainFromCooked.MockChain.Direct, Cooked.MockChain, Cooked
runMockChainRawCooked.MockChain.Direct, Cooked.MockChain, Cooked
runMockChainTCooked.MockChain.Direct, Cooked.MockChain, Cooked
runMockChainTFromCooked.MockChain.Direct, Cooked.MockChain, Cooked
runMockChainTRawCooked.MockChain.Direct, Cooked.MockChain, Cooked
runTransactionValidationCooked.MockChain.Direct, Cooked.MockChain, Cooked
runTweakCooked.MockChain.Staged, Cooked.MockChain, Cooked
runTweakFromCooked.MockChain.Staged, Cooked.MockChain, Cooked
runTweakInChainCooked.Tweak.Common
runTweakInChain'Cooked.Tweak.Common
runUtxoSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
selectPCooked.Tweak.Common, Cooked.Tweak, Cooked
setAlwaysValidRangeTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
setSignersTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
setTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
setValidityRangeTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
ShowBSCooked.ShowBS, Cooked
showBSCooked.ShowBS, Cooked
showBSsCooked.ShowBS, Cooked
showBSsPrecCooked.ShowBS, Cooked
signersSatisfyTweakCooked.Tweak.Signers, Cooked.Tweak, Cooked
singleOutPermutTweakCooked.Tweak.OutPermutations, Cooked.Tweak, Cooked
SkelContext 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
skelContextTxOutsCooked.Skeleton, Cooked
skelContextTxSkelOutDatumsCooked.Skeleton, Cooked
slotRangeAfterCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
slotRangeBeforeCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
slotToTimeIntervalCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
SomeMintsRedeemerCooked.Skeleton, Cooked
somewhereCooked.MockChain.Staged, Cooked.MockChain, Cooked
StagedCooked.Ltl
StagedMockChainCooked.MockChain.Staged
StartLtlCooked.Ltl
StopLtlCooked.Ltl
TamperDatumLbl 
1 (Type/Class)Cooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
2 (Data Constructor)Cooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
tamperDatumTweakCooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
testAllCooked.MockChain.Testing, Cooked.MockChain, Cooked
testAllSatisfiesFromCooked.MockChain.Testing, Cooked.MockChain, Cooked
testBinaryRelatedByCooked.MockChain.Testing, Cooked.MockChain, Cooked
testBoolCooked.MockChain.Testing, Cooked.MockChain, Cooked
testConjoinCooked.MockChain.Testing, Cooked.MockChain, Cooked
testCounterexampleCooked.MockChain.Testing, Cooked.MockChain, Cooked
testDisjoinCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailsCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailsFromCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailureCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailureMsgCooked.MockChain.Testing, Cooked.MockChain, Cooked
testOneEquivClassCooked.MockChain.Testing, Cooked.MockChain, Cooked
testSatisfiesFrom'Cooked.MockChain.Testing, Cooked.MockChain, Cooked
testSucceedsCooked.MockChain.Testing, Cooked.MockChain, Cooked
testSucceedsFromCooked.MockChain.Testing, Cooked.MockChain, Cooked
testSucceedsFrom'Cooked.MockChain.Testing, Cooked.MockChain, Cooked
testSuccessCooked.MockChain.Testing, Cooked.MockChain, Cooked
thereCooked.MockChain.Staged, Cooked.MockChain, Cooked
ToCardanoErrorCooked.MockChain.GenerateTx
ToCredentialCooked.Output, Cooked
toCredentialCooked.Output, Cooked
ToOutputDatumCooked.Output, Cooked
toOutputDatumCooked.Output, Cooked
toOutputWithReferenceScriptHashCooked.Output, Cooked
ToScriptCooked.Output, Cooked
toScriptCooked.Output, Cooked
ToScriptHashCooked.Output, Cooked
toScriptHashCooked.Output, Cooked
ToValueCooked.Output, Cooked
toValueCooked.Output, Cooked
TweakCooked.Tweak.Common
TxBodyErrorCooked.MockChain.GenerateTx
TxLabel 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
txOptAutoSlotIncreaseCooked.Skeleton, Cooked
txOptAutoSlotIncreaseLCooked.Skeleton, Cooked
txOptAwaitTxConfirmedCooked.Skeleton, Cooked
txOptAwaitTxConfirmedLCooked.Skeleton, Cooked
txOptBalanceCooked.Skeleton, Cooked
txOptBalanceLCooked.Skeleton, Cooked
txOptBalanceOutputPolicyCooked.Skeleton, Cooked
txOptBalanceOutputPolicyLCooked.Skeleton, Cooked
txOptBalanceWalletCooked.Skeleton, Cooked
txOptBalanceWalletLCooked.Skeleton, Cooked
txOptBalancingUtxosCooked.Skeleton, Cooked
txOptBalancingUtxosLCooked.Skeleton, Cooked
txOptEmulatorParamsModificationCooked.Skeleton, Cooked
txOptEmulatorParamsModificationLCooked.Skeleton, Cooked
txOptEnsureMinAdaCooked.Skeleton, Cooked
txOptEnsureMinAdaLCooked.Skeleton, Cooked
TxOpts 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
txOptUnsafeModTxCooked.Skeleton, Cooked
txOptUnsafeModTxLCooked.Skeleton, Cooked
txOutByRefCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
txOutByRefLedgerCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
txOutByRefSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
txOutV2FromLedgerCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
TxSkel 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
txSkelInputDataCooked.MockChain.Balancing, Cooked.MockChain, Cooked
txSkelInsCooked.Skeleton, Cooked
txSkelInsLCooked.Skeleton, Cooked
txSkelInsReferenceCooked.Skeleton, Cooked
txSkelInsReferenceLCooked.Skeleton, Cooked
txSkelLabelCooked.Skeleton, Cooked
txSkelLabelLCooked.Skeleton, Cooked
TxSkelMintsCooked.Skeleton, Cooked
txSkelMintsCooked.Skeleton, Cooked
txSkelMintsFromListCooked.Skeleton, Cooked
txSkelMintsLCooked.Skeleton, Cooked
txSkelMintsToListCooked.Skeleton, Cooked
txSkelMintsValueCooked.Skeleton, Cooked
TxSkelNoRedeemerForPKCooked.Skeleton, Cooked
txSkelOptsCooked.Skeleton, Cooked
txSkelOptsLCooked.Skeleton, Cooked
TxSkelOutCooked.Skeleton, Cooked
TxSkelOutDatum 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
TxSkelOutDatumConstrsCooked.Skeleton, Cooked
TxSkelOutDatumHashCooked.Skeleton, Cooked
txSkelOutDatumLCooked.Skeleton, Cooked
TxSkelOutInlineDatumCooked.Skeleton, Cooked
TxSkelOutNoDatumCooked.Skeleton, Cooked
txSkelOutOwnerTypePCooked.Skeleton, Cooked
txSkelOutputDataCooked.Skeleton, Cooked
txSkelOutputDatumTypeATCooked.Skeleton, Cooked
txSkelOutputValueCooked.Skeleton, Cooked
txSkelOutReferenceScriptsCooked.Skeleton, Cooked
txSkelOutsCooked.Skeleton, Cooked
txSkelOutsLCooked.Skeleton, Cooked
txSkelOutToCardanoTxOutCooked.MockChain.GenerateTx
txSkelOutTypedDatumCooked.Skeleton, Cooked
txSkelOutUntypedDatumCooked.Skeleton, Cooked
txSkelOutValidatorCooked.Skeleton, Cooked
txSkelOutValidatorsCooked.Skeleton, Cooked
txSkelOutValueCooked.Skeleton, Cooked
txSkelOutValueLCooked.Skeleton, Cooked
TxSkelRedeemerCooked.Skeleton, Cooked
TxSkelRedeemerForReferencedScriptCooked.Skeleton, Cooked
TxSkelRedeemerForScriptCooked.Skeleton, Cooked
txSkelSignersCooked.Skeleton, Cooked
txSkelSignersLCooked.Skeleton, Cooked
txSkelTemplateCooked.Skeleton, Cooked
txSkelTypedRedeemerCooked.Skeleton, Cooked
txSkelValidityRangeCooked.Skeleton, Cooked
txSkelValidityRangeLCooked.Skeleton, Cooked
typedDatumFromTxOutRefCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
typedValidatorFromBSCooked.RawUPLC, Cooked
typedValidatorFromUPLCCooked.RawUPLC, Cooked
unInitialDistributionCooked.Wallet, Cooked
unMockChainCooked.MockChain.Direct, Cooked.MockChain, Cooked
unMockChainLogCooked.MockChain.Staged, Cooked.MockChain, Cooked
unsafeTypedValidatorFromBSCooked.RawUPLC, Cooked
unsafeTypedValidatorFromUPLCCooked.RawUPLC, Cooked
UntypedTweak 
1 (Type/Class)Cooked.Tweak.Common
2 (Data Constructor)Cooked.Tweak.Common
utxoIndex0Cooked.MockChain.Direct, Cooked.MockChain, Cooked
utxoIndex0FromCooked.MockChain.Direct, Cooked.MockChain, Cooked
UtxoPayload 
1 (Type/Class)Cooked.MockChain.UtxoState
2 (Data Constructor)Cooked.MockChain.UtxoState
utxoPayloadReferenceScriptCooked.MockChain.UtxoState, Cooked.MockChain, Cooked
UtxoPayloadSet 
1 (Type/Class)Cooked.MockChain.UtxoState
2 (Data Constructor)Cooked.MockChain.UtxoState
utxoPayloadSetCooked.MockChain.UtxoState, Cooked.MockChain, Cooked
utxoPayloadSkelOutDatumCooked.MockChain.UtxoState, Cooked.MockChain, Cooked
utxoPayloadTxOutRefCooked.MockChain.UtxoState, Cooked.MockChain, Cooked
utxoPayloadValueCooked.MockChain.UtxoState, Cooked.MockChain, Cooked
utxosAtCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
utxosAtLedgerCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
utxosAtLedgerSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
utxosAtSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
utxosFromCardanoTxCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
utxosFromCardanoTxSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
UtxoState 
1 (Type/Class)Cooked.MockChain.UtxoState, Cooked.MockChain, Cooked
2 (Data Constructor)Cooked.MockChain.UtxoState
utxoStateCooked.MockChain.UtxoState
utxoState0Cooked.MockChain.Direct, Cooked.MockChain, Cooked
validateTxSkelCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
validatorFromHashCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
validityRangeSatisfiesTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
valueFromTxOutRefCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
ValueTypeCooked.Output, Cooked, Cooked
viewAllTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
viewTweakCooked.Tweak.Common, Cooked.Tweak, Cooked
waitNSlotsCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
waitUntilValidTweakCooked.Tweak.ValidityRange, Cooked.Tweak, Cooked
WalletCooked.Wallet, Cooked
walletCooked.Wallet, Cooked
walletAddressCooked.Wallet, Cooked
walletPKCooked.Wallet, Cooked
walletPKHashCooked.Wallet, Cooked
walletPKHashToIdCooked.Wallet, Cooked
walletSKCooked.Wallet, Cooked
walletStakingPKCooked.Wallet, Cooked
walletStakingPKHashCooked.Wallet, Cooked
walletStakingSKCooked.Wallet, Cooked
withDatumCooked.Skeleton, Cooked
withDatumHashCooked.Skeleton, Cooked
withInlineDatumCooked.Skeleton, Cooked
withReferenceScriptCooked.Skeleton, Cooked
withStakingCredentialCooked.Skeleton, Cooked
withTweakCooked.MockChain.Staged, Cooked.MockChain, Cooked
\ No newline at end of file diff --git a/doc-index-T.html b/doc-index-T.html index 12ee51e22..60886f03c 100644 --- a/doc-index-T.html +++ b/doc-index-T.html @@ -1 +1 @@ -cooked-validators-2.0.0 (Index - T)
cooked-validators-2.0.0

Index - T

TamperDatumLbl 
1 (Type/Class)Cooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
2 (Data Constructor)Cooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
tamperDatumTweakCooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
testAllCooked.MockChain.Testing, Cooked.MockChain, Cooked
testAllSatisfiesFromCooked.MockChain.Testing, Cooked.MockChain, Cooked
testBinaryRelatedByCooked.MockChain.Testing, Cooked.MockChain, Cooked
testBoolCooked.MockChain.Testing, Cooked.MockChain, Cooked
testConjoinCooked.MockChain.Testing, Cooked.MockChain, Cooked
testCounterexampleCooked.MockChain.Testing, Cooked.MockChain, Cooked
testDisjoinCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailsCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailsFromCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailureCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailureMsgCooked.MockChain.Testing, Cooked.MockChain, Cooked
testOneEquivClassCooked.MockChain.Testing, Cooked.MockChain, Cooked
testSatisfiesFrom'Cooked.MockChain.Testing, Cooked.MockChain, Cooked
testSucceedsCooked.MockChain.Testing, Cooked.MockChain, Cooked
testSucceedsFromCooked.MockChain.Testing, Cooked.MockChain, Cooked
testSucceedsFrom'Cooked.MockChain.Testing, Cooked.MockChain, Cooked
testSuccessCooked.MockChain.Testing, Cooked.MockChain, Cooked
ToCardanoErrorCooked.MockChain.GenerateTx
ToCredentialCooked.Output, Cooked
toCredentialCooked.Output, Cooked
ToOutputDatumCooked.Output, Cooked
toOutputDatumCooked.Output, Cooked
toOutputWithReferenceScriptHashCooked.Output, Cooked
ToScriptCooked.Output, Cooked
toScriptCooked.Output, Cooked
ToScriptHashCooked.Output, Cooked
toScriptHashCooked.Output, Cooked
ToValueCooked.Output, Cooked
toValueCooked.Output, Cooked
TweakCooked.Tweak.Common
TxBodyErrorCooked.MockChain.GenerateTx
TxLabel 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
txOptAutoSlotIncreaseCooked.Skeleton, Cooked
txOptAutoSlotIncreaseLCooked.Skeleton, Cooked
txOptAwaitTxConfirmedCooked.Skeleton, Cooked
txOptAwaitTxConfirmedLCooked.Skeleton, Cooked
txOptBalanceCooked.Skeleton, Cooked
txOptBalanceLCooked.Skeleton, Cooked
txOptBalanceOutputPolicyCooked.Skeleton, Cooked
txOptBalanceOutputPolicyLCooked.Skeleton, Cooked
txOptBalanceWalletCooked.Skeleton, Cooked
txOptBalanceWalletLCooked.Skeleton, Cooked
txOptBalancingUtxosCooked.Skeleton, Cooked
txOptBalancingUtxosLCooked.Skeleton, Cooked
txOptEmulatorParamsModificationCooked.Skeleton, Cooked
txOptEmulatorParamsModificationLCooked.Skeleton, Cooked
txOptEnsureMinAdaCooked.Skeleton, Cooked
txOptEnsureMinAdaLCooked.Skeleton, Cooked
TxOpts 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
txOptUnsafeModTxCooked.Skeleton, Cooked
txOptUnsafeModTxLCooked.Skeleton, Cooked
txOutByRefCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
txOutByRefLedgerCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
txOutByRefSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
txOutV2FromLedgerCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
TxSkel 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
txSkelInputDataCooked.MockChain.Balancing, Cooked.MockChain, Cooked
txSkelInsCooked.Skeleton, Cooked
txSkelInsLCooked.Skeleton, Cooked
txSkelInsReferenceCooked.Skeleton, Cooked
txSkelInsReferenceLCooked.Skeleton, Cooked
txSkelLabelCooked.Skeleton, Cooked
txSkelLabelLCooked.Skeleton, Cooked
TxSkelMintsCooked.Skeleton, Cooked
txSkelMintsCooked.Skeleton, Cooked
txSkelMintsFromListCooked.Skeleton, Cooked
txSkelMintsLCooked.Skeleton, Cooked
txSkelMintsToListCooked.Skeleton, Cooked
txSkelMintsValueCooked.Skeleton, Cooked
TxSkelNoRedeemerForPKCooked.Skeleton, Cooked
txSkelOptsCooked.Skeleton, Cooked
txSkelOptsLCooked.Skeleton, Cooked
TxSkelOutCooked.Skeleton, Cooked
TxSkelOutDatum 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
TxSkelOutDatumConstrsCooked.Skeleton, Cooked
TxSkelOutDatumHashCooked.Skeleton, Cooked
txSkelOutDatumLCooked.Skeleton, Cooked
TxSkelOutInlineDatumCooked.Skeleton, Cooked
TxSkelOutNoDatumCooked.Skeleton, Cooked
txSkelOutOwnerTypePCooked.Skeleton, Cooked
txSkelOutputDataCooked.Skeleton, Cooked
txSkelOutputDatumTypeATCooked.Skeleton, Cooked
txSkelOutputValueCooked.Skeleton, Cooked
txSkelOutReferenceScriptsCooked.Skeleton, Cooked
txSkelOutsCooked.Skeleton, Cooked
txSkelOutsLCooked.Skeleton, Cooked
txSkelOutToCardanoTxOutCooked.MockChain.GenerateTx
txSkelOutTypedDatumCooked.Skeleton, Cooked
txSkelOutUntypedDatumCooked.Skeleton, Cooked
txSkelOutValidatorCooked.Skeleton, Cooked
txSkelOutValidatorsCooked.Skeleton, Cooked
txSkelOutValueCooked.Skeleton, Cooked
txSkelOutValueLCooked.Skeleton, Cooked
TxSkelRedeemerCooked.Skeleton, Cooked
TxSkelRedeemerForReferencedScriptCooked.Skeleton, Cooked
TxSkelRedeemerForScriptCooked.Skeleton, Cooked
txSkelSignersCooked.Skeleton, Cooked
txSkelSignersLCooked.Skeleton, Cooked
txSkelTemplateCooked.Skeleton, Cooked
txSkelTypedRedeemerCooked.Skeleton, Cooked
txSkelValidityRangeCooked.Skeleton, Cooked
txSkelValidityRangeLCooked.Skeleton, Cooked
typedDatumFromTxOutRefCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
typedValidatorFromBSCooked.RawUPLC, Cooked
typedValidatorFromUPLCCooked.RawUPLC, Cooked
\ No newline at end of file +cooked-validators-2.0.0 (Index - T)
cooked-validators-2.0.0

Index - T

TamperDatumLbl 
1 (Type/Class)Cooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
2 (Data Constructor)Cooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
tamperDatumTweakCooked.Tweak.TamperDatum, Cooked.Tweak, Cooked
testAllCooked.MockChain.Testing, Cooked.MockChain, Cooked
testAllSatisfiesFromCooked.MockChain.Testing, Cooked.MockChain, Cooked
testBinaryRelatedByCooked.MockChain.Testing, Cooked.MockChain, Cooked
testBoolCooked.MockChain.Testing, Cooked.MockChain, Cooked
testConjoinCooked.MockChain.Testing, Cooked.MockChain, Cooked
testCounterexampleCooked.MockChain.Testing, Cooked.MockChain, Cooked
testDisjoinCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailsCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailsFromCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailureCooked.MockChain.Testing, Cooked.MockChain, Cooked
testFailureMsgCooked.MockChain.Testing, Cooked.MockChain, Cooked
testOneEquivClassCooked.MockChain.Testing, Cooked.MockChain, Cooked
testSatisfiesFrom'Cooked.MockChain.Testing, Cooked.MockChain, Cooked
testSucceedsCooked.MockChain.Testing, Cooked.MockChain, Cooked
testSucceedsFromCooked.MockChain.Testing, Cooked.MockChain, Cooked
testSucceedsFrom'Cooked.MockChain.Testing, Cooked.MockChain, Cooked
testSuccessCooked.MockChain.Testing, Cooked.MockChain, Cooked
thereCooked.MockChain.Staged, Cooked.MockChain, Cooked
ToCardanoErrorCooked.MockChain.GenerateTx
ToCredentialCooked.Output, Cooked
toCredentialCooked.Output, Cooked
ToOutputDatumCooked.Output, Cooked
toOutputDatumCooked.Output, Cooked
toOutputWithReferenceScriptHashCooked.Output, Cooked
ToScriptCooked.Output, Cooked
toScriptCooked.Output, Cooked
ToScriptHashCooked.Output, Cooked
toScriptHashCooked.Output, Cooked
ToValueCooked.Output, Cooked
toValueCooked.Output, Cooked
TweakCooked.Tweak.Common
TxBodyErrorCooked.MockChain.GenerateTx
TxLabel 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
txOptAutoSlotIncreaseCooked.Skeleton, Cooked
txOptAutoSlotIncreaseLCooked.Skeleton, Cooked
txOptAwaitTxConfirmedCooked.Skeleton, Cooked
txOptAwaitTxConfirmedLCooked.Skeleton, Cooked
txOptBalanceCooked.Skeleton, Cooked
txOptBalanceLCooked.Skeleton, Cooked
txOptBalanceOutputPolicyCooked.Skeleton, Cooked
txOptBalanceOutputPolicyLCooked.Skeleton, Cooked
txOptBalanceWalletCooked.Skeleton, Cooked
txOptBalanceWalletLCooked.Skeleton, Cooked
txOptBalancingUtxosCooked.Skeleton, Cooked
txOptBalancingUtxosLCooked.Skeleton, Cooked
txOptEmulatorParamsModificationCooked.Skeleton, Cooked
txOptEmulatorParamsModificationLCooked.Skeleton, Cooked
txOptEnsureMinAdaCooked.Skeleton, Cooked
txOptEnsureMinAdaLCooked.Skeleton, Cooked
TxOpts 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
txOptUnsafeModTxCooked.Skeleton, Cooked
txOptUnsafeModTxLCooked.Skeleton, Cooked
txOutByRefCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
txOutByRefLedgerCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
txOutByRefSearchCooked.MockChain.UtxoSearch, Cooked.MockChain, Cooked
txOutV2FromLedgerCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
TxSkel 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
txSkelInputDataCooked.MockChain.Balancing, Cooked.MockChain, Cooked
txSkelInsCooked.Skeleton, Cooked
txSkelInsLCooked.Skeleton, Cooked
txSkelInsReferenceCooked.Skeleton, Cooked
txSkelInsReferenceLCooked.Skeleton, Cooked
txSkelLabelCooked.Skeleton, Cooked
txSkelLabelLCooked.Skeleton, Cooked
TxSkelMintsCooked.Skeleton, Cooked
txSkelMintsCooked.Skeleton, Cooked
txSkelMintsFromListCooked.Skeleton, Cooked
txSkelMintsLCooked.Skeleton, Cooked
txSkelMintsToListCooked.Skeleton, Cooked
txSkelMintsValueCooked.Skeleton, Cooked
TxSkelNoRedeemerForPKCooked.Skeleton, Cooked
txSkelOptsCooked.Skeleton, Cooked
txSkelOptsLCooked.Skeleton, Cooked
TxSkelOutCooked.Skeleton, Cooked
TxSkelOutDatum 
1 (Type/Class)Cooked.Skeleton, Cooked
2 (Data Constructor)Cooked.Skeleton, Cooked
TxSkelOutDatumConstrsCooked.Skeleton, Cooked
TxSkelOutDatumHashCooked.Skeleton, Cooked
txSkelOutDatumLCooked.Skeleton, Cooked
TxSkelOutInlineDatumCooked.Skeleton, Cooked
TxSkelOutNoDatumCooked.Skeleton, Cooked
txSkelOutOwnerTypePCooked.Skeleton, Cooked
txSkelOutputDataCooked.Skeleton, Cooked
txSkelOutputDatumTypeATCooked.Skeleton, Cooked
txSkelOutputValueCooked.Skeleton, Cooked
txSkelOutReferenceScriptsCooked.Skeleton, Cooked
txSkelOutsCooked.Skeleton, Cooked
txSkelOutsLCooked.Skeleton, Cooked
txSkelOutToCardanoTxOutCooked.MockChain.GenerateTx
txSkelOutTypedDatumCooked.Skeleton, Cooked
txSkelOutUntypedDatumCooked.Skeleton, Cooked
txSkelOutValidatorCooked.Skeleton, Cooked
txSkelOutValidatorsCooked.Skeleton, Cooked
txSkelOutValueCooked.Skeleton, Cooked
txSkelOutValueLCooked.Skeleton, Cooked
TxSkelRedeemerCooked.Skeleton, Cooked
TxSkelRedeemerForReferencedScriptCooked.Skeleton, Cooked
TxSkelRedeemerForScriptCooked.Skeleton, Cooked
txSkelSignersCooked.Skeleton, Cooked
txSkelSignersLCooked.Skeleton, Cooked
txSkelTemplateCooked.Skeleton, Cooked
txSkelTypedRedeemerCooked.Skeleton, Cooked
txSkelValidityRangeCooked.Skeleton, Cooked
txSkelValidityRangeLCooked.Skeleton, Cooked
typedDatumFromTxOutRefCooked.MockChain.BlockChain, Cooked.MockChain, Cooked
typedValidatorFromBSCooked.RawUPLC, Cooked
typedValidatorFromUPLCCooked.RawUPLC, Cooked
\ No newline at end of file diff --git a/doc-index.json b/doc-index.json index d463a9963..a7bb64e75 100644 --- a/doc-index.json +++ b/doc-index.json @@ -1 +1 @@ -[{"display_html":"quickTokenName :: String -> TokenName","name":"quickTokenName","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:quickTokenName"},{"display_html":"quickAssetClass :: String -> AssetClass","name":"quickAssetClass","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:quickAssetClass"},{"display_html":"quickValue :: String -> Integer -> Value","name":"quickValue","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:quickValue"},{"display_html":"permanentTokenName :: String -> TokenName","name":"permanentTokenName","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:permanentTokenName"},{"display_html":"permanentAssetClass :: String -> AssetClass","name":"permanentAssetClass","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:permanentAssetClass"},{"display_html":"permanentValue :: String -> Integer -> Value","name":"permanentValue","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:permanentValue"},{"display_html":"quickCurrencyPolicy :: MintingPolicy","name":"quickCurrencyPolicy","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:quickCurrencyPolicy"},{"display_html":"quickCurrencySymbol :: CurrencySymbol","name":"quickCurrencySymbol","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:quickCurrencySymbol"},{"display_html":"permanentCurrencyPolicy :: MintingPolicy","name":"permanentCurrencyPolicy","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:permanentCurrencyPolicy"},{"display_html":"permanentCurrencySymbol :: CurrencySymbol","name":"permanentCurrencySymbol","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:permanentCurrencySymbol"},{"display_html":"data Ltl a","name":"Ltl LtlTruth LtlFalsity LtlAtom LtlOr LtlAnd LtlNext LtlUntil LtlRelease","module":"Cooked.Ltl","link":"Cooked-Ltl.html#t:Ltl"},{"display_html":"nowLater :: Monoid a => Ltl a -> [(a, Ltl a)]","name":"nowLater","module":"Cooked.Ltl","link":"Cooked-Ltl.html#v:nowLater"},{"display_html":"nowLaterList :: Monoid a => [Ltl a] -> [(a, [Ltl a])]","name":"nowLaterList","module":"Cooked.Ltl","link":"Cooked-Ltl.html#v:nowLaterList"},{"display_html":"data LtlOp (modification :: *) (builtin :: * -> *) :: * -> * where","name":"LtlOp Builtin StartLtl StopLtl","module":"Cooked.Ltl","link":"Cooked-Ltl.html#t:LtlOp"},{"display_html":"data Staged (op :: * -> *) :: * -> * where","name":"Staged Return Instr","module":"Cooked.Ltl","link":"Cooked-Ltl.html#t:Staged"},{"display_html":"interpLtl :: InterpLtl modification builtin m => Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a","name":"interpLtl","module":"Cooked.Ltl","link":"Cooked-Ltl.html#v:interpLtl"},{"display_html":"interpLtlAndPruneUnfinished :: InterpLtl modification builtin m => Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a","name":"interpLtlAndPruneUnfinished","module":"Cooked.Ltl","link":"Cooked-Ltl.html#v:interpLtlAndPruneUnfinished"},{"display_html":"class MonadPlus m => InterpLtl modification builtin m where","name":"InterpLtl interpBuiltin","module":"Cooked.Ltl","link":"Cooked-Ltl.html#t:InterpLtl"},{"display_html":"class Monad m => MonadModal m where","name":"MonadModal Modification modifyLtl","module":"Cooked.Ltl","link":"Cooked-Ltl.html#t:MonadModal"},{"display_html":"class IsAbstractOutput o","name":"IsAbstractOutput","module":"Cooked.Output","link":"Cooked-Output.html#t:IsAbstractOutput"},{"display_html":"type family OwnerType o","name":"OwnerType","module":"Cooked.Output","link":"Cooked-Output.html#t:OwnerType"},{"display_html":"type family DatumType o","name":"DatumType","module":"Cooked.Output","link":"Cooked-Output.html#t:DatumType"},{"display_html":"type family ValueType o","name":"ValueType","module":"Cooked.Output","link":"Cooked-Output.html#t:ValueType"},{"display_html":"type family ReferenceScriptType o","name":"ReferenceScriptType","module":"Cooked.Output","link":"Cooked-Output.html#t:ReferenceScriptType"},{"display_html":"outputOwnerL :: IsAbstractOutput o => Lens' o (OwnerType o)","name":"outputOwnerL","module":"Cooked.Output","link":"Cooked-Output.html#v:outputOwnerL"},{"display_html":"outputStakingCredentialL :: IsAbstractOutput o => Lens' o (Maybe StakingCredential)","name":"outputStakingCredentialL","module":"Cooked.Output","link":"Cooked-Output.html#v:outputStakingCredentialL"},{"display_html":"outputDatumL :: IsAbstractOutput o => Lens' o (DatumType o)","name":"outputDatumL","module":"Cooked.Output","link":"Cooked-Output.html#v:outputDatumL"},{"display_html":"outputValueL :: IsAbstractOutput o => Lens' o (ValueType o)","name":"outputValueL","module":"Cooked.Output","link":"Cooked-Output.html#v:outputValueL"},{"display_html":"outputReferenceScriptL :: IsAbstractOutput o => Lens' o (Maybe (ReferenceScriptType o))","name":"outputReferenceScriptL","module":"Cooked.Output","link":"Cooked-Output.html#v:outputReferenceScriptL"},{"display_html":"class ToCredential a where","name":"ToCredential toCredential","module":"Cooked.Output","link":"Cooked-Output.html#t:ToCredential"},{"display_html":"class ToOutputDatum a where","name":"ToOutputDatum toOutputDatum","module":"Cooked.Output","link":"Cooked-Output.html#t:ToOutputDatum"},{"display_html":"class ToValue a where","name":"ToValue toValue","module":"Cooked.Output","link":"Cooked-Output.html#t:ToValue"},{"display_html":"class ToScript a where","name":"ToScript toScript","module":"Cooked.Output","link":"Cooked-Output.html#t:ToScript"},{"display_html":"class ToScriptHash a where","name":"ToScriptHash toScriptHash","module":"Cooked.Output","link":"Cooked-Output.html#t:ToScriptHash"},{"display_html":"type IsTxInfoOutput o = (IsAbstractOutput o, ToCredential (OwnerType o), ToOutputDatum (DatumType o), ToValue (ValueType o), ToScriptHash (ReferenceScriptType o))","name":"IsTxInfoOutput","module":"Cooked.Output","link":"Cooked-Output.html#t:IsTxInfoOutput"},{"display_html":"outputAddress :: (IsAbstractOutput o, ToCredential (OwnerType o)) => o -> Address","name":"outputAddress","module":"Cooked.Output","link":"Cooked-Output.html#v:outputAddress"},{"display_html":"outputOutputDatum :: (IsAbstractOutput o, ToOutputDatum (DatumType o)) => o -> OutputDatum","name":"outputOutputDatum","module":"Cooked.Output","link":"Cooked-Output.html#v:outputOutputDatum"},{"display_html":"outputValue :: (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value","name":"outputValue","module":"Cooked.Output","link":"Cooked-Output.html#v:outputValue"},{"display_html":"outputReferenceScriptHash :: (IsAbstractOutput o, ToScriptHash (ReferenceScriptType o)) => o -> Maybe ScriptHash","name":"outputReferenceScriptHash","module":"Cooked.Output","link":"Cooked-Output.html#v:outputReferenceScriptHash"},{"display_html":"outputTxOut :: IsTxInfoOutput o => o -> TxOut","name":"outputTxOut","module":"Cooked.Output","link":"Cooked-Output.html#v:outputTxOut"},{"display_html":"data ConcreteOutput ownerType datumType valueType referenceScriptType where","name":"ConcreteOutput ConcreteOutput","module":"Cooked.Output","link":"Cooked-Output.html#t:ConcreteOutput"},{"display_html":"toOutputWithReferenceScriptHash :: (IsAbstractOutput output, ToScriptHash (ReferenceScriptType output)) => output -> ConcreteOutput (OwnerType output) (DatumType output) (ValueType output) ScriptHash","name":"toOutputWithReferenceScriptHash","module":"Cooked.Output","link":"Cooked-Output.html#v:toOutputWithReferenceScriptHash"},{"display_html":"isOutputWithoutDatum :: IsTxInfoOutput output => output -> Maybe (ConcreteOutput (OwnerType output) () (ValueType output) (ReferenceScriptType output))","name":"isOutputWithoutDatum","module":"Cooked.Output","link":"Cooked-Output.html#v:isOutputWithoutDatum"},{"display_html":"isOutputWithInlineDatum :: IsTxInfoOutput output => output -> Maybe (ConcreteOutput (OwnerType output) Datum (ValueType output) (ReferenceScriptType output))","name":"isOutputWithInlineDatum","module":"Cooked.Output","link":"Cooked-Output.html#v:isOutputWithInlineDatum"},{"display_html":"isOutputWithDatumHash :: IsTxInfoOutput output => output -> Maybe (ConcreteOutput (OwnerType output) DatumHash (ValueType output) (ReferenceScriptType output))","name":"isOutputWithDatumHash","module":"Cooked.Output","link":"Cooked-Output.html#v:isOutputWithDatumHash"},{"display_html":"isOutputWithInlineDatumOfType :: (FromData a, IsTxInfoOutput output) => output -> Maybe (ConcreteOutput (OwnerType output) a (ValueType output) (ReferenceScriptType output))","name":"isOutputWithInlineDatumOfType","module":"Cooked.Output","link":"Cooked-Output.html#v:isOutputWithInlineDatumOfType"},{"display_html":"isScriptOutputFrom :: IsTxInfoOutput output => TypedValidator a -> output -> Maybe (ConcreteOutput (TypedValidator a) (DatumType output) (ValueType output) (ReferenceScriptType output))","name":"isScriptOutputFrom","module":"Cooked.Output","link":"Cooked-Output.html#v:isScriptOutputFrom"},{"display_html":"isPKOutputFrom :: IsTxInfoOutput output => PubKeyHash -> output -> Maybe (ConcreteOutput PubKeyHash (DatumType output) (ValueType output) (ReferenceScriptType output))","name":"isPKOutputFrom","module":"Cooked.Output","link":"Cooked-Output.html#v:isPKOutputFrom"},{"display_html":"isOnlyAdaOutput :: IsTxInfoOutput output => output -> Maybe (ConcreteOutput (OwnerType output) (DatumType output) Ada (ReferenceScriptType output))","name":"isOnlyAdaOutput","module":"Cooked.Output","link":"Cooked-Output.html#v:isOnlyAdaOutput"},{"display_html":"type DocCooked = Doc ()","name":"DocCooked","module":"Cooked.Pretty.Common","link":"Cooked-Pretty-Common.html#t:DocCooked"},{"display_html":"renderString :: (a -> DocCooked) -> a -> String","name":"renderString","module":"Cooked.Pretty.Common","link":"Cooked-Pretty-Common.html#v:renderString"},{"display_html":"prettyItemize :: DocCooked -> DocCooked -> [DocCooked] -> DocCooked","name":"prettyItemize","module":"Cooked.Pretty.Common","link":"Cooked-Pretty-Common.html#v:prettyItemize"},{"display_html":"prettyItemizeNoTitle :: DocCooked -> [DocCooked] -> DocCooked","name":"prettyItemizeNoTitle","module":"Cooked.Pretty.Common","link":"Cooked-Pretty-Common.html#v:prettyItemizeNoTitle"},{"display_html":"prettyItemizeNonEmpty :: DocCooked -> DocCooked -> [DocCooked] -> Maybe DocCooked","name":"prettyItemizeNonEmpty","module":"Cooked.Pretty.Common","link":"Cooked-Pretty-Common.html#v:prettyItemizeNonEmpty"},{"display_html":"prettyEnumerate :: DocCooked -> DocCooked -> [DocCooked] -> DocCooked","name":"prettyEnumerate","module":"Cooked.Pretty.Common","link":"Cooked-Pretty-Common.html#v:prettyEnumerate"},{"display_html":"prettyHash :: Show a => Int -> a -> DocCooked","name":"prettyHash","module":"Cooked.Pretty.Common","link":"Cooked-Pretty-Common.html#v:prettyHash"},{"display_html":"data PrettyCookedOpts = PrettyCookedOpts {}","name":"PrettyCookedOpts PrettyCookedOpts pcOptPrintTxHashes pcOptPrintTxOutRefs pcOptPrintDefaultTxOpts pcOptPrintedHashLength pcOptNumericUnderscores","module":"Cooked.Pretty.Options","link":"Cooked-Pretty-Options.html#t:PrettyCookedOpts"},{"display_html":"data PCOptTxOutRefs","name":"PCOptTxOutRefs PCOptTxOutRefsHidden PCOptTxOutRefsFull PCOptTxOutRefsPartial","module":"Cooked.Pretty.Options","link":"Cooked-Pretty-Options.html#t:PCOptTxOutRefs"},{"display_html":"unsafeTypedValidatorFromUPLC :: forall a. Program NamedDeBruijn DefaultUni DefaultFun () -> TypedValidator a","name":"unsafeTypedValidatorFromUPLC","module":"Cooked.RawUPLC","link":"Cooked-RawUPLC.html#v:unsafeTypedValidatorFromUPLC"},{"display_html":"typedValidatorFromUPLC :: Program NamedDeBruijn DefaultUni DefaultFun () -> TypedValidator Any","name":"typedValidatorFromUPLC","module":"Cooked.RawUPLC","link":"Cooked-RawUPLC.html#v:typedValidatorFromUPLC"},{"display_html":"unsafeTypedValidatorFromBS :: forall a. ByteString -> Either String (TypedValidator a)","name":"unsafeTypedValidatorFromBS","module":"Cooked.RawUPLC","link":"Cooked-RawUPLC.html#v:unsafeTypedValidatorFromBS"},{"display_html":"typedValidatorFromBS :: ByteString -> Either String (TypedValidator Any)","name":"typedValidatorFromBS","module":"Cooked.RawUPLC","link":"Cooked-RawUPLC.html#v:typedValidatorFromBS"},{"display_html":"class ShowBS a where","name":"ShowBS showBS showBSsPrec","module":"Cooked.ShowBS","link":"Cooked-ShowBS.html#t:ShowBS"},{"display_html":"showBSs :: ShowBS a => a -> BuiltinString -> BuiltinString","name":"showBSs","module":"Cooked.ShowBS","link":"Cooked-ShowBS.html#v:showBSs"},{"display_html":"app_prec :: Integer","name":"app_prec","module":"Cooked.ShowBS","link":"Cooked-ShowBS.html#v:app_prec"},{"display_html":"flattenValueI :: Iso' Value [(AssetClass, Integer)]","name":"flattenValueI","module":"Cooked.ValueUtils","link":"Cooked-ValueUtils.html#v:flattenValueI"},{"display_html":"positivePart :: Value -> Value","name":"positivePart","module":"Cooked.ValueUtils","link":"Cooked-ValueUtils.html#v:positivePart"},{"display_html":"negativePart :: Value -> Value","name":"negativePart","module":"Cooked.ValueUtils","link":"Cooked-ValueUtils.html#v:negativePart"},{"display_html":"adaL :: Lens' Value Ada","name":"adaL","module":"Cooked.ValueUtils","link":"Cooked-ValueUtils.html#v:adaL"},{"display_html":"knownWallets :: [Wallet]","name":"knownWallets","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:knownWallets"},{"display_html":"wallet :: Int -> Wallet","name":"wallet","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:wallet"},{"display_html":"walletPKHashToId :: PubKeyHash -> Maybe Int","name":"walletPKHashToId","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletPKHashToId"},{"display_html":"walletPK :: Wallet -> PubKey","name":"walletPK","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletPK"},{"display_html":"walletStakingPK :: Wallet -> Maybe PubKey","name":"walletStakingPK","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletStakingPK"},{"display_html":"walletPKHash :: Wallet -> PubKeyHash","name":"walletPKHash","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletPKHash"},{"display_html":"walletStakingPKHash :: Wallet -> Maybe PubKeyHash","name":"walletStakingPKHash","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletStakingPKHash"},{"display_html":"walletAddress :: Wallet -> Address","name":"walletAddress","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletAddress"},{"display_html":"walletSK :: MockWallet -> PrivateKey","name":"walletSK","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletSK"},{"display_html":"walletStakingSK :: Wallet -> Maybe PrivateKey","name":"walletStakingSK","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletStakingSK"},{"display_html":"initialDistribution :: [(Wallet, [Value])] -> InitialDistribution","name":"initialDistribution","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:initialDistribution"},{"display_html":"newtype InitialDistribution = InitialDistribution {}","name":"InitialDistribution InitialDistribution unInitialDistribution","module":"Cooked.Wallet","link":"Cooked-Wallet.html#t:InitialDistribution"},{"display_html":"type Wallet = MockWallet","name":"Wallet","module":"Cooked.Wallet","link":"Cooked-Wallet.html#t:Wallet"},{"display_html":"type PrivateKey = XPrv","name":"PrivateKey","module":"Cooked.Wallet","link":"Cooked-Wallet.html#t:PrivateKey"},{"display_html":"class PrettyCooked a where","name":"PrettyCooked prettyCookedOpt prettyCooked","module":"Cooked.Pretty.Class","link":"Cooked-Pretty-Class.html#t:PrettyCooked"},{"display_html":"printCookedOpt :: PrettyCooked a => PrettyCookedOpts -> a -> IO ()","name":"printCookedOpt","module":"Cooked.Pretty.Class","link":"Cooked-Pretty-Class.html#v:printCookedOpt"},{"display_html":"printCooked :: PrettyCooked a => a -> IO ()","name":"printCooked","module":"Cooked.Pretty.Class","link":"Cooked-Pretty-Class.html#v:printCooked"},{"display_html":"type LabelConstrs x = (Show x, Typeable x, Eq x, Ord x)","name":"LabelConstrs","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:LabelConstrs"},{"display_html":"data TxLabel where","name":"TxLabel TxLabel","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxLabel"},{"display_html":"data BalanceOutputPolicy","name":"BalanceOutputPolicy AdjustExistingOutput DontAdjustExistingOutput","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:BalanceOutputPolicy"},{"display_html":"data BalancingWallet","name":"BalancingWallet BalanceWithFirstSigner BalanceWith","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:BalancingWallet"},{"display_html":"newtype RawModTx = RawModTxAfterBalancing (Tx BabbageEra -> Tx BabbageEra)","name":"RawModTx RawModTxAfterBalancing","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:RawModTx"},{"display_html":"newtype EmulatorParamsModification = EmulatorParamsModification (Params -> Params)","name":"EmulatorParamsModification EmulatorParamsModification","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:EmulatorParamsModification"},{"display_html":"data BalancingUtxos","name":"BalancingUtxos BalancingUtxosAll BalancingUtxosDatumless BalancingUtxosAllowlist BalancingUtxosBlocklist","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:BalancingUtxos"},{"display_html":"applyEmulatorParamsModification :: Maybe EmulatorParamsModification -> Params -> Params","name":"applyEmulatorParamsModification","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:applyEmulatorParamsModification"},{"display_html":"applyRawModOnBalancedTx :: [RawModTx] -> Tx BabbageEra -> Tx BabbageEra","name":"applyRawModOnBalancedTx","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:applyRawModOnBalancedTx"},{"display_html":"data TxOpts = TxOpts {}","name":"TxOpts TxOpts txOptEmulatorParamsModification txOptEnsureMinAda txOptAwaitTxConfirmed txOptAutoSlotIncrease txOptUnsafeModTx txOptBalance txOptBalanceOutputPolicy txOptBalanceWallet txOptBalancingUtxos","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxOpts"},{"display_html":"txOptEnsureMinAdaL :: Lens' TxOpts Bool","name":"txOptEnsureMinAdaL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptEnsureMinAdaL"},{"display_html":"txOptAwaitTxConfirmedL :: Lens' TxOpts Bool","name":"txOptAwaitTxConfirmedL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptAwaitTxConfirmedL"},{"display_html":"txOptAutoSlotIncreaseL :: Lens' TxOpts Bool","name":"txOptAutoSlotIncreaseL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptAutoSlotIncreaseL"},{"display_html":"txOptUnsafeModTxL :: Lens' TxOpts [RawModTx]","name":"txOptUnsafeModTxL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptUnsafeModTxL"},{"display_html":"txOptBalanceL :: Lens' TxOpts Bool","name":"txOptBalanceL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptBalanceL"},{"display_html":"txOptBalanceOutputPolicyL :: Lens' TxOpts BalanceOutputPolicy","name":"txOptBalanceOutputPolicyL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptBalanceOutputPolicyL"},{"display_html":"txOptBalanceWalletL :: Lens' TxOpts BalancingWallet","name":"txOptBalanceWalletL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptBalanceWalletL"},{"display_html":"txOptBalancingUtxosL :: Lens' TxOpts BalancingUtxos","name":"txOptBalancingUtxosL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptBalancingUtxosL"},{"display_html":"txOptEmulatorParamsModificationL :: Lens' TxOpts (Maybe EmulatorParamsModification)","name":"txOptEmulatorParamsModificationL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptEmulatorParamsModificationL"},{"display_html":"type MintsConstrs redeemer = (ToData redeemer, Show redeemer, PrettyCooked redeemer, Typeable redeemer)","name":"MintsConstrs","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:MintsConstrs"},{"display_html":"data MintsRedeemer where","name":"MintsRedeemer NoMintsRedeemer SomeMintsRedeemer","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:MintsRedeemer"},{"display_html":"type TxSkelMints = Map (Versioned MintingPolicy) (MintsRedeemer, NEMap TokenName (NonZero Integer))","name":"TxSkelMints","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxSkelMints"},{"display_html":"addToTxSkelMints :: (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> TxSkelMints -> TxSkelMints","name":"addToTxSkelMints","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:addToTxSkelMints"},{"display_html":"txSkelMintsToList :: TxSkelMints -> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)]","name":"txSkelMintsToList","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelMintsToList"},{"display_html":"txSkelMintsFromList :: [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -> TxSkelMints","name":"txSkelMintsFromList","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelMintsFromList"},{"display_html":"txSkelMintsValue :: TxSkelMints -> Value","name":"txSkelMintsValue","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelMintsValue"},{"display_html":"txSkelOutValueL :: Lens' TxSkelOut Value","name":"txSkelOutValueL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutValueL"},{"display_html":"txSkelOutDatumL :: Lens' TxSkelOut TxSkelOutDatum","name":"txSkelOutDatumL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutDatumL"},{"display_html":"txSkelOutValue :: TxSkelOut -> Value","name":"txSkelOutValue","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutValue"},{"display_html":"txSkelOutValidator :: TxSkelOut -> Maybe (Versioned Validator)","name":"txSkelOutValidator","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutValidator"},{"display_html":"type TxSkelOutDatumConstrs a = (Show a, PrettyCooked a, ToData a, Eq a, Typeable a)","name":"TxSkelOutDatumConstrs","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxSkelOutDatumConstrs"},{"display_html":"data TxSkelOutDatum where","name":"TxSkelOutDatum TxSkelOutDatum TxSkelOutNoDatum TxSkelOutDatumHash TxSkelOutInlineDatum","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxSkelOutDatum"},{"display_html":"data TxSkelOut where","name":"TxSkelOut Pays producedOutput","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxSkelOut"},{"display_html":"txSkelOutTypedDatum :: FromData a => TxSkelOutDatum -> Maybe a","name":"txSkelOutTypedDatum","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutTypedDatum"},{"display_html":"txSkelOutUntypedDatum :: TxSkelOutDatum -> Maybe Datum","name":"txSkelOutUntypedDatum","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutUntypedDatum"},{"display_html":"paysPK :: PubKeyHash -> Value -> TxSkelOut","name":"paysPK","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:paysPK"},{"display_html":"paysScript :: (ToData (DatumType a), Show (DatumType a), Typeable (DatumType a), Eq (DatumType a), PrettyCooked (DatumType a), Typeable a) => TypedValidator a -> DatumType a -> Value -> TxSkelOut","name":"paysScript","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:paysScript"},{"display_html":"paysScriptInlineDatum :: (ToData (DatumType a), Show (DatumType a), Typeable (DatumType a), Eq (DatumType a), PrettyCooked (DatumType a), Typeable a) => TypedValidator a -> DatumType a -> Value -> TxSkelOut","name":"paysScriptInlineDatum","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:paysScriptInlineDatum"},{"display_html":"paysScriptDatumHash :: (ToData (DatumType a), Show (DatumType a), Typeable (DatumType a), Eq (DatumType a), PrettyCooked (DatumType a), Typeable a) => TypedValidator a -> DatumType a -> Value -> TxSkelOut","name":"paysScriptDatumHash","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:paysScriptDatumHash"},{"display_html":"paysScriptNoDatum :: Typeable a => TypedValidator a -> Value -> TxSkelOut","name":"paysScriptNoDatum","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:paysScriptNoDatum"},{"display_html":"withDatum :: (ToData a, Show a, Typeable a, Eq a, PrettyCooked a) => TxSkelOut -> a -> TxSkelOut","name":"withDatum","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:withDatum"},{"display_html":"withInlineDatum :: (ToData a, Show a, Typeable a, Eq a, PrettyCooked a) => TxSkelOut -> a -> TxSkelOut","name":"withInlineDatum","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:withInlineDatum"},{"display_html":"withDatumHash :: (ToData a, Show a, Typeable a, Eq a, PrettyCooked a) => TxSkelOut -> a -> TxSkelOut","name":"withDatumHash","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:withDatumHash"},{"display_html":"withReferenceScript :: (Show script, ToScript script, Typeable script, ToScriptHash script) => TxSkelOut -> script -> TxSkelOut","name":"withReferenceScript","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:withReferenceScript"},{"display_html":"withStakingCredential :: TxSkelOut -> StakingCredential -> TxSkelOut","name":"withStakingCredential","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:withStakingCredential"},{"display_html":"data TxSkelRedeemer where","name":"TxSkelRedeemer TxSkelNoRedeemerForPK TxSkelRedeemerForScript TxSkelRedeemerForReferencedScript","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxSkelRedeemer"},{"display_html":"txSkelTypedRedeemer :: FromData (RedeemerType a) => TxSkelRedeemer -> Maybe (RedeemerType a)","name":"txSkelTypedRedeemer","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelTypedRedeemer"},{"display_html":"data TxSkel where","name":"TxSkel TxSkel txSkelLabel txSkelOpts txSkelMints txSkelSigners txSkelValidityRange txSkelIns txSkelInsReference txSkelOuts","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxSkel"},{"display_html":"txSkelLabelL :: Lens' TxSkel (Set TxLabel)","name":"txSkelLabelL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelLabelL"},{"display_html":"txSkelOptsL :: Lens' TxSkel TxOpts","name":"txSkelOptsL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOptsL"},{"display_html":"txSkelMintsL :: Lens' TxSkel TxSkelMints","name":"txSkelMintsL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelMintsL"},{"display_html":"txSkelValidityRangeL :: Lens' TxSkel SlotRange","name":"txSkelValidityRangeL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelValidityRangeL"},{"display_html":"txSkelSignersL :: Lens' TxSkel [Wallet]","name":"txSkelSignersL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelSignersL"},{"display_html":"txSkelInsL :: Lens' TxSkel (Map TxOutRef TxSkelRedeemer)","name":"txSkelInsL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelInsL"},{"display_html":"txSkelInsReferenceL :: Lens' TxSkel (Set TxOutRef)","name":"txSkelInsReferenceL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelInsReferenceL"},{"display_html":"txSkelOutsL :: Lens' TxSkel [TxSkelOut]","name":"txSkelOutsL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutsL"},{"display_html":"txSkelTemplate :: TxSkel","name":"txSkelTemplate","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelTemplate"},{"display_html":"txSkelOutputData :: TxSkel -> Map DatumHash TxSkelOutDatum","name":"txSkelOutputData","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutputData"},{"display_html":"newtype Fee = Fee {}","name":"Fee Fee feeLovelace","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:Fee"},{"display_html":"txSkelOutputValue :: TxSkel -> Fee -> Value","name":"txSkelOutputValue","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutputValue"},{"display_html":"txSkelOutValidators :: TxSkel -> Map ValidatorHash (Versioned Validator)","name":"txSkelOutValidators","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutValidators"},{"display_html":"txSkelOutOwnerTypeP :: forall ownerType. (ToCredential ownerType, Show ownerType, IsTxSkelOutAllowedOwner ownerType, Typeable ownerType) => Prism' TxSkelOut (ConcreteOutput ownerType TxSkelOutDatum Value (Versioned Script))","name":"txSkelOutOwnerTypeP","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutOwnerTypeP"},{"display_html":"txSkelOutputDatumTypeAT :: (FromData a, Typeable a) => AffineTraversal' TxSkelOut a","name":"txSkelOutputDatumTypeAT","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutputDatumTypeAT"},{"display_html":"data SkelContext = SkelContext {}","name":"SkelContext SkelContext skelContextTxOuts skelContextTxSkelOutDatums","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:SkelContext"},{"display_html":"txSkelOutReferenceScripts :: TxSkel -> Map ValidatorHash (Versioned Validator)","name":"txSkelOutReferenceScripts","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutReferenceScripts"},{"display_html":"newtype UtxoState = UtxoState {}","name":"UtxoState UtxoState utxoState","module":"Cooked.MockChain.UtxoState","link":"Cooked-MockChain-UtxoState.html#t:UtxoState"},{"display_html":"newtype UtxoPayloadSet = UtxoPayloadSet {}","name":"UtxoPayloadSet UtxoPayloadSet utxoPayloadSet","module":"Cooked.MockChain.UtxoState","link":"Cooked-MockChain-UtxoState.html#t:UtxoPayloadSet"},{"display_html":"data UtxoPayload = UtxoPayload {}","name":"UtxoPayload UtxoPayload utxoPayloadTxOutRef utxoPayloadValue utxoPayloadSkelOutDatum utxoPayloadReferenceScript","module":"Cooked.MockChain.UtxoState","link":"Cooked-MockChain-UtxoState.html#t:UtxoPayload"},{"display_html":"holdsInState :: Address -> UtxoState -> Value","name":"holdsInState","module":"Cooked.MockChain.UtxoState","link":"Cooked-MockChain-UtxoState.html#v:holdsInState"},{"display_html":"data GenerateTxError","name":"GenerateTxError TxBodyError ToCardanoError GenerateTxErrorGeneral","module":"Cooked.MockChain.GenerateTx","link":"Cooked-MockChain-GenerateTx.html#t:GenerateTxError"},{"display_html":"data GenTxParams","name":"GenTxParams gtpCollateralIns gtpFee","module":"Cooked.MockChain.GenerateTx","link":"Cooked-MockChain-GenerateTx.html#t:GenTxParams"},{"display_html":"generateTxBodyContent :: GenTxParams -> Params -> Map DatumHash Datum -> Map TxOutRef TxOut -> Map ValidatorHash (Versioned Validator) -> TxSkel -> Either GenerateTxError (TxBodyContent BuildTx BabbageEra)","name":"generateTxBodyContent","module":"Cooked.MockChain.GenerateTx","link":"Cooked-MockChain-GenerateTx.html#v:generateTxBodyContent"},{"display_html":"txSkelOutToCardanoTxOut :: Params -> TxSkelOut -> Either GenerateTxError (TxOut CtxTx BabbageEra)","name":"txSkelOutToCardanoTxOut","module":"Cooked.MockChain.GenerateTx","link":"Cooked-MockChain-GenerateTx.html#v:txSkelOutToCardanoTxOut"},{"display_html":"generateTx :: GenTxParams -> Params -> Map DatumHash Datum -> Map TxOutRef TxOut -> Map ValidatorHash (Versioned Validator) -> TxSkel -> Either GenerateTxError (Tx BabbageEra)","name":"generateTx","module":"Cooked.MockChain.GenerateTx","link":"Cooked-MockChain-GenerateTx.html#v:generateTx"},{"display_html":"data MockChainError where","name":"MockChainError MCEValidationError MCEUnbalanceable MCENoSuitableCollateral MCEGenerationError MCECalcFee MCEUnknownOutRefError MCEUnknownValidator MCEUnknownDatum FailWith OtherMockChainError","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MockChainError"},{"display_html":"data MCEUnbalanceableError","name":"MCEUnbalanceableError MCEUnbalNotEnoughFunds MCEUnbalNotEnoughReturning","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MCEUnbalanceableError"},{"display_html":"class (MonadFail m, MonadError MockChainError m) => MonadBlockChainBalancing m where","name":"MonadBlockChainBalancing getParams datumFromHash utxosAtLedger validatorFromHash txOutByRefLedger","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MonadBlockChainBalancing"},{"display_html":"class MonadBlockChainBalancing m => MonadBlockChainWithoutValidation m where","name":"MonadBlockChainWithoutValidation awaitSlot currentSlot allUtxosLedger","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MonadBlockChainWithoutValidation"},{"display_html":"class MonadBlockChainWithoutValidation m => MonadBlockChain m where","name":"MonadBlockChain validateTxSkel","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MonadBlockChain"},{"display_html":"newtype AsTrans t (m :: Type -> Type) a = AsTrans {}","name":"AsTrans AsTrans getTrans","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:AsTrans"},{"display_html":"allUtxos :: MonadBlockChainWithoutValidation m => m [(TxOutRef, TxOut)]","name":"allUtxos","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:allUtxos"},{"display_html":"currentTime :: MonadBlockChainWithoutValidation m => m (POSIXTime, POSIXTime)","name":"currentTime","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:currentTime"},{"display_html":"waitNSlots :: MonadBlockChainWithoutValidation m => Integer -> m Slot","name":"waitNSlots","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:waitNSlots"},{"display_html":"utxosAt :: MonadBlockChainBalancing m => Address -> m [(TxOutRef, TxOut)]","name":"utxosAt","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:utxosAt"},{"display_html":"txOutByRef :: MonadBlockChainBalancing m => TxOutRef -> m (Maybe TxOut)","name":"txOutByRef","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:txOutByRef"},{"display_html":"utxosFromCardanoTx :: CardanoTx -> [(TxOutRef, TxOut)]","name":"utxosFromCardanoTx","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:utxosFromCardanoTx"},{"display_html":"txOutV2FromLedger :: TxOut -> TxOut","name":"txOutV2FromLedger","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:txOutV2FromLedger"},{"display_html":"typedDatumFromTxOutRef :: (FromData a, MonadBlockChainWithoutValidation m) => TxOutRef -> m (Maybe a)","name":"typedDatumFromTxOutRef","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:typedDatumFromTxOutRef"},{"display_html":"valueFromTxOutRef :: MonadBlockChainWithoutValidation m => TxOutRef -> m (Maybe Value)","name":"valueFromTxOutRef","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:valueFromTxOutRef"},{"display_html":"outputDatumFromTxOutRef :: MonadBlockChainWithoutValidation m => TxOutRef -> m (Maybe OutputDatum)","name":"outputDatumFromTxOutRef","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:outputDatumFromTxOutRef"},{"display_html":"datumFromTxOutRef :: MonadBlockChainWithoutValidation m => TxOutRef -> m (Maybe Datum)","name":"datumFromTxOutRef","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:datumFromTxOutRef"},{"display_html":"resolveDatum :: (IsAbstractOutput out, ToOutputDatum (DatumType out), MonadBlockChainBalancing m) => out -> m (Maybe (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out)))","name":"resolveDatum","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:resolveDatum"},{"display_html":"resolveTypedDatum :: (IsAbstractOutput out, ToOutputDatum (DatumType out), MonadBlockChainBalancing m, FromData a) => out -> m (Maybe (ConcreteOutput (OwnerType out) a (ValueType out) (ReferenceScriptType out)))","name":"resolveTypedDatum","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:resolveTypedDatum"},{"display_html":"resolveValidator :: (IsAbstractOutput out, ToCredential (OwnerType out), MonadBlockChainBalancing m) => out -> m (Maybe (ConcreteOutput (Versioned Validator) (DatumType out) (ValueType out) (ReferenceScriptType out)))","name":"resolveValidator","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:resolveValidator"},{"display_html":"resolveReferenceScript :: (IsAbstractOutput out, ToScriptHash (ReferenceScriptType out), MonadBlockChainBalancing m) => out -> m (Maybe (ConcreteOutput (OwnerType out) (DatumType out) (ValueType out) (Versioned Validator)))","name":"resolveReferenceScript","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:resolveReferenceScript"},{"display_html":"getEnclosingSlot :: MonadBlockChainWithoutValidation m => POSIXTime -> m Slot","name":"getEnclosingSlot","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:getEnclosingSlot"},{"display_html":"awaitEnclosingSlot :: MonadBlockChainWithoutValidation m => POSIXTime -> m Slot","name":"awaitEnclosingSlot","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:awaitEnclosingSlot"},{"display_html":"slotRangeBefore :: MonadBlockChainWithoutValidation m => POSIXTime -> m SlotRange","name":"slotRangeBefore","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:slotRangeBefore"},{"display_html":"slotRangeAfter :: MonadBlockChainWithoutValidation m => POSIXTime -> m SlotRange","name":"slotRangeAfter","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:slotRangeAfter"},{"display_html":"slotToTimeInterval :: MonadBlockChainWithoutValidation m => Slot -> m (POSIXTime, POSIXTime)","name":"slotToTimeInterval","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:slotToTimeInterval"},{"display_html":"runTweakInChain :: (MonadBlockChainWithoutValidation m, MonadPlus m) => Tweak m a -> TxSkel -> m (a, TxSkel)","name":"runTweakInChain","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:runTweakInChain"},{"display_html":"runTweakInChain' :: MonadBlockChainWithoutValidation m => Tweak m a -> TxSkel -> m [(a, TxSkel)]","name":"runTweakInChain'","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:runTweakInChain-39-"},{"display_html":"type Tweak m = StateT TxSkel (ListT m)","name":"Tweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#t:Tweak"},{"display_html":"data UntypedTweak m where","name":"UntypedTweak UntypedTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#t:UntypedTweak"},{"display_html":"class (MonadPlus m, MonadBlockChainWithoutValidation m) => MonadTweak m where","name":"MonadTweak getTxSkel putTxSkel","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#t:MonadTweak"},{"display_html":"failingTweak :: MonadTweak m => m a","name":"failingTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:failingTweak"},{"display_html":"doNothingTweak :: MonadTweak m => m ()","name":"doNothingTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:doNothingTweak"},{"display_html":"viewTweak :: (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a","name":"viewTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:viewTweak"},{"display_html":"viewAllTweak :: (MonadTweak m, Is k A_Fold) => Optic' k is TxSkel a -> m [a]","name":"viewAllTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:viewAllTweak"},{"display_html":"setTweak :: (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> a -> m ()","name":"setTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:setTweak"},{"display_html":"overTweak :: (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> (a -> a) -> m ()","name":"overTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:overTweak"},{"display_html":"overMaybeTweak :: (MonadTweak m, Is k A_Traversal) => Optic' k is TxSkel a -> (a -> Maybe a) -> m [a]","name":"overMaybeTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:overMaybeTweak"},{"display_html":"overMaybeSelectingTweak :: forall a m k is. (MonadTweak m, Is k A_Traversal) => Optic' k is TxSkel a -> (a -> Maybe a) -> (Integer -> Bool) -> m [a]","name":"overMaybeSelectingTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:overMaybeSelectingTweak"},{"display_html":"selectP :: (a -> Bool) -> Prism' a a","name":"selectP","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:selectP"},{"display_html":"combineModsTweak :: (Eq is, Is k A_Traversal, MonadTweak m) => ([is] -> [[is]]) -> Optic' k (WithIx is) TxSkel x -> (is -> x -> m [(x, l)]) -> m [l]","name":"combineModsTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:combineModsTweak"},{"display_html":"iviewTweak :: (MonadTweak m, Is k A_Getter) => Optic' k (WithIx is) TxSkel a -> m (is, a)","name":"iviewTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:iviewTweak"},{"display_html":"getSignersTweak :: MonadTweak m => m [Wallet]","name":"getSignersTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:getSignersTweak"},{"display_html":"modifySignersTweak :: MonadTweak m => ([Wallet] -> [Wallet]) -> m [Wallet]","name":"modifySignersTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:modifySignersTweak"},{"display_html":"setSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet]","name":"setSignersTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:setSignersTweak"},{"display_html":"signersSatisfyTweak :: MonadTweak m => ([Wallet] -> Bool) -> m Bool","name":"signersSatisfyTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:signersSatisfyTweak"},{"display_html":"isSignerTweak :: MonadTweak m => Wallet -> m Bool","name":"isSignerTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:isSignerTweak"},{"display_html":"hasSignersTweak :: MonadTweak m => m Bool","name":"hasSignersTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:hasSignersTweak"},{"display_html":"addFirstSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"addFirstSignerTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:addFirstSignerTweak"},{"display_html":"addSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet]","name":"addSignersTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:addSignersTweak"},{"display_html":"addLastSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"addLastSignerTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:addLastSignerTweak"},{"display_html":"removeSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet]","name":"removeSignersTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:removeSignersTweak"},{"display_html":"removeSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"removeSignerTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:removeSignerTweak"},{"display_html":"replaceFirstSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"replaceFirstSignerTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:replaceFirstSignerTweak"},{"display_html":"data PermutOutTweakMode","name":"PermutOutTweakMode KeepIdentity OmitIdentity","module":"Cooked.Tweak.OutPermutations","link":"Cooked-Tweak-OutPermutations.html#t:PermutOutTweakMode"},{"display_html":"allOutPermutsTweak :: MonadTweak m => PermutOutTweakMode -> m ()","name":"allOutPermutsTweak","module":"Cooked.Tweak.OutPermutations","link":"Cooked-Tweak-OutPermutations.html#v:allOutPermutsTweak"},{"display_html":"singleOutPermutTweak :: MonadTweak m => Int -> m ()","name":"singleOutPermutTweak","module":"Cooked.Tweak.OutPermutations","link":"Cooked-Tweak-OutPermutations.html#v:singleOutPermutTweak"},{"display_html":"distinctPermutations :: Eq a => [a] -> [[a]]","name":"distinctPermutations","module":"Cooked.Tweak.OutPermutations","link":"Cooked-Tweak-OutPermutations.html#v:distinctPermutations"},{"display_html":"addLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m ()","name":"addLabelTweak","module":"Cooked.Tweak.Labels","link":"Cooked-Tweak-Labels.html#v:addLabelTweak"},{"display_html":"removeLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m ()","name":"removeLabelTweak","module":"Cooked.Tweak.Labels","link":"Cooked-Tweak-Labels.html#v:removeLabelTweak"},{"display_html":"hasLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m Bool","name":"hasLabelTweak","module":"Cooked.Tweak.Labels","link":"Cooked-Tweak-Labels.html#v:hasLabelTweak"},{"display_html":"tamperDatumTweak :: forall a m. (MonadTweak m, Show a, PrettyCooked a, ToData a, FromData a, Typeable a) => (a -> Maybe a) -> m [a]","name":"tamperDatumTweak","module":"Cooked.Tweak.TamperDatum","link":"Cooked-Tweak-TamperDatum.html#v:tamperDatumTweak"},{"display_html":"data TamperDatumLbl = TamperDatumLbl","name":"TamperDatumLbl TamperDatumLbl","module":"Cooked.Tweak.TamperDatum","link":"Cooked-Tweak-TamperDatum.html#t:TamperDatumLbl"},{"display_html":"malformDatumTweak :: forall a m. (MonadTweak m, ToData a, FromData a, Typeable a) => (a -> [BuiltinData]) -> m ()","name":"malformDatumTweak","module":"Cooked.Tweak.TamperDatum","link":"Cooked-Tweak-TamperDatum.html#v:malformDatumTweak"},{"display_html":"data MalformDatumLbl = MalformDatumLbl","name":"MalformDatumLbl MalformDatumLbl","module":"Cooked.Tweak.TamperDatum","link":"Cooked-Tweak-TamperDatum.html#t:MalformDatumLbl"},{"display_html":"ensureInputTweak :: MonadTweak m => TxOutRef -> TxSkelRedeemer -> m (Maybe (TxOutRef, TxSkelRedeemer))","name":"ensureInputTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:ensureInputTweak"},{"display_html":"addInputTweak :: MonadTweak m => TxOutRef -> TxSkelRedeemer -> m ()","name":"addInputTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:addInputTweak"},{"display_html":"removeInputTweak :: MonadTweak m => (TxOutRef -> TxSkelRedeemer -> Bool) -> m [(TxOutRef, TxSkelRedeemer)]","name":"removeInputTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:removeInputTweak"},{"display_html":"ensureOutputTweak :: MonadTweak m => TxSkelOut -> m (Maybe TxSkelOut)","name":"ensureOutputTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:ensureOutputTweak"},{"display_html":"addOutputTweak :: MonadTweak m => TxSkelOut -> m ()","name":"addOutputTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:addOutputTweak"},{"display_html":"removeOutputTweak :: MonadTweak m => (TxSkelOut -> Bool) -> m [TxSkelOut]","name":"removeOutputTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:removeOutputTweak"},{"display_html":"addMintTweak :: MonadTweak m => (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> m ()","name":"addMintTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:addMintTweak"},{"display_html":"removeMintTweak :: MonadTweak m => ((Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> Bool) -> m [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)]","name":"removeMintTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:removeMintTweak"},{"display_html":"runUtxoSearch :: Monad m => UtxoSearch m a -> m [(TxOutRef, a)]","name":"runUtxoSearch","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:runUtxoSearch"},{"display_html":"allUtxosSearch :: MonadBlockChain m => UtxoSearch m TxOut","name":"allUtxosSearch","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:allUtxosSearch"},{"display_html":"allUtxosLedgerSearch :: MonadBlockChain m => UtxoSearch m TxOut","name":"allUtxosLedgerSearch","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:allUtxosLedgerSearch"},{"display_html":"utxosAtSearch :: MonadBlockChainBalancing m => Address -> UtxoSearch m TxOut","name":"utxosAtSearch","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:utxosAtSearch"},{"display_html":"utxosAtLedgerSearch :: MonadBlockChainBalancing m => Address -> UtxoSearch m TxOut","name":"utxosAtLedgerSearch","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:utxosAtLedgerSearch"},{"display_html":"utxosFromCardanoTxSearch :: Monad m => CardanoTx -> UtxoSearch m TxOut","name":"utxosFromCardanoTxSearch","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:utxosFromCardanoTxSearch"},{"display_html":"txOutByRefSearch :: MonadBlockChainBalancing m => [TxOutRef] -> UtxoSearch m TxOut","name":"txOutByRefSearch","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:txOutByRefSearch"},{"display_html":"filterWith :: Monad m => UtxoSearch m a -> (a -> m (Maybe b)) -> UtxoSearch m b","name":"filterWith","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:filterWith"},{"display_html":"filterWithPure :: Monad m => UtxoSearch m a -> (a -> Maybe b) -> UtxoSearch m b","name":"filterWithPure","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:filterWithPure"},{"display_html":"filterWithOptic :: (Is k An_AffineFold, Monad m) => UtxoSearch m a -> Optic' k is a b -> UtxoSearch m b","name":"filterWithOptic","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:filterWithOptic"},{"display_html":"filterWithPred :: Monad m => UtxoSearch m a -> (a -> Bool) -> UtxoSearch m a","name":"filterWithPred","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:filterWithPred"},{"display_html":"balancedTxSkel :: MonadBlockChainBalancing m => TxSkel -> m (TxSkel, Fee, Set TxOutRef)","name":"balancedTxSkel","module":"Cooked.MockChain.Balancing","link":"Cooked-MockChain-Balancing.html#v:balancedTxSkel"},{"display_html":"balancedTx :: MonadBlockChainBalancing m => (TxSkel, Fee, Set TxOutRef) -> m (Tx BabbageEra)","name":"balancedTx","module":"Cooked.MockChain.Balancing","link":"Cooked-MockChain-Balancing.html#v:balancedTx"},{"display_html":"txSkelInputData :: MonadBlockChainBalancing m => TxSkel -> m (Map DatumHash Datum)","name":"txSkelInputData","module":"Cooked.MockChain.Balancing","link":"Cooked-MockChain-Balancing.html#v:txSkelInputData"},{"display_html":"mcstToUtxoState :: MockChainSt -> UtxoState","name":"mcstToUtxoState","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:mcstToUtxoState"},{"display_html":"data MockChainSt = MockChainSt {}","name":"MockChainSt MockChainSt mcstCurrentSlot mcstValidators mcstDatums mcstIndex","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#t:MockChainSt"},{"display_html":"newtype MockChainEnv = MockChainEnv {}","name":"MockChainEnv MockChainEnv mceParams","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#t:MockChainEnv"},{"display_html":"newtype MockChainT m a = MockChainT {}","name":"MockChainT MockChainT unMockChain","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#t:MockChainT"},{"display_html":"type MockChain = MockChainT Identity","name":"MockChain","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#t:MockChain"},{"display_html":"combineMockChainT :: Monad m => (forall a. m a -> m a -> m a) -> MockChainT m x -> MockChainT m x -> MockChainT m x","name":"combineMockChainT","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:combineMockChainT"},{"display_html":"mapMockChainT :: (m (Either MockChainError (a, MockChainSt)) -> n (Either MockChainError (b, MockChainSt))) -> MockChainT m a -> MockChainT n b","name":"mapMockChainT","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:mapMockChainT"},{"display_html":"runMockChainTRaw :: Monad m => MockChainEnv -> MockChainSt -> MockChainT m a -> m (Either MockChainError (a, MockChainSt))","name":"runMockChainTRaw","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainTRaw"},{"display_html":"runMockChainTFrom :: Monad m => InitialDistribution -> MockChainT m a -> m (Either MockChainError (a, UtxoState))","name":"runMockChainTFrom","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainTFrom"},{"display_html":"runMockChainT :: Monad m => MockChainT m a -> m (Either MockChainError (a, UtxoState))","name":"runMockChainT","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainT"},{"display_html":"runMockChainRaw :: MockChainEnv -> MockChainSt -> MockChain a -> Either MockChainError (a, MockChainSt)","name":"runMockChainRaw","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainRaw"},{"display_html":"runMockChainFrom :: InitialDistribution -> MockChain a -> Either MockChainError (a, UtxoState)","name":"runMockChainFrom","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainFrom"},{"display_html":"runMockChain :: MockChain a -> Either MockChainError (a, UtxoState)","name":"runMockChain","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChain"},{"display_html":"utxoState0 :: UtxoState","name":"utxoState0","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:utxoState0"},{"display_html":"mockChainSt0 :: MockChainSt","name":"mockChainSt0","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:mockChainSt0"},{"display_html":"mockChainSt0From :: InitialDistribution -> MockChainSt","name":"mockChainSt0From","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:mockChainSt0From"},{"display_html":"utxoIndex0From :: InitialDistribution -> UtxoIndex","name":"utxoIndex0From","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:utxoIndex0From"},{"display_html":"utxoIndex0 :: UtxoIndex","name":"utxoIndex0","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:utxoIndex0"},{"display_html":"getIndex :: UtxoIndex -> Map TxOutRef TxOut","name":"getIndex","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:getIndex"},{"display_html":"runTransactionValidation :: Monad m => Params -> Tx BabbageEra -> [RawModTx] -> Map DatumHash Datum -> Map DatumHash TxSkelOutDatum -> Map ValidatorHash (Versioned Validator) -> MockChainT m CardanoTx","name":"runTransactionValidation","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runTransactionValidation"},{"display_html":"interpretAndRunWith :: (forall m. Monad m => MockChainT m a -> m res) -> StagedMockChain a -> [(res, MockChainLog)]","name":"interpretAndRunWith","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:interpretAndRunWith"},{"display_html":"interpretAndRun :: StagedMockChain a -> [(Either MockChainError (a, UtxoState), MockChainLog)]","name":"interpretAndRun","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:interpretAndRun"},{"display_html":"data MockChainLogEntry","name":"MockChainLogEntry MCLogSubmittedTxSkel MCLogNewTx MCLogFail","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#t:MockChainLogEntry"},{"display_html":"newtype MockChainLog = MockChainLog {}","name":"MockChainLog MockChainLog unMockChainLog","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#t:MockChainLog"},{"display_html":"type StagedMockChain = Staged MockChainOp","name":"StagedMockChain","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#t:StagedMockChain"},{"display_html":"runTweakFrom :: MockChainEnv -> MockChainSt -> Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)]","name":"runTweakFrom","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:runTweakFrom"},{"display_html":"type MonadModalBlockChain m = (MonadBlockChain m, MonadModal m, Modification m ~ UntypedTweak InterpMockChain)","name":"MonadModalBlockChain","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#t:MonadModalBlockChain"},{"display_html":"somewhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a","name":"somewhere","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:somewhere"},{"display_html":"runTweak :: Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)]","name":"runTweak","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:runTweak"},{"display_html":"everywhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a","name":"everywhere","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:everywhere"},{"display_html":"withTweak :: MonadModalBlockChain m => m x -> Tweak InterpMockChain a -> m x","name":"withTweak","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:withTweak"},{"display_html":"prettyTxSkel :: PrettyCookedOpts -> SkelContext -> TxSkel -> DocCooked","name":"prettyTxSkel","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyTxSkel"},{"display_html":"prettyBalancingWallet :: PrettyCookedOpts -> Wallet -> DocCooked","name":"prettyBalancingWallet","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyBalancingWallet"},{"display_html":"prettySigners :: PrettyCookedOpts -> TxOpts -> [Wallet] -> [DocCooked]","name":"prettySigners","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettySigners"},{"display_html":"prettyMints :: PrettyCookedOpts -> (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> DocCooked","name":"prettyMints","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyMints"},{"display_html":"mPrettyTxOpts :: PrettyCookedOpts -> TxOpts -> Maybe DocCooked","name":"mPrettyTxOpts","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:mPrettyTxOpts"},{"display_html":"prettyTxSkelOut :: PrettyCookedOpts -> TxSkelOut -> DocCooked","name":"prettyTxSkelOut","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyTxSkelOut"},{"display_html":"prettyTxSkelOutDatumMaybe :: PrettyCookedOpts -> TxSkelOutDatum -> Maybe DocCooked","name":"prettyTxSkelOutDatumMaybe","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyTxSkelOutDatumMaybe"},{"display_html":"prettyTxSkelIn :: PrettyCookedOpts -> SkelContext -> (TxOutRef, TxSkelRedeemer) -> DocCooked","name":"prettyTxSkelIn","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyTxSkelIn"},{"display_html":"prettyTxSkelInReference :: PrettyCookedOpts -> SkelContext -> TxOutRef -> Maybe DocCooked","name":"prettyTxSkelInReference","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyTxSkelInReference"},{"display_html":"prettyAddressState :: PrettyCookedOpts -> Address -> UtxoPayloadSet -> DocCooked","name":"prettyAddressState","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyAddressState"},{"display_html":"prettyPayloadGrouped :: PrettyCookedOpts -> [UtxoPayload] -> Maybe DocCooked","name":"prettyPayloadGrouped","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyPayloadGrouped"},{"display_html":"prettyPayload :: PrettyCookedOpts -> Bool -> UtxoPayload -> Maybe DocCooked","name":"prettyPayload","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyPayload"},{"display_html":"prettyReferenceScriptHash :: PrettyCookedOpts -> ScriptHash -> DocCooked","name":"prettyReferenceScriptHash","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyReferenceScriptHash"},{"display_html":"module Cooked.Pretty.Options","name":"","module":"Cooked.Pretty","link":""},{"display_html":"module Cooked.Pretty.Cooked","name":"","module":"Cooked.Pretty","link":""},{"display_html":"module Cooked.Pretty.Common","name":"","module":"Cooked.Pretty","link":""},{"display_html":"module Cooked.Pretty.Class","name":"","module":"Cooked.Pretty","link":""},{"display_html":"class IsProp prop where","name":"IsProp testFailureMsg testSuccess testFailure testDisjoin testConjoin testCounterexample","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#t:IsProp"},{"display_html":"testBool :: IsProp prop => Bool -> prop","name":"testBool","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testBool"},{"display_html":"testAll :: IsProp prop => (a -> prop) -> [a] -> prop","name":"testAll","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testAll"},{"display_html":"(.==.) :: (IsProp prop, Eq a) => a -> a -> prop","name":".==.","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:.-61--61-."},{"display_html":"(.&&.) :: IsProp prop => prop -> prop -> prop","name":".&&.","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:.-38--38-."},{"display_html":"(.||.) :: IsProp prop => prop -> prop -> prop","name":".||.","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:.-124--124-."},{"display_html":"testSucceeds :: IsProp prop => PrettyCookedOpts -> StagedMockChain a -> prop","name":"testSucceeds","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testSucceeds"},{"display_html":"testFails :: (IsProp prop, Show a) => PrettyCookedOpts -> (MockChainError -> prop) -> StagedMockChain a -> prop","name":"testFails","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testFails"},{"display_html":"testSucceedsFrom :: IsProp prop => PrettyCookedOpts -> InitialDistribution -> StagedMockChain a -> prop","name":"testSucceedsFrom","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testSucceedsFrom"},{"display_html":"testSucceedsFrom' :: IsProp prop => PrettyCookedOpts -> (a -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testSucceedsFrom'","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testSucceedsFrom-39-"},{"display_html":"testFailsFrom :: (IsProp prop, Show a) => PrettyCookedOpts -> (MockChainError -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testFailsFrom","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testFailsFrom"},{"display_html":"isCekEvaluationFailure :: IsProp prop => PrettyCookedOpts -> MockChainError -> prop","name":"isCekEvaluationFailure","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:isCekEvaluationFailure"},{"display_html":"isCekEvaluationFailureWithMsg :: IsProp prop => PrettyCookedOpts -> (String -> Bool) -> MockChainError -> prop","name":"isCekEvaluationFailureWithMsg","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:isCekEvaluationFailureWithMsg"},{"display_html":"testAllSatisfiesFrom :: forall prop a. IsProp prop => PrettyCookedOpts -> (Either MockChainError (a, UtxoState) -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testAllSatisfiesFrom","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testAllSatisfiesFrom"},{"display_html":"testBinaryRelatedBy :: IsProp prop => PrettyCookedOpts -> (UtxoState -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testBinaryRelatedBy","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testBinaryRelatedBy"},{"display_html":"testOneEquivClass :: IsProp prop => PrettyCookedOpts -> (UtxoState -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testOneEquivClass","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testOneEquivClass"},{"display_html":"testSatisfiesFrom' :: ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testSatisfiesFrom'","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testSatisfiesFrom-39-"},{"display_html":"assertionToMaybe :: Assertion -> IO (Maybe HUnitFailure)","name":"assertionToMaybe","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:assertionToMaybe"},{"display_html":"forAll :: Show a => Gen a -> (a -> Property) -> Property","name":"forAll","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:forAll"},{"display_html":"utxoPayloadReferenceScript :: UtxoPayload -> Maybe ScriptHash","name":"utxoPayloadReferenceScript","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoPayloadReferenceScript"},{"display_html":"utxoPayloadSkelOutDatum :: UtxoPayload -> TxSkelOutDatum","name":"utxoPayloadSkelOutDatum","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoPayloadSkelOutDatum"},{"display_html":"utxoPayloadTxOutRef :: UtxoPayload -> TxOutRef","name":"utxoPayloadTxOutRef","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoPayloadTxOutRef"},{"display_html":"utxoPayloadValue :: UtxoPayload -> Value","name":"utxoPayloadValue","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoPayloadValue"},{"display_html":"utxoPayloadSet :: UtxoPayloadSet -> [UtxoPayload]","name":"utxoPayloadSet","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoPayloadSet"},{"display_html":"data UtxoState","name":"UtxoState","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:UtxoState"},{"display_html":"holdsInState :: Address -> UtxoState -> Value","name":"holdsInState","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:holdsInState"},{"display_html":"newtype AsTrans t (m :: Type -> Type) a = AsTrans {}","name":"AsTrans AsTrans getTrans","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:AsTrans"},{"display_html":"class MonadBlockChainWithoutValidation m => MonadBlockChain m where","name":"MonadBlockChain validateTxSkel","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MonadBlockChain"},{"display_html":"class MonadBlockChainBalancing m => MonadBlockChainWithoutValidation m where","name":"MonadBlockChainWithoutValidation allUtxosLedger awaitSlot currentSlot","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MonadBlockChainWithoutValidation"},{"display_html":"class (MonadFail m, MonadError MockChainError m) => MonadBlockChainBalancing m where","name":"MonadBlockChainBalancing txOutByRefLedger validatorFromHash utxosAtLedger getParams datumFromHash","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MonadBlockChainBalancing"},{"display_html":"data MCEUnbalanceableError","name":"MCEUnbalanceableError MCEUnbalNotEnoughFunds MCEUnbalNotEnoughReturning","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MCEUnbalanceableError"},{"display_html":"data MockChainError where","name":"MockChainError OtherMockChainError FailWith MCEUnknownDatum MCEUnknownValidator MCEUnknownOutRefError MCECalcFee MCEGenerationError MCENoSuitableCollateral MCEValidationError MCEUnbalanceable","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MockChainError"},{"display_html":"allUtxos :: MonadBlockChainWithoutValidation m => m [(TxOutRef, TxOut)]","name":"allUtxos","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:allUtxos"},{"display_html":"utxosAt :: MonadBlockChainBalancing m => Address -> m [(TxOutRef, TxOut)]","name":"utxosAt","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxosAt"},{"display_html":"txOutByRef :: MonadBlockChainBalancing m => TxOutRef -> m (Maybe TxOut)","name":"txOutByRef","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:txOutByRef"},{"display_html":"utxosFromCardanoTx :: CardanoTx -> [(TxOutRef, TxOut)]","name":"utxosFromCardanoTx","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxosFromCardanoTx"},{"display_html":"txOutV2FromLedger :: TxOut -> TxOut","name":"txOutV2FromLedger","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:txOutV2FromLedger"},{"display_html":"resolveDatum :: (IsAbstractOutput out, ToOutputDatum (DatumType out), MonadBlockChainBalancing m) => out -> m (Maybe (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out)))","name":"resolveDatum","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:resolveDatum"},{"display_html":"resolveTypedDatum :: (IsAbstractOutput out, ToOutputDatum (DatumType out), MonadBlockChainBalancing m, FromData a) => out -> m (Maybe (ConcreteOutput (OwnerType out) a (ValueType out) (ReferenceScriptType out)))","name":"resolveTypedDatum","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:resolveTypedDatum"},{"display_html":"resolveValidator :: (IsAbstractOutput out, ToCredential (OwnerType out), MonadBlockChainBalancing m) => out -> m (Maybe (ConcreteOutput (Versioned Validator) (DatumType out) (ValueType out) (ReferenceScriptType out)))","name":"resolveValidator","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:resolveValidator"},{"display_html":"resolveReferenceScript :: (IsAbstractOutput out, ToScriptHash (ReferenceScriptType out), MonadBlockChainBalancing m) => out -> m (Maybe (ConcreteOutput (OwnerType out) (DatumType out) (ValueType out) (Versioned Validator)))","name":"resolveReferenceScript","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:resolveReferenceScript"},{"display_html":"outputDatumFromTxOutRef :: MonadBlockChainWithoutValidation m => TxOutRef -> m (Maybe OutputDatum)","name":"outputDatumFromTxOutRef","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:outputDatumFromTxOutRef"},{"display_html":"datumFromTxOutRef :: MonadBlockChainWithoutValidation m => TxOutRef -> m (Maybe Datum)","name":"datumFromTxOutRef","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:datumFromTxOutRef"},{"display_html":"typedDatumFromTxOutRef :: (FromData a, MonadBlockChainWithoutValidation m) => TxOutRef -> m (Maybe a)","name":"typedDatumFromTxOutRef","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:typedDatumFromTxOutRef"},{"display_html":"valueFromTxOutRef :: MonadBlockChainWithoutValidation m => TxOutRef -> m (Maybe Value)","name":"valueFromTxOutRef","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:valueFromTxOutRef"},{"display_html":"waitNSlots :: MonadBlockChainWithoutValidation m => Integer -> m Slot","name":"waitNSlots","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:waitNSlots"},{"display_html":"currentTime :: MonadBlockChainWithoutValidation m => m (POSIXTime, POSIXTime)","name":"currentTime","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:currentTime"},{"display_html":"slotToTimeInterval :: MonadBlockChainWithoutValidation m => Slot -> m (POSIXTime, POSIXTime)","name":"slotToTimeInterval","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:slotToTimeInterval"},{"display_html":"getEnclosingSlot :: MonadBlockChainWithoutValidation m => POSIXTime -> m Slot","name":"getEnclosingSlot","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:getEnclosingSlot"},{"display_html":"awaitEnclosingSlot :: MonadBlockChainWithoutValidation m => POSIXTime -> m Slot","name":"awaitEnclosingSlot","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:awaitEnclosingSlot"},{"display_html":"slotRangeBefore :: MonadBlockChainWithoutValidation m => POSIXTime -> m SlotRange","name":"slotRangeBefore","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:slotRangeBefore"},{"display_html":"slotRangeAfter :: MonadBlockChainWithoutValidation m => POSIXTime -> m SlotRange","name":"slotRangeAfter","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:slotRangeAfter"},{"display_html":"runUtxoSearch :: Monad m => UtxoSearch m a -> m [(TxOutRef, a)]","name":"runUtxoSearch","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runUtxoSearch"},{"display_html":"allUtxosSearch :: MonadBlockChain m => UtxoSearch m TxOut","name":"allUtxosSearch","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:allUtxosSearch"},{"display_html":"allUtxosLedgerSearch :: MonadBlockChain m => UtxoSearch m TxOut","name":"allUtxosLedgerSearch","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:allUtxosLedgerSearch"},{"display_html":"utxosAtSearch :: MonadBlockChainBalancing m => Address -> UtxoSearch m TxOut","name":"utxosAtSearch","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxosAtSearch"},{"display_html":"utxosAtLedgerSearch :: MonadBlockChainBalancing m => Address -> UtxoSearch m TxOut","name":"utxosAtLedgerSearch","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxosAtLedgerSearch"},{"display_html":"utxosFromCardanoTxSearch :: Monad m => CardanoTx -> UtxoSearch m TxOut","name":"utxosFromCardanoTxSearch","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxosFromCardanoTxSearch"},{"display_html":"txOutByRefSearch :: MonadBlockChainBalancing m => [TxOutRef] -> UtxoSearch m TxOut","name":"txOutByRefSearch","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:txOutByRefSearch"},{"display_html":"filterWith :: Monad m => UtxoSearch m a -> (a -> m (Maybe b)) -> UtxoSearch m b","name":"filterWith","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:filterWith"},{"display_html":"filterWithPure :: Monad m => UtxoSearch m a -> (a -> Maybe b) -> UtxoSearch m b","name":"filterWithPure","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:filterWithPure"},{"display_html":"filterWithOptic :: (Is k An_AffineFold, Monad m) => UtxoSearch m a -> Optic' k is a b -> UtxoSearch m b","name":"filterWithOptic","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:filterWithOptic"},{"display_html":"filterWithPred :: Monad m => UtxoSearch m a -> (a -> Bool) -> UtxoSearch m a","name":"filterWithPred","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:filterWithPred"},{"display_html":"balancedTxSkel :: MonadBlockChainBalancing m => TxSkel -> m (TxSkel, Fee, Set TxOutRef)","name":"balancedTxSkel","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:balancedTxSkel"},{"display_html":"balancedTx :: MonadBlockChainBalancing m => (TxSkel, Fee, Set TxOutRef) -> m (Tx BabbageEra)","name":"balancedTx","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:balancedTx"},{"display_html":"txSkelInputData :: MonadBlockChainBalancing m => TxSkel -> m (Map DatumHash Datum)","name":"txSkelInputData","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:txSkelInputData"},{"display_html":"type MockChain = MockChainT Identity","name":"MockChain","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MockChain"},{"display_html":"newtype MockChainT m a = MockChainT {}","name":"MockChainT MockChainT unMockChain","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MockChainT"},{"display_html":"newtype MockChainEnv = MockChainEnv {}","name":"MockChainEnv MockChainEnv mceParams","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MockChainEnv"},{"display_html":"data MockChainSt = MockChainSt {}","name":"MockChainSt MockChainSt mcstCurrentSlot mcstValidators mcstIndex mcstDatums","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MockChainSt"},{"display_html":"mcstToUtxoState :: MockChainSt -> UtxoState","name":"mcstToUtxoState","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:mcstToUtxoState"},{"display_html":"combineMockChainT :: Monad m => (forall a. m a -> m a -> m a) -> MockChainT m x -> MockChainT m x -> MockChainT m x","name":"combineMockChainT","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:combineMockChainT"},{"display_html":"mapMockChainT :: (m (Either MockChainError (a, MockChainSt)) -> n (Either MockChainError (b, MockChainSt))) -> MockChainT m a -> MockChainT n b","name":"mapMockChainT","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:mapMockChainT"},{"display_html":"runMockChainTRaw :: Monad m => MockChainEnv -> MockChainSt -> MockChainT m a -> m (Either MockChainError (a, MockChainSt))","name":"runMockChainTRaw","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainTRaw"},{"display_html":"runMockChainTFrom :: Monad m => InitialDistribution -> MockChainT m a -> m (Either MockChainError (a, UtxoState))","name":"runMockChainTFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainTFrom"},{"display_html":"runMockChainT :: Monad m => MockChainT m a -> m (Either MockChainError (a, UtxoState))","name":"runMockChainT","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainT"},{"display_html":"runMockChainRaw :: MockChainEnv -> MockChainSt -> MockChain a -> Either MockChainError (a, MockChainSt)","name":"runMockChainRaw","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainRaw"},{"display_html":"runMockChainFrom :: InitialDistribution -> MockChain a -> Either MockChainError (a, UtxoState)","name":"runMockChainFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainFrom"},{"display_html":"runMockChain :: MockChain a -> Either MockChainError (a, UtxoState)","name":"runMockChain","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChain"},{"display_html":"utxoState0 :: UtxoState","name":"utxoState0","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoState0"},{"display_html":"mockChainSt0 :: MockChainSt","name":"mockChainSt0","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:mockChainSt0"},{"display_html":"mockChainSt0From :: InitialDistribution -> MockChainSt","name":"mockChainSt0From","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:mockChainSt0From"},{"display_html":"utxoIndex0From :: InitialDistribution -> UtxoIndex","name":"utxoIndex0From","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoIndex0From"},{"display_html":"utxoIndex0 :: UtxoIndex","name":"utxoIndex0","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoIndex0"},{"display_html":"getIndex :: UtxoIndex -> Map TxOutRef TxOut","name":"getIndex","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:getIndex"},{"display_html":"runTransactionValidation :: Monad m => Params -> Tx BabbageEra -> [RawModTx] -> Map DatumHash Datum -> Map DatumHash TxSkelOutDatum -> Map ValidatorHash (Versioned Validator) -> MockChainT m CardanoTx","name":"runTransactionValidation","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runTransactionValidation"},{"display_html":"type MonadModalBlockChain m = (MonadBlockChain m, MonadModal m, Modification m ~ UntypedTweak InterpMockChain)","name":"MonadModalBlockChain","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MonadModalBlockChain"},{"display_html":"unMockChainLog :: MockChainLog -> [MockChainLogEntry]","name":"unMockChainLog","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:unMockChainLog"},{"display_html":"pattern MCLogFail :: String -> MockChainLogEntry","name":"MCLogFail","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:MCLogFail"},{"display_html":"pattern MCLogSubmittedTxSkel :: SkelContext -> TxSkel -> MockChainLogEntry","name":"MCLogSubmittedTxSkel","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:MCLogSubmittedTxSkel"},{"display_html":"pattern MCLogNewTx :: TxId -> MockChainLogEntry","name":"MCLogNewTx","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:MCLogNewTx"},{"display_html":"interpretAndRunWith :: (forall m. Monad m => MockChainT m a -> m res) -> StagedMockChain a -> [(res, MockChainLog)]","name":"interpretAndRunWith","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:interpretAndRunWith"},{"display_html":"interpretAndRun :: StagedMockChain a -> [(Either MockChainError (a, UtxoState), MockChainLog)]","name":"interpretAndRun","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:interpretAndRun"},{"display_html":"runTweak :: Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)]","name":"runTweak","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runTweak"},{"display_html":"runTweakFrom :: MockChainEnv -> MockChainSt -> Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)]","name":"runTweakFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runTweakFrom"},{"display_html":"somewhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a","name":"somewhere","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:somewhere"},{"display_html":"everywhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a","name":"everywhere","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:everywhere"},{"display_html":"withTweak :: MonadModalBlockChain m => m x -> Tweak InterpMockChain a -> m x","name":"withTweak","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:withTweak"},{"display_html":"class IsProp prop where","name":"IsProp testFailureMsg testSuccess testFailure testDisjoin testCounterexample testConjoin","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:IsProp"},{"display_html":"testBool :: IsProp prop => Bool -> prop","name":"testBool","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testBool"},{"display_html":"testAll :: IsProp prop => (a -> prop) -> [a] -> prop","name":"testAll","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testAll"},{"display_html":"(.==.) :: (IsProp prop, Eq a) => a -> a -> prop","name":".==.","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:.-61--61-."},{"display_html":"(.&&.) :: IsProp prop => prop -> prop -> prop","name":".&&.","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:.-38--38-."},{"display_html":"(.||.) :: IsProp prop => prop -> prop -> prop","name":".||.","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:.-124--124-."},{"display_html":"testSucceeds :: IsProp prop => PrettyCookedOpts -> StagedMockChain a -> prop","name":"testSucceeds","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testSucceeds"},{"display_html":"testFails :: (IsProp prop, Show a) => PrettyCookedOpts -> (MockChainError -> prop) -> StagedMockChain a -> prop","name":"testFails","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testFails"},{"display_html":"testSucceedsFrom :: IsProp prop => PrettyCookedOpts -> InitialDistribution -> StagedMockChain a -> prop","name":"testSucceedsFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testSucceedsFrom"},{"display_html":"testSucceedsFrom' :: IsProp prop => PrettyCookedOpts -> (a -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testSucceedsFrom'","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testSucceedsFrom-39-"},{"display_html":"testFailsFrom :: (IsProp prop, Show a) => PrettyCookedOpts -> (MockChainError -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testFailsFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testFailsFrom"},{"display_html":"isCekEvaluationFailure :: IsProp prop => PrettyCookedOpts -> MockChainError -> prop","name":"isCekEvaluationFailure","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:isCekEvaluationFailure"},{"display_html":"isCekEvaluationFailureWithMsg :: IsProp prop => PrettyCookedOpts -> (String -> Bool) -> MockChainError -> prop","name":"isCekEvaluationFailureWithMsg","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:isCekEvaluationFailureWithMsg"},{"display_html":"testAllSatisfiesFrom :: forall prop a. IsProp prop => PrettyCookedOpts -> (Either MockChainError (a, UtxoState) -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testAllSatisfiesFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testAllSatisfiesFrom"},{"display_html":"testBinaryRelatedBy :: IsProp prop => PrettyCookedOpts -> (UtxoState -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testBinaryRelatedBy","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testBinaryRelatedBy"},{"display_html":"testOneEquivClass :: IsProp prop => PrettyCookedOpts -> (UtxoState -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testOneEquivClass","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testOneEquivClass"},{"display_html":"testSatisfiesFrom' :: ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testSatisfiesFrom'","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testSatisfiesFrom-39-"},{"display_html":"assertionToMaybe :: Assertion -> IO (Maybe HUnitFailure)","name":"assertionToMaybe","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:assertionToMaybe"},{"display_html":"forAll :: Show a => Gen a -> (a -> Property) -> Property","name":"forAll","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:forAll"},{"display_html":"getValidityRangeTweak :: MonadTweak m => m SlotRange","name":"getValidityRangeTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:getValidityRangeTweak"},{"display_html":"setValidityRangeTweak :: MonadTweak m => SlotRange -> m SlotRange","name":"setValidityRangeTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:setValidityRangeTweak"},{"display_html":"setAlwaysValidRangeTweak :: MonadTweak m => m SlotRange","name":"setAlwaysValidRangeTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:setAlwaysValidRangeTweak"},{"display_html":"validityRangeSatisfiesTweak :: MonadTweak m => (SlotRange -> Bool) -> m Bool","name":"validityRangeSatisfiesTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:validityRangeSatisfiesTweak"},{"display_html":"isValidAtTweak :: MonadTweak m => Slot -> m Bool","name":"isValidAtTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:isValidAtTweak"},{"display_html":"isValidNowTweak :: MonadTweak m => m Bool","name":"isValidNowTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:isValidNowTweak"},{"display_html":"isValidDuringTweak :: MonadTweak m => SlotRange -> m Bool","name":"isValidDuringTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:isValidDuringTweak"},{"display_html":"hasEmptyTimeRangeTweak :: MonadTweak m => m Bool","name":"hasEmptyTimeRangeTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:hasEmptyTimeRangeTweak"},{"display_html":"hasFullTimeRangeTweak :: MonadTweak m => m Bool","name":"hasFullTimeRangeTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:hasFullTimeRangeTweak"},{"display_html":"intersectValidityRangeTweak :: MonadTweak m => SlotRange -> m SlotRange","name":"intersectValidityRangeTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:intersectValidityRangeTweak"},{"display_html":"centerAroundValidityRangeTweak :: MonadTweak m => Slot -> Integer -> m SlotRange","name":"centerAroundValidityRangeTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:centerAroundValidityRangeTweak"},{"display_html":"makeValidityRangeSingletonTweak :: MonadTweak m => Slot -> m SlotRange","name":"makeValidityRangeSingletonTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:makeValidityRangeSingletonTweak"},{"display_html":"makeValidityRangeNowTweak :: MonadTweak m => m SlotRange","name":"makeValidityRangeNowTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:makeValidityRangeNowTweak"},{"display_html":"waitUntilValidTweak :: MonadTweak m => m Slot","name":"waitUntilValidTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:waitUntilValidTweak"},{"display_html":"class (MonadPlus m, MonadBlockChainWithoutValidation m) => MonadTweak m where","name":"MonadTweak getTxSkel putTxSkel","module":"Cooked.Tweak","link":"Cooked-Tweak.html#t:MonadTweak"},{"display_html":"failingTweak :: MonadTweak m => m a","name":"failingTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:failingTweak"},{"display_html":"doNothingTweak :: MonadTweak m => m ()","name":"doNothingTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:doNothingTweak"},{"display_html":"viewTweak :: (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a","name":"viewTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:viewTweak"},{"display_html":"iviewTweak :: (MonadTweak m, Is k A_Getter) => Optic' k (WithIx is) TxSkel a -> m (is, a)","name":"iviewTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:iviewTweak"},{"display_html":"viewAllTweak :: (MonadTweak m, Is k A_Fold) => Optic' k is TxSkel a -> m [a]","name":"viewAllTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:viewAllTweak"},{"display_html":"setTweak :: (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> a -> m ()","name":"setTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:setTweak"},{"display_html":"overTweak :: (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> (a -> a) -> m ()","name":"overTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:overTweak"},{"display_html":"overMaybeTweak :: (MonadTweak m, Is k A_Traversal) => Optic' k is TxSkel a -> (a -> Maybe a) -> m [a]","name":"overMaybeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:overMaybeTweak"},{"display_html":"overMaybeSelectingTweak :: forall a m k is. (MonadTweak m, Is k A_Traversal) => Optic' k is TxSkel a -> (a -> Maybe a) -> (Integer -> Bool) -> m [a]","name":"overMaybeSelectingTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:overMaybeSelectingTweak"},{"display_html":"combineModsTweak :: (Eq is, Is k A_Traversal, MonadTweak m) => ([is] -> [[is]]) -> Optic' k (WithIx is) TxSkel x -> (is -> x -> m [(x, l)]) -> m [l]","name":"combineModsTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:combineModsTweak"},{"display_html":"selectP :: (a -> Bool) -> Prism' a a","name":"selectP","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:selectP"},{"display_html":"getSignersTweak :: MonadTweak m => m [Wallet]","name":"getSignersTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:getSignersTweak"},{"display_html":"modifySignersTweak :: MonadTweak m => ([Wallet] -> [Wallet]) -> m [Wallet]","name":"modifySignersTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:modifySignersTweak"},{"display_html":"setSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet]","name":"setSignersTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:setSignersTweak"},{"display_html":"signersSatisfyTweak :: MonadTweak m => ([Wallet] -> Bool) -> m Bool","name":"signersSatisfyTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:signersSatisfyTweak"},{"display_html":"isSignerTweak :: MonadTweak m => Wallet -> m Bool","name":"isSignerTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:isSignerTweak"},{"display_html":"hasSignersTweak :: MonadTweak m => m Bool","name":"hasSignersTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:hasSignersTweak"},{"display_html":"addFirstSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"addFirstSignerTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:addFirstSignerTweak"},{"display_html":"addSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet]","name":"addSignersTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:addSignersTweak"},{"display_html":"addLastSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"addLastSignerTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:addLastSignerTweak"},{"display_html":"removeSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet]","name":"removeSignersTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:removeSignersTweak"},{"display_html":"removeSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"removeSignerTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:removeSignerTweak"},{"display_html":"replaceFirstSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"replaceFirstSignerTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:replaceFirstSignerTweak"},{"display_html":"data PermutOutTweakMode","name":"PermutOutTweakMode KeepIdentity OmitIdentity","module":"Cooked.Tweak","link":"Cooked-Tweak.html#t:PermutOutTweakMode"},{"display_html":"allOutPermutsTweak :: MonadTweak m => PermutOutTweakMode -> m ()","name":"allOutPermutsTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:allOutPermutsTweak"},{"display_html":"singleOutPermutTweak :: MonadTweak m => Int -> m ()","name":"singleOutPermutTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:singleOutPermutTweak"},{"display_html":"addLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m ()","name":"addLabelTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:addLabelTweak"},{"display_html":"removeLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m ()","name":"removeLabelTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:removeLabelTweak"},{"display_html":"hasLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m Bool","name":"hasLabelTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:hasLabelTweak"},{"display_html":"data MalformDatumLbl = MalformDatumLbl","name":"MalformDatumLbl MalformDatumLbl","module":"Cooked.Tweak","link":"Cooked-Tweak.html#t:MalformDatumLbl"},{"display_html":"data TamperDatumLbl = TamperDatumLbl","name":"TamperDatumLbl TamperDatumLbl","module":"Cooked.Tweak","link":"Cooked-Tweak.html#t:TamperDatumLbl"},{"display_html":"tamperDatumTweak :: forall a m. (MonadTweak m, Show a, PrettyCooked a, ToData a, FromData a, Typeable a) => (a -> Maybe a) -> m [a]","name":"tamperDatumTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:tamperDatumTweak"},{"display_html":"malformDatumTweak :: forall a m. (MonadTweak m, ToData a, FromData a, Typeable a) => (a -> [BuiltinData]) -> m ()","name":"malformDatumTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:malformDatumTweak"},{"display_html":"ensureInputTweak :: MonadTweak m => TxOutRef -> TxSkelRedeemer -> m (Maybe (TxOutRef, TxSkelRedeemer))","name":"ensureInputTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:ensureInputTweak"},{"display_html":"addInputTweak :: MonadTweak m => TxOutRef -> TxSkelRedeemer -> m ()","name":"addInputTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:addInputTweak"},{"display_html":"removeInputTweak :: MonadTweak m => (TxOutRef -> TxSkelRedeemer -> Bool) -> m [(TxOutRef, TxSkelRedeemer)]","name":"removeInputTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:removeInputTweak"},{"display_html":"ensureOutputTweak :: MonadTweak m => TxSkelOut -> m (Maybe TxSkelOut)","name":"ensureOutputTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:ensureOutputTweak"},{"display_html":"addOutputTweak :: MonadTweak m => TxSkelOut -> m ()","name":"addOutputTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:addOutputTweak"},{"display_html":"removeOutputTweak :: MonadTweak m => (TxSkelOut -> Bool) -> m [TxSkelOut]","name":"removeOutputTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:removeOutputTweak"},{"display_html":"addMintTweak :: MonadTweak m => (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> m ()","name":"addMintTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:addMintTweak"},{"display_html":"removeMintTweak :: MonadTweak m => ((Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> Bool) -> m [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)]","name":"removeMintTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:removeMintTweak"},{"display_html":"getValidityRangeTweak :: MonadTweak m => m SlotRange","name":"getValidityRangeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:getValidityRangeTweak"},{"display_html":"setValidityRangeTweak :: MonadTweak m => SlotRange -> m SlotRange","name":"setValidityRangeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:setValidityRangeTweak"},{"display_html":"setAlwaysValidRangeTweak :: MonadTweak m => m SlotRange","name":"setAlwaysValidRangeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:setAlwaysValidRangeTweak"},{"display_html":"validityRangeSatisfiesTweak :: MonadTweak m => (SlotRange -> Bool) -> m Bool","name":"validityRangeSatisfiesTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:validityRangeSatisfiesTweak"},{"display_html":"isValidAtTweak :: MonadTweak m => Slot -> m Bool","name":"isValidAtTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:isValidAtTweak"},{"display_html":"isValidNowTweak :: MonadTweak m => m Bool","name":"isValidNowTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:isValidNowTweak"},{"display_html":"isValidDuringTweak :: MonadTweak m => SlotRange -> m Bool","name":"isValidDuringTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:isValidDuringTweak"},{"display_html":"hasEmptyTimeRangeTweak :: MonadTweak m => m Bool","name":"hasEmptyTimeRangeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:hasEmptyTimeRangeTweak"},{"display_html":"hasFullTimeRangeTweak :: MonadTweak m => m Bool","name":"hasFullTimeRangeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:hasFullTimeRangeTweak"},{"display_html":"intersectValidityRangeTweak :: MonadTweak m => SlotRange -> m SlotRange","name":"intersectValidityRangeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:intersectValidityRangeTweak"},{"display_html":"centerAroundValidityRangeTweak :: MonadTweak m => Slot -> Integer -> m SlotRange","name":"centerAroundValidityRangeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:centerAroundValidityRangeTweak"},{"display_html":"makeValidityRangeSingletonTweak :: MonadTweak m => Slot -> m SlotRange","name":"makeValidityRangeSingletonTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:makeValidityRangeSingletonTweak"},{"display_html":"makeValidityRangeNowTweak :: MonadTweak m => m SlotRange","name":"makeValidityRangeNowTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:makeValidityRangeNowTweak"},{"display_html":"waitUntilValidTweak :: MonadTweak m => m Slot","name":"waitUntilValidTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:waitUntilValidTweak"},{"display_html":"redirectScriptOutputTweak :: (MonadTweak m, Is k A_Traversal, Show (DatumType a), ToData (DatumType a)) => Optic' k is TxSkel (ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script)) -> (ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -> Maybe (TypedValidator a)) -> (Integer -> Bool) -> m [ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script)]","name":"redirectScriptOutputTweak","module":"Cooked.Attack.DatumHijacking","link":"Cooked-Attack-DatumHijacking.html#v:redirectScriptOutputTweak"},{"display_html":"datumHijackingAttack :: forall a m. (MonadTweak m, Show (DatumType a), PrettyCooked (DatumType a), ToData (DatumType a), Typeable (DatumType a), Typeable a) => (ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -> Bool) -> (Integer -> Bool) -> m [ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script)]","name":"datumHijackingAttack","module":"Cooked.Attack.DatumHijacking","link":"Cooked-Attack-DatumHijacking.html#v:datumHijackingAttack"},{"display_html":"newtype DatumHijackingLbl = DatumHijackingLbl Address","name":"DatumHijackingLbl DatumHijackingLbl","module":"Cooked.Attack.DatumHijacking","link":"Cooked-Attack-DatumHijacking.html#t:DatumHijackingLbl"},{"display_html":"datumHijackingTarget :: TypedValidator a","name":"datumHijackingTarget","module":"Cooked.Attack.DatumHijacking","link":"Cooked-Attack-DatumHijacking.html#v:datumHijackingTarget"},{"display_html":"dupTokenAttack :: MonadTweak m => (AssetClass -> Integer -> Integer) -> Wallet -> m Value","name":"dupTokenAttack","module":"Cooked.Attack.DupToken","link":"Cooked-Attack-DupToken.html#v:dupTokenAttack"},{"display_html":"data DupTokenLbl = DupTokenLbl","name":"DupTokenLbl DupTokenLbl","module":"Cooked.Attack.DupToken","link":"Cooked-Attack-DupToken.html#t:DupTokenLbl"},{"display_html":"type DoubleSatDelta = (Map TxOutRef TxSkelRedeemer, [TxSkelOut], TxSkelMints)","name":"DoubleSatDelta","module":"Cooked.Attack.DoubleSat","link":"Cooked-Attack-DoubleSat.html#t:DoubleSatDelta"},{"display_html":"data DoubleSatLbl = DoubleSatLbl","name":"DoubleSatLbl DoubleSatLbl","module":"Cooked.Attack.DoubleSat","link":"Cooked-Attack-DoubleSat.html#t:DoubleSatLbl"},{"display_html":"doubleSatAttack :: (MonadTweak m, Eq is, Is k A_Traversal) => ([is] -> [[is]]) -> Optic' k (WithIx is) TxSkel a -> (is -> a -> m [(a, DoubleSatDelta)]) -> Wallet -> m ()","name":"doubleSatAttack","module":"Cooked.Attack.DoubleSat","link":"Cooked-Attack-DoubleSat.html#v:doubleSatAttack"},{"display_html":"addTokenAttack :: MonadTweak m => (Versioned MintingPolicy -> [(TokenName, Integer)]) -> Wallet -> m Value","name":"addTokenAttack","module":"Cooked.Attack.AddToken","link":"Cooked-Attack-AddToken.html#v:addTokenAttack"},{"display_html":"newtype AddTokenLbl = AddTokenLbl TokenName","name":"AddTokenLbl AddTokenLbl","module":"Cooked.Attack.AddToken","link":"Cooked-Attack-AddToken.html#t:AddTokenLbl"},{"display_html":"module Cooked.Attack.DupToken","name":"","module":"Cooked.Attack","link":""},{"display_html":"module Cooked.Attack.DoubleSat","name":"","module":"Cooked.Attack","link":""},{"display_html":"module Cooked.Attack.DatumHijacking","name":"","module":"Cooked.Attack","link":""},{"display_html":"module Cooked.Attack.AddToken","name":"","module":"Cooked.Attack","link":""},{"display_html":"module Cooked.Wallet","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.ValueUtils","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.Tweak","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.Skeleton","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.ShowBS","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.RawUPLC","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.Pretty","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.Output","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.MockChain","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.Currencies","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.Attack","name":"","module":"Cooked","link":""},{"display_html":"class Monad m => MonadModal m where","name":"MonadModal Modification modifyLtl","module":"Cooked","link":"Cooked.html#t:MonadModal"},{"display_html":"data Ltl a","name":"Ltl LtlTruth LtlFalsity LtlAtom LtlOr LtlAnd LtlNext LtlUntil LtlRelease","module":"Cooked","link":"Cooked.html#t:Ltl"}] \ No newline at end of file +[{"display_html":"quickTokenName :: String -> TokenName","name":"quickTokenName","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:quickTokenName"},{"display_html":"quickAssetClass :: String -> AssetClass","name":"quickAssetClass","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:quickAssetClass"},{"display_html":"quickValue :: String -> Integer -> Value","name":"quickValue","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:quickValue"},{"display_html":"permanentTokenName :: String -> TokenName","name":"permanentTokenName","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:permanentTokenName"},{"display_html":"permanentAssetClass :: String -> AssetClass","name":"permanentAssetClass","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:permanentAssetClass"},{"display_html":"permanentValue :: String -> Integer -> Value","name":"permanentValue","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:permanentValue"},{"display_html":"quickCurrencyPolicy :: MintingPolicy","name":"quickCurrencyPolicy","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:quickCurrencyPolicy"},{"display_html":"quickCurrencySymbol :: CurrencySymbol","name":"quickCurrencySymbol","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:quickCurrencySymbol"},{"display_html":"permanentCurrencyPolicy :: MintingPolicy","name":"permanentCurrencyPolicy","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:permanentCurrencyPolicy"},{"display_html":"permanentCurrencySymbol :: CurrencySymbol","name":"permanentCurrencySymbol","module":"Cooked.Currencies","link":"Cooked-Currencies.html#v:permanentCurrencySymbol"},{"display_html":"data Ltl a","name":"Ltl LtlTruth LtlFalsity LtlAtom LtlOr LtlAnd LtlNext LtlUntil LtlRelease","module":"Cooked.Ltl","link":"Cooked-Ltl.html#t:Ltl"},{"display_html":"nowLater :: Monoid a => Ltl a -> [(a, Ltl a)]","name":"nowLater","module":"Cooked.Ltl","link":"Cooked-Ltl.html#v:nowLater"},{"display_html":"nowLaterList :: Monoid a => [Ltl a] -> [(a, [Ltl a])]","name":"nowLaterList","module":"Cooked.Ltl","link":"Cooked-Ltl.html#v:nowLaterList"},{"display_html":"data LtlOp (modification :: *) (builtin :: * -> *) :: * -> * where","name":"LtlOp Builtin StartLtl StopLtl","module":"Cooked.Ltl","link":"Cooked-Ltl.html#t:LtlOp"},{"display_html":"data Staged (op :: * -> *) :: * -> * where","name":"Staged Return Instr","module":"Cooked.Ltl","link":"Cooked-Ltl.html#t:Staged"},{"display_html":"interpLtl :: InterpLtl modification builtin m => Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a","name":"interpLtl","module":"Cooked.Ltl","link":"Cooked-Ltl.html#v:interpLtl"},{"display_html":"interpLtlAndPruneUnfinished :: InterpLtl modification builtin m => Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a","name":"interpLtlAndPruneUnfinished","module":"Cooked.Ltl","link":"Cooked-Ltl.html#v:interpLtlAndPruneUnfinished"},{"display_html":"class MonadPlus m => InterpLtl modification builtin m where","name":"InterpLtl interpBuiltin","module":"Cooked.Ltl","link":"Cooked-Ltl.html#t:InterpLtl"},{"display_html":"class Monad m => MonadModal m where","name":"MonadModal Modification modifyLtl","module":"Cooked.Ltl","link":"Cooked-Ltl.html#t:MonadModal"},{"display_html":"class IsAbstractOutput o","name":"IsAbstractOutput","module":"Cooked.Output","link":"Cooked-Output.html#t:IsAbstractOutput"},{"display_html":"type family OwnerType o","name":"OwnerType","module":"Cooked.Output","link":"Cooked-Output.html#t:OwnerType"},{"display_html":"type family DatumType o","name":"DatumType","module":"Cooked.Output","link":"Cooked-Output.html#t:DatumType"},{"display_html":"type family ValueType o","name":"ValueType","module":"Cooked.Output","link":"Cooked-Output.html#t:ValueType"},{"display_html":"type family ReferenceScriptType o","name":"ReferenceScriptType","module":"Cooked.Output","link":"Cooked-Output.html#t:ReferenceScriptType"},{"display_html":"outputOwnerL :: IsAbstractOutput o => Lens' o (OwnerType o)","name":"outputOwnerL","module":"Cooked.Output","link":"Cooked-Output.html#v:outputOwnerL"},{"display_html":"outputStakingCredentialL :: IsAbstractOutput o => Lens' o (Maybe StakingCredential)","name":"outputStakingCredentialL","module":"Cooked.Output","link":"Cooked-Output.html#v:outputStakingCredentialL"},{"display_html":"outputDatumL :: IsAbstractOutput o => Lens' o (DatumType o)","name":"outputDatumL","module":"Cooked.Output","link":"Cooked-Output.html#v:outputDatumL"},{"display_html":"outputValueL :: IsAbstractOutput o => Lens' o (ValueType o)","name":"outputValueL","module":"Cooked.Output","link":"Cooked-Output.html#v:outputValueL"},{"display_html":"outputReferenceScriptL :: IsAbstractOutput o => Lens' o (Maybe (ReferenceScriptType o))","name":"outputReferenceScriptL","module":"Cooked.Output","link":"Cooked-Output.html#v:outputReferenceScriptL"},{"display_html":"class ToCredential a where","name":"ToCredential toCredential","module":"Cooked.Output","link":"Cooked-Output.html#t:ToCredential"},{"display_html":"class ToOutputDatum a where","name":"ToOutputDatum toOutputDatum","module":"Cooked.Output","link":"Cooked-Output.html#t:ToOutputDatum"},{"display_html":"class ToValue a where","name":"ToValue toValue","module":"Cooked.Output","link":"Cooked-Output.html#t:ToValue"},{"display_html":"class ToScript a where","name":"ToScript toScript","module":"Cooked.Output","link":"Cooked-Output.html#t:ToScript"},{"display_html":"class ToScriptHash a where","name":"ToScriptHash toScriptHash","module":"Cooked.Output","link":"Cooked-Output.html#t:ToScriptHash"},{"display_html":"type IsTxInfoOutput o = (IsAbstractOutput o, ToCredential (OwnerType o), ToOutputDatum (DatumType o), ToValue (ValueType o), ToScriptHash (ReferenceScriptType o))","name":"IsTxInfoOutput","module":"Cooked.Output","link":"Cooked-Output.html#t:IsTxInfoOutput"},{"display_html":"outputAddress :: (IsAbstractOutput o, ToCredential (OwnerType o)) => o -> Address","name":"outputAddress","module":"Cooked.Output","link":"Cooked-Output.html#v:outputAddress"},{"display_html":"outputOutputDatum :: (IsAbstractOutput o, ToOutputDatum (DatumType o)) => o -> OutputDatum","name":"outputOutputDatum","module":"Cooked.Output","link":"Cooked-Output.html#v:outputOutputDatum"},{"display_html":"outputValue :: (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value","name":"outputValue","module":"Cooked.Output","link":"Cooked-Output.html#v:outputValue"},{"display_html":"outputReferenceScriptHash :: (IsAbstractOutput o, ToScriptHash (ReferenceScriptType o)) => o -> Maybe ScriptHash","name":"outputReferenceScriptHash","module":"Cooked.Output","link":"Cooked-Output.html#v:outputReferenceScriptHash"},{"display_html":"outputTxOut :: IsTxInfoOutput o => o -> TxOut","name":"outputTxOut","module":"Cooked.Output","link":"Cooked-Output.html#v:outputTxOut"},{"display_html":"data ConcreteOutput ownerType datumType valueType referenceScriptType where","name":"ConcreteOutput ConcreteOutput","module":"Cooked.Output","link":"Cooked-Output.html#t:ConcreteOutput"},{"display_html":"toOutputWithReferenceScriptHash :: (IsAbstractOutput output, ToScriptHash (ReferenceScriptType output)) => output -> ConcreteOutput (OwnerType output) (DatumType output) (ValueType output) ScriptHash","name":"toOutputWithReferenceScriptHash","module":"Cooked.Output","link":"Cooked-Output.html#v:toOutputWithReferenceScriptHash"},{"display_html":"isOutputWithoutDatum :: IsTxInfoOutput output => output -> Maybe (ConcreteOutput (OwnerType output) () (ValueType output) (ReferenceScriptType output))","name":"isOutputWithoutDatum","module":"Cooked.Output","link":"Cooked-Output.html#v:isOutputWithoutDatum"},{"display_html":"isOutputWithInlineDatum :: IsTxInfoOutput output => output -> Maybe (ConcreteOutput (OwnerType output) Datum (ValueType output) (ReferenceScriptType output))","name":"isOutputWithInlineDatum","module":"Cooked.Output","link":"Cooked-Output.html#v:isOutputWithInlineDatum"},{"display_html":"isOutputWithDatumHash :: IsTxInfoOutput output => output -> Maybe (ConcreteOutput (OwnerType output) DatumHash (ValueType output) (ReferenceScriptType output))","name":"isOutputWithDatumHash","module":"Cooked.Output","link":"Cooked-Output.html#v:isOutputWithDatumHash"},{"display_html":"isOutputWithInlineDatumOfType :: (FromData a, IsTxInfoOutput output) => output -> Maybe (ConcreteOutput (OwnerType output) a (ValueType output) (ReferenceScriptType output))","name":"isOutputWithInlineDatumOfType","module":"Cooked.Output","link":"Cooked-Output.html#v:isOutputWithInlineDatumOfType"},{"display_html":"isScriptOutputFrom :: IsTxInfoOutput output => TypedValidator a -> output -> Maybe (ConcreteOutput (TypedValidator a) (DatumType output) (ValueType output) (ReferenceScriptType output))","name":"isScriptOutputFrom","module":"Cooked.Output","link":"Cooked-Output.html#v:isScriptOutputFrom"},{"display_html":"isPKOutputFrom :: IsTxInfoOutput output => PubKeyHash -> output -> Maybe (ConcreteOutput PubKeyHash (DatumType output) (ValueType output) (ReferenceScriptType output))","name":"isPKOutputFrom","module":"Cooked.Output","link":"Cooked-Output.html#v:isPKOutputFrom"},{"display_html":"isOnlyAdaOutput :: IsTxInfoOutput output => output -> Maybe (ConcreteOutput (OwnerType output) (DatumType output) Ada (ReferenceScriptType output))","name":"isOnlyAdaOutput","module":"Cooked.Output","link":"Cooked-Output.html#v:isOnlyAdaOutput"},{"display_html":"type DocCooked = Doc ()","name":"DocCooked","module":"Cooked.Pretty.Common","link":"Cooked-Pretty-Common.html#t:DocCooked"},{"display_html":"renderString :: (a -> DocCooked) -> a -> String","name":"renderString","module":"Cooked.Pretty.Common","link":"Cooked-Pretty-Common.html#v:renderString"},{"display_html":"prettyItemize :: DocCooked -> DocCooked -> [DocCooked] -> DocCooked","name":"prettyItemize","module":"Cooked.Pretty.Common","link":"Cooked-Pretty-Common.html#v:prettyItemize"},{"display_html":"prettyItemizeNoTitle :: DocCooked -> [DocCooked] -> DocCooked","name":"prettyItemizeNoTitle","module":"Cooked.Pretty.Common","link":"Cooked-Pretty-Common.html#v:prettyItemizeNoTitle"},{"display_html":"prettyItemizeNonEmpty :: DocCooked -> DocCooked -> [DocCooked] -> Maybe DocCooked","name":"prettyItemizeNonEmpty","module":"Cooked.Pretty.Common","link":"Cooked-Pretty-Common.html#v:prettyItemizeNonEmpty"},{"display_html":"prettyEnumerate :: DocCooked -> DocCooked -> [DocCooked] -> DocCooked","name":"prettyEnumerate","module":"Cooked.Pretty.Common","link":"Cooked-Pretty-Common.html#v:prettyEnumerate"},{"display_html":"prettyHash :: Show a => Int -> a -> DocCooked","name":"prettyHash","module":"Cooked.Pretty.Common","link":"Cooked-Pretty-Common.html#v:prettyHash"},{"display_html":"data PrettyCookedOpts = PrettyCookedOpts {}","name":"PrettyCookedOpts PrettyCookedOpts pcOptPrintTxHashes pcOptPrintTxOutRefs pcOptPrintDefaultTxOpts pcOptPrintedHashLength pcOptNumericUnderscores","module":"Cooked.Pretty.Options","link":"Cooked-Pretty-Options.html#t:PrettyCookedOpts"},{"display_html":"data PCOptTxOutRefs","name":"PCOptTxOutRefs PCOptTxOutRefsHidden PCOptTxOutRefsFull PCOptTxOutRefsPartial","module":"Cooked.Pretty.Options","link":"Cooked-Pretty-Options.html#t:PCOptTxOutRefs"},{"display_html":"unsafeTypedValidatorFromUPLC :: forall a. Program NamedDeBruijn DefaultUni DefaultFun () -> TypedValidator a","name":"unsafeTypedValidatorFromUPLC","module":"Cooked.RawUPLC","link":"Cooked-RawUPLC.html#v:unsafeTypedValidatorFromUPLC"},{"display_html":"typedValidatorFromUPLC :: Program NamedDeBruijn DefaultUni DefaultFun () -> TypedValidator Any","name":"typedValidatorFromUPLC","module":"Cooked.RawUPLC","link":"Cooked-RawUPLC.html#v:typedValidatorFromUPLC"},{"display_html":"unsafeTypedValidatorFromBS :: forall a. ByteString -> Either String (TypedValidator a)","name":"unsafeTypedValidatorFromBS","module":"Cooked.RawUPLC","link":"Cooked-RawUPLC.html#v:unsafeTypedValidatorFromBS"},{"display_html":"typedValidatorFromBS :: ByteString -> Either String (TypedValidator Any)","name":"typedValidatorFromBS","module":"Cooked.RawUPLC","link":"Cooked-RawUPLC.html#v:typedValidatorFromBS"},{"display_html":"class ShowBS a where","name":"ShowBS showBS showBSsPrec","module":"Cooked.ShowBS","link":"Cooked-ShowBS.html#t:ShowBS"},{"display_html":"showBSs :: ShowBS a => a -> BuiltinString -> BuiltinString","name":"showBSs","module":"Cooked.ShowBS","link":"Cooked-ShowBS.html#v:showBSs"},{"display_html":"app_prec :: Integer","name":"app_prec","module":"Cooked.ShowBS","link":"Cooked-ShowBS.html#v:app_prec"},{"display_html":"flattenValueI :: Iso' Value [(AssetClass, Integer)]","name":"flattenValueI","module":"Cooked.ValueUtils","link":"Cooked-ValueUtils.html#v:flattenValueI"},{"display_html":"positivePart :: Value -> Value","name":"positivePart","module":"Cooked.ValueUtils","link":"Cooked-ValueUtils.html#v:positivePart"},{"display_html":"negativePart :: Value -> Value","name":"negativePart","module":"Cooked.ValueUtils","link":"Cooked-ValueUtils.html#v:negativePart"},{"display_html":"adaL :: Lens' Value Ada","name":"adaL","module":"Cooked.ValueUtils","link":"Cooked-ValueUtils.html#v:adaL"},{"display_html":"knownWallets :: [Wallet]","name":"knownWallets","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:knownWallets"},{"display_html":"wallet :: Int -> Wallet","name":"wallet","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:wallet"},{"display_html":"walletPKHashToId :: PubKeyHash -> Maybe Int","name":"walletPKHashToId","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletPKHashToId"},{"display_html":"walletPK :: Wallet -> PubKey","name":"walletPK","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletPK"},{"display_html":"walletStakingPK :: Wallet -> Maybe PubKey","name":"walletStakingPK","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletStakingPK"},{"display_html":"walletPKHash :: Wallet -> PubKeyHash","name":"walletPKHash","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletPKHash"},{"display_html":"walletStakingPKHash :: Wallet -> Maybe PubKeyHash","name":"walletStakingPKHash","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletStakingPKHash"},{"display_html":"walletAddress :: Wallet -> Address","name":"walletAddress","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletAddress"},{"display_html":"walletSK :: MockWallet -> PrivateKey","name":"walletSK","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletSK"},{"display_html":"walletStakingSK :: Wallet -> Maybe PrivateKey","name":"walletStakingSK","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:walletStakingSK"},{"display_html":"initialDistribution :: [(Wallet, [Value])] -> InitialDistribution","name":"initialDistribution","module":"Cooked.Wallet","link":"Cooked-Wallet.html#v:initialDistribution"},{"display_html":"newtype InitialDistribution = InitialDistribution {}","name":"InitialDistribution InitialDistribution unInitialDistribution","module":"Cooked.Wallet","link":"Cooked-Wallet.html#t:InitialDistribution"},{"display_html":"type Wallet = MockWallet","name":"Wallet","module":"Cooked.Wallet","link":"Cooked-Wallet.html#t:Wallet"},{"display_html":"type PrivateKey = XPrv","name":"PrivateKey","module":"Cooked.Wallet","link":"Cooked-Wallet.html#t:PrivateKey"},{"display_html":"class PrettyCooked a where","name":"PrettyCooked prettyCookedOpt prettyCooked","module":"Cooked.Pretty.Class","link":"Cooked-Pretty-Class.html#t:PrettyCooked"},{"display_html":"printCookedOpt :: PrettyCooked a => PrettyCookedOpts -> a -> IO ()","name":"printCookedOpt","module":"Cooked.Pretty.Class","link":"Cooked-Pretty-Class.html#v:printCookedOpt"},{"display_html":"printCooked :: PrettyCooked a => a -> IO ()","name":"printCooked","module":"Cooked.Pretty.Class","link":"Cooked-Pretty-Class.html#v:printCooked"},{"display_html":"type LabelConstrs x = (Show x, Typeable x, Eq x, Ord x)","name":"LabelConstrs","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:LabelConstrs"},{"display_html":"data TxLabel where","name":"TxLabel TxLabel","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxLabel"},{"display_html":"data BalanceOutputPolicy","name":"BalanceOutputPolicy AdjustExistingOutput DontAdjustExistingOutput","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:BalanceOutputPolicy"},{"display_html":"data BalancingWallet","name":"BalancingWallet BalanceWithFirstSigner BalanceWith","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:BalancingWallet"},{"display_html":"newtype RawModTx = RawModTxAfterBalancing (Tx BabbageEra -> Tx BabbageEra)","name":"RawModTx RawModTxAfterBalancing","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:RawModTx"},{"display_html":"newtype EmulatorParamsModification = EmulatorParamsModification (Params -> Params)","name":"EmulatorParamsModification EmulatorParamsModification","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:EmulatorParamsModification"},{"display_html":"data BalancingUtxos","name":"BalancingUtxos BalancingUtxosAll BalancingUtxosDatumless BalancingUtxosAllowlist BalancingUtxosBlocklist","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:BalancingUtxos"},{"display_html":"applyEmulatorParamsModification :: Maybe EmulatorParamsModification -> Params -> Params","name":"applyEmulatorParamsModification","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:applyEmulatorParamsModification"},{"display_html":"applyRawModOnBalancedTx :: [RawModTx] -> Tx BabbageEra -> Tx BabbageEra","name":"applyRawModOnBalancedTx","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:applyRawModOnBalancedTx"},{"display_html":"data TxOpts = TxOpts {}","name":"TxOpts TxOpts txOptEmulatorParamsModification txOptEnsureMinAda txOptAwaitTxConfirmed txOptAutoSlotIncrease txOptUnsafeModTx txOptBalance txOptBalanceOutputPolicy txOptBalanceWallet txOptBalancingUtxos","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxOpts"},{"display_html":"txOptEnsureMinAdaL :: Lens' TxOpts Bool","name":"txOptEnsureMinAdaL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptEnsureMinAdaL"},{"display_html":"txOptAwaitTxConfirmedL :: Lens' TxOpts Bool","name":"txOptAwaitTxConfirmedL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptAwaitTxConfirmedL"},{"display_html":"txOptAutoSlotIncreaseL :: Lens' TxOpts Bool","name":"txOptAutoSlotIncreaseL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptAutoSlotIncreaseL"},{"display_html":"txOptUnsafeModTxL :: Lens' TxOpts [RawModTx]","name":"txOptUnsafeModTxL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptUnsafeModTxL"},{"display_html":"txOptBalanceL :: Lens' TxOpts Bool","name":"txOptBalanceL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptBalanceL"},{"display_html":"txOptBalanceOutputPolicyL :: Lens' TxOpts BalanceOutputPolicy","name":"txOptBalanceOutputPolicyL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptBalanceOutputPolicyL"},{"display_html":"txOptBalanceWalletL :: Lens' TxOpts BalancingWallet","name":"txOptBalanceWalletL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptBalanceWalletL"},{"display_html":"txOptBalancingUtxosL :: Lens' TxOpts BalancingUtxos","name":"txOptBalancingUtxosL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptBalancingUtxosL"},{"display_html":"txOptEmulatorParamsModificationL :: Lens' TxOpts (Maybe EmulatorParamsModification)","name":"txOptEmulatorParamsModificationL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txOptEmulatorParamsModificationL"},{"display_html":"type MintsConstrs redeemer = (ToData redeemer, Show redeemer, PrettyCooked redeemer, Typeable redeemer)","name":"MintsConstrs","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:MintsConstrs"},{"display_html":"data MintsRedeemer where","name":"MintsRedeemer NoMintsRedeemer SomeMintsRedeemer","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:MintsRedeemer"},{"display_html":"type TxSkelMints = Map (Versioned MintingPolicy) (MintsRedeemer, NEMap TokenName (NonZero Integer))","name":"TxSkelMints","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxSkelMints"},{"display_html":"addToTxSkelMints :: (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> TxSkelMints -> TxSkelMints","name":"addToTxSkelMints","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:addToTxSkelMints"},{"display_html":"txSkelMintsToList :: TxSkelMints -> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)]","name":"txSkelMintsToList","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelMintsToList"},{"display_html":"txSkelMintsFromList :: [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -> TxSkelMints","name":"txSkelMintsFromList","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelMintsFromList"},{"display_html":"txSkelMintsValue :: TxSkelMints -> Value","name":"txSkelMintsValue","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelMintsValue"},{"display_html":"txSkelOutValueL :: Lens' TxSkelOut Value","name":"txSkelOutValueL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutValueL"},{"display_html":"txSkelOutDatumL :: Lens' TxSkelOut TxSkelOutDatum","name":"txSkelOutDatumL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutDatumL"},{"display_html":"txSkelOutValue :: TxSkelOut -> Value","name":"txSkelOutValue","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutValue"},{"display_html":"txSkelOutValidator :: TxSkelOut -> Maybe (Versioned Validator)","name":"txSkelOutValidator","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutValidator"},{"display_html":"type TxSkelOutDatumConstrs a = (Show a, PrettyCooked a, ToData a, Eq a, Typeable a)","name":"TxSkelOutDatumConstrs","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxSkelOutDatumConstrs"},{"display_html":"data TxSkelOutDatum where","name":"TxSkelOutDatum TxSkelOutDatum TxSkelOutNoDatum TxSkelOutDatumHash TxSkelOutInlineDatum","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxSkelOutDatum"},{"display_html":"data TxSkelOut where","name":"TxSkelOut Pays producedOutput","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxSkelOut"},{"display_html":"txSkelOutTypedDatum :: FromData a => TxSkelOutDatum -> Maybe a","name":"txSkelOutTypedDatum","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutTypedDatum"},{"display_html":"txSkelOutUntypedDatum :: TxSkelOutDatum -> Maybe Datum","name":"txSkelOutUntypedDatum","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutUntypedDatum"},{"display_html":"paysPK :: PubKeyHash -> Value -> TxSkelOut","name":"paysPK","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:paysPK"},{"display_html":"paysScript :: (ToData (DatumType a), Show (DatumType a), Typeable (DatumType a), Eq (DatumType a), PrettyCooked (DatumType a), Typeable a) => TypedValidator a -> DatumType a -> Value -> TxSkelOut","name":"paysScript","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:paysScript"},{"display_html":"paysScriptInlineDatum :: (ToData (DatumType a), Show (DatumType a), Typeable (DatumType a), Eq (DatumType a), PrettyCooked (DatumType a), Typeable a) => TypedValidator a -> DatumType a -> Value -> TxSkelOut","name":"paysScriptInlineDatum","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:paysScriptInlineDatum"},{"display_html":"paysScriptDatumHash :: (ToData (DatumType a), Show (DatumType a), Typeable (DatumType a), Eq (DatumType a), PrettyCooked (DatumType a), Typeable a) => TypedValidator a -> DatumType a -> Value -> TxSkelOut","name":"paysScriptDatumHash","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:paysScriptDatumHash"},{"display_html":"paysScriptNoDatum :: Typeable a => TypedValidator a -> Value -> TxSkelOut","name":"paysScriptNoDatum","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:paysScriptNoDatum"},{"display_html":"withDatum :: (ToData a, Show a, Typeable a, Eq a, PrettyCooked a) => TxSkelOut -> a -> TxSkelOut","name":"withDatum","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:withDatum"},{"display_html":"withInlineDatum :: (ToData a, Show a, Typeable a, Eq a, PrettyCooked a) => TxSkelOut -> a -> TxSkelOut","name":"withInlineDatum","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:withInlineDatum"},{"display_html":"withDatumHash :: (ToData a, Show a, Typeable a, Eq a, PrettyCooked a) => TxSkelOut -> a -> TxSkelOut","name":"withDatumHash","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:withDatumHash"},{"display_html":"withReferenceScript :: (Show script, ToScript script, Typeable script, ToScriptHash script) => TxSkelOut -> script -> TxSkelOut","name":"withReferenceScript","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:withReferenceScript"},{"display_html":"withStakingCredential :: TxSkelOut -> StakingCredential -> TxSkelOut","name":"withStakingCredential","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:withStakingCredential"},{"display_html":"data TxSkelRedeemer where","name":"TxSkelRedeemer TxSkelNoRedeemerForPK TxSkelRedeemerForScript TxSkelRedeemerForReferencedScript","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxSkelRedeemer"},{"display_html":"txSkelTypedRedeemer :: FromData (RedeemerType a) => TxSkelRedeemer -> Maybe (RedeemerType a)","name":"txSkelTypedRedeemer","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelTypedRedeemer"},{"display_html":"data TxSkel where","name":"TxSkel TxSkel txSkelLabel txSkelOpts txSkelMints txSkelSigners txSkelValidityRange txSkelIns txSkelInsReference txSkelOuts","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:TxSkel"},{"display_html":"txSkelLabelL :: Lens' TxSkel (Set TxLabel)","name":"txSkelLabelL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelLabelL"},{"display_html":"txSkelOptsL :: Lens' TxSkel TxOpts","name":"txSkelOptsL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOptsL"},{"display_html":"txSkelMintsL :: Lens' TxSkel TxSkelMints","name":"txSkelMintsL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelMintsL"},{"display_html":"txSkelValidityRangeL :: Lens' TxSkel SlotRange","name":"txSkelValidityRangeL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelValidityRangeL"},{"display_html":"txSkelSignersL :: Lens' TxSkel [Wallet]","name":"txSkelSignersL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelSignersL"},{"display_html":"txSkelInsL :: Lens' TxSkel (Map TxOutRef TxSkelRedeemer)","name":"txSkelInsL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelInsL"},{"display_html":"txSkelInsReferenceL :: Lens' TxSkel (Set TxOutRef)","name":"txSkelInsReferenceL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelInsReferenceL"},{"display_html":"txSkelOutsL :: Lens' TxSkel [TxSkelOut]","name":"txSkelOutsL","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutsL"},{"display_html":"txSkelTemplate :: TxSkel","name":"txSkelTemplate","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelTemplate"},{"display_html":"txSkelOutputData :: TxSkel -> Map DatumHash TxSkelOutDatum","name":"txSkelOutputData","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutputData"},{"display_html":"newtype Fee = Fee {}","name":"Fee Fee feeLovelace","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:Fee"},{"display_html":"txSkelOutputValue :: TxSkel -> Fee -> Value","name":"txSkelOutputValue","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutputValue"},{"display_html":"txSkelOutValidators :: TxSkel -> Map ValidatorHash (Versioned Validator)","name":"txSkelOutValidators","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutValidators"},{"display_html":"txSkelOutOwnerTypeP :: forall ownerType. (ToCredential ownerType, Show ownerType, IsTxSkelOutAllowedOwner ownerType, Typeable ownerType) => Prism' TxSkelOut (ConcreteOutput ownerType TxSkelOutDatum Value (Versioned Script))","name":"txSkelOutOwnerTypeP","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutOwnerTypeP"},{"display_html":"txSkelOutputDatumTypeAT :: (FromData a, Typeable a) => AffineTraversal' TxSkelOut a","name":"txSkelOutputDatumTypeAT","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutputDatumTypeAT"},{"display_html":"data SkelContext = SkelContext {}","name":"SkelContext SkelContext skelContextTxOuts skelContextTxSkelOutDatums","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#t:SkelContext"},{"display_html":"txSkelOutReferenceScripts :: TxSkel -> Map ValidatorHash (Versioned Validator)","name":"txSkelOutReferenceScripts","module":"Cooked.Skeleton","link":"Cooked-Skeleton.html#v:txSkelOutReferenceScripts"},{"display_html":"newtype UtxoState = UtxoState {}","name":"UtxoState UtxoState utxoState","module":"Cooked.MockChain.UtxoState","link":"Cooked-MockChain-UtxoState.html#t:UtxoState"},{"display_html":"newtype UtxoPayloadSet = UtxoPayloadSet {}","name":"UtxoPayloadSet UtxoPayloadSet utxoPayloadSet","module":"Cooked.MockChain.UtxoState","link":"Cooked-MockChain-UtxoState.html#t:UtxoPayloadSet"},{"display_html":"data UtxoPayload = UtxoPayload {}","name":"UtxoPayload UtxoPayload utxoPayloadTxOutRef utxoPayloadValue utxoPayloadSkelOutDatum utxoPayloadReferenceScript","module":"Cooked.MockChain.UtxoState","link":"Cooked-MockChain-UtxoState.html#t:UtxoPayload"},{"display_html":"holdsInState :: Address -> UtxoState -> Value","name":"holdsInState","module":"Cooked.MockChain.UtxoState","link":"Cooked-MockChain-UtxoState.html#v:holdsInState"},{"display_html":"data GenerateTxError","name":"GenerateTxError TxBodyError ToCardanoError GenerateTxErrorGeneral","module":"Cooked.MockChain.GenerateTx","link":"Cooked-MockChain-GenerateTx.html#t:GenerateTxError"},{"display_html":"data GenTxParams","name":"GenTxParams gtpCollateralIns gtpFee","module":"Cooked.MockChain.GenerateTx","link":"Cooked-MockChain-GenerateTx.html#t:GenTxParams"},{"display_html":"generateTxBodyContent :: GenTxParams -> Params -> Map DatumHash Datum -> Map TxOutRef TxOut -> Map ValidatorHash (Versioned Validator) -> TxSkel -> Either GenerateTxError (TxBodyContent BuildTx BabbageEra)","name":"generateTxBodyContent","module":"Cooked.MockChain.GenerateTx","link":"Cooked-MockChain-GenerateTx.html#v:generateTxBodyContent"},{"display_html":"txSkelOutToCardanoTxOut :: Params -> TxSkelOut -> Either GenerateTxError (TxOut CtxTx BabbageEra)","name":"txSkelOutToCardanoTxOut","module":"Cooked.MockChain.GenerateTx","link":"Cooked-MockChain-GenerateTx.html#v:txSkelOutToCardanoTxOut"},{"display_html":"generateTx :: GenTxParams -> Params -> Map DatumHash Datum -> Map TxOutRef TxOut -> Map ValidatorHash (Versioned Validator) -> TxSkel -> Either GenerateTxError (Tx BabbageEra)","name":"generateTx","module":"Cooked.MockChain.GenerateTx","link":"Cooked-MockChain-GenerateTx.html#v:generateTx"},{"display_html":"data MockChainError where","name":"MockChainError MCEValidationError MCEUnbalanceable MCENoSuitableCollateral MCEGenerationError MCECalcFee MCEUnknownOutRefError MCEUnknownValidator MCEUnknownDatum FailWith OtherMockChainError","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MockChainError"},{"display_html":"data MCEUnbalanceableError","name":"MCEUnbalanceableError MCEUnbalNotEnoughFunds MCEUnbalNotEnoughReturning","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MCEUnbalanceableError"},{"display_html":"class (MonadFail m, MonadError MockChainError m) => MonadBlockChainBalancing m where","name":"MonadBlockChainBalancing getParams datumFromHash utxosAtLedger validatorFromHash txOutByRefLedger","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MonadBlockChainBalancing"},{"display_html":"class MonadBlockChainBalancing m => MonadBlockChainWithoutValidation m where","name":"MonadBlockChainWithoutValidation awaitSlot currentSlot allUtxosLedger","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MonadBlockChainWithoutValidation"},{"display_html":"class MonadBlockChainWithoutValidation m => MonadBlockChain m where","name":"MonadBlockChain validateTxSkel","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MonadBlockChain"},{"display_html":"newtype AsTrans t (m :: Type -> Type) a = AsTrans {}","name":"AsTrans AsTrans getTrans","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:AsTrans"},{"display_html":"allUtxos :: MonadBlockChainWithoutValidation m => m [(TxOutRef, TxOut)]","name":"allUtxos","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:allUtxos"},{"display_html":"currentTime :: MonadBlockChainWithoutValidation m => m (POSIXTime, POSIXTime)","name":"currentTime","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:currentTime"},{"display_html":"waitNSlots :: MonadBlockChainWithoutValidation m => Integer -> m Slot","name":"waitNSlots","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:waitNSlots"},{"display_html":"utxosAt :: MonadBlockChainBalancing m => Address -> m [(TxOutRef, TxOut)]","name":"utxosAt","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:utxosAt"},{"display_html":"txOutByRef :: MonadBlockChainBalancing m => TxOutRef -> m (Maybe TxOut)","name":"txOutByRef","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:txOutByRef"},{"display_html":"utxosFromCardanoTx :: CardanoTx -> [(TxOutRef, TxOut)]","name":"utxosFromCardanoTx","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:utxosFromCardanoTx"},{"display_html":"txOutV2FromLedger :: TxOut -> TxOut","name":"txOutV2FromLedger","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:txOutV2FromLedger"},{"display_html":"typedDatumFromTxOutRef :: (FromData a, MonadBlockChainWithoutValidation m) => TxOutRef -> m (Maybe a)","name":"typedDatumFromTxOutRef","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:typedDatumFromTxOutRef"},{"display_html":"valueFromTxOutRef :: MonadBlockChainWithoutValidation m => TxOutRef -> m (Maybe Value)","name":"valueFromTxOutRef","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:valueFromTxOutRef"},{"display_html":"outputDatumFromTxOutRef :: MonadBlockChainWithoutValidation m => TxOutRef -> m (Maybe OutputDatum)","name":"outputDatumFromTxOutRef","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:outputDatumFromTxOutRef"},{"display_html":"datumFromTxOutRef :: MonadBlockChainWithoutValidation m => TxOutRef -> m (Maybe Datum)","name":"datumFromTxOutRef","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:datumFromTxOutRef"},{"display_html":"resolveDatum :: (IsAbstractOutput out, ToOutputDatum (DatumType out), MonadBlockChainBalancing m) => out -> m (Maybe (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out)))","name":"resolveDatum","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:resolveDatum"},{"display_html":"resolveTypedDatum :: (IsAbstractOutput out, ToOutputDatum (DatumType out), MonadBlockChainBalancing m, FromData a) => out -> m (Maybe (ConcreteOutput (OwnerType out) a (ValueType out) (ReferenceScriptType out)))","name":"resolveTypedDatum","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:resolveTypedDatum"},{"display_html":"resolveValidator :: (IsAbstractOutput out, ToCredential (OwnerType out), MonadBlockChainBalancing m) => out -> m (Maybe (ConcreteOutput (Versioned Validator) (DatumType out) (ValueType out) (ReferenceScriptType out)))","name":"resolveValidator","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:resolveValidator"},{"display_html":"resolveReferenceScript :: (IsAbstractOutput out, ToScriptHash (ReferenceScriptType out), MonadBlockChainBalancing m) => out -> m (Maybe (ConcreteOutput (OwnerType out) (DatumType out) (ValueType out) (Versioned Validator)))","name":"resolveReferenceScript","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:resolveReferenceScript"},{"display_html":"getEnclosingSlot :: MonadBlockChainWithoutValidation m => POSIXTime -> m Slot","name":"getEnclosingSlot","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:getEnclosingSlot"},{"display_html":"awaitEnclosingSlot :: MonadBlockChainWithoutValidation m => POSIXTime -> m Slot","name":"awaitEnclosingSlot","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:awaitEnclosingSlot"},{"display_html":"slotRangeBefore :: MonadBlockChainWithoutValidation m => POSIXTime -> m SlotRange","name":"slotRangeBefore","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:slotRangeBefore"},{"display_html":"slotRangeAfter :: MonadBlockChainWithoutValidation m => POSIXTime -> m SlotRange","name":"slotRangeAfter","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:slotRangeAfter"},{"display_html":"slotToTimeInterval :: MonadBlockChainWithoutValidation m => Slot -> m (POSIXTime, POSIXTime)","name":"slotToTimeInterval","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#v:slotToTimeInterval"},{"display_html":"runTweakInChain :: (MonadBlockChainWithoutValidation m, MonadPlus m) => Tweak m a -> TxSkel -> m (a, TxSkel)","name":"runTweakInChain","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:runTweakInChain"},{"display_html":"runTweakInChain' :: MonadBlockChainWithoutValidation m => Tweak m a -> TxSkel -> m [(a, TxSkel)]","name":"runTweakInChain'","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:runTweakInChain-39-"},{"display_html":"type Tweak m = StateT TxSkel (ListT m)","name":"Tweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#t:Tweak"},{"display_html":"data UntypedTweak m where","name":"UntypedTweak UntypedTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#t:UntypedTweak"},{"display_html":"class (MonadPlus m, MonadBlockChainWithoutValidation m) => MonadTweak m where","name":"MonadTweak getTxSkel putTxSkel","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#t:MonadTweak"},{"display_html":"failingTweak :: MonadTweak m => m a","name":"failingTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:failingTweak"},{"display_html":"doNothingTweak :: MonadTweak m => m ()","name":"doNothingTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:doNothingTweak"},{"display_html":"viewTweak :: (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a","name":"viewTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:viewTweak"},{"display_html":"viewAllTweak :: (MonadTweak m, Is k A_Fold) => Optic' k is TxSkel a -> m [a]","name":"viewAllTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:viewAllTweak"},{"display_html":"setTweak :: (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> a -> m ()","name":"setTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:setTweak"},{"display_html":"overTweak :: (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> (a -> a) -> m ()","name":"overTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:overTweak"},{"display_html":"overMaybeTweak :: (MonadTweak m, Is k A_Traversal) => Optic' k is TxSkel a -> (a -> Maybe a) -> m [a]","name":"overMaybeTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:overMaybeTweak"},{"display_html":"overMaybeSelectingTweak :: forall a m k is. (MonadTweak m, Is k A_Traversal) => Optic' k is TxSkel a -> (a -> Maybe a) -> (Integer -> Bool) -> m [a]","name":"overMaybeSelectingTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:overMaybeSelectingTweak"},{"display_html":"selectP :: (a -> Bool) -> Prism' a a","name":"selectP","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:selectP"},{"display_html":"combineModsTweak :: (Eq is, Is k A_Traversal, MonadTweak m) => ([is] -> [[is]]) -> Optic' k (WithIx is) TxSkel x -> (is -> x -> m [(x, l)]) -> m [l]","name":"combineModsTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:combineModsTweak"},{"display_html":"iviewTweak :: (MonadTweak m, Is k A_Getter) => Optic' k (WithIx is) TxSkel a -> m (is, a)","name":"iviewTweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#v:iviewTweak"},{"display_html":"getSignersTweak :: MonadTweak m => m [Wallet]","name":"getSignersTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:getSignersTweak"},{"display_html":"modifySignersTweak :: MonadTweak m => ([Wallet] -> [Wallet]) -> m [Wallet]","name":"modifySignersTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:modifySignersTweak"},{"display_html":"setSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet]","name":"setSignersTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:setSignersTweak"},{"display_html":"signersSatisfyTweak :: MonadTweak m => ([Wallet] -> Bool) -> m Bool","name":"signersSatisfyTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:signersSatisfyTweak"},{"display_html":"isSignerTweak :: MonadTweak m => Wallet -> m Bool","name":"isSignerTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:isSignerTweak"},{"display_html":"hasSignersTweak :: MonadTweak m => m Bool","name":"hasSignersTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:hasSignersTweak"},{"display_html":"addFirstSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"addFirstSignerTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:addFirstSignerTweak"},{"display_html":"addSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet]","name":"addSignersTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:addSignersTweak"},{"display_html":"addLastSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"addLastSignerTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:addLastSignerTweak"},{"display_html":"removeSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet]","name":"removeSignersTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:removeSignersTweak"},{"display_html":"removeSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"removeSignerTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:removeSignerTweak"},{"display_html":"replaceFirstSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"replaceFirstSignerTweak","module":"Cooked.Tweak.Signers","link":"Cooked-Tweak-Signers.html#v:replaceFirstSignerTweak"},{"display_html":"data PermutOutTweakMode","name":"PermutOutTweakMode KeepIdentity OmitIdentity","module":"Cooked.Tweak.OutPermutations","link":"Cooked-Tweak-OutPermutations.html#t:PermutOutTweakMode"},{"display_html":"allOutPermutsTweak :: MonadTweak m => PermutOutTweakMode -> m ()","name":"allOutPermutsTweak","module":"Cooked.Tweak.OutPermutations","link":"Cooked-Tweak-OutPermutations.html#v:allOutPermutsTweak"},{"display_html":"singleOutPermutTweak :: MonadTweak m => Int -> m ()","name":"singleOutPermutTweak","module":"Cooked.Tweak.OutPermutations","link":"Cooked-Tweak-OutPermutations.html#v:singleOutPermutTweak"},{"display_html":"distinctPermutations :: Eq a => [a] -> [[a]]","name":"distinctPermutations","module":"Cooked.Tweak.OutPermutations","link":"Cooked-Tweak-OutPermutations.html#v:distinctPermutations"},{"display_html":"addLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m ()","name":"addLabelTweak","module":"Cooked.Tweak.Labels","link":"Cooked-Tweak-Labels.html#v:addLabelTweak"},{"display_html":"removeLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m ()","name":"removeLabelTweak","module":"Cooked.Tweak.Labels","link":"Cooked-Tweak-Labels.html#v:removeLabelTweak"},{"display_html":"hasLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m Bool","name":"hasLabelTweak","module":"Cooked.Tweak.Labels","link":"Cooked-Tweak-Labels.html#v:hasLabelTweak"},{"display_html":"tamperDatumTweak :: forall a m. (MonadTweak m, Show a, PrettyCooked a, ToData a, FromData a, Typeable a) => (a -> Maybe a) -> m [a]","name":"tamperDatumTweak","module":"Cooked.Tweak.TamperDatum","link":"Cooked-Tweak-TamperDatum.html#v:tamperDatumTweak"},{"display_html":"data TamperDatumLbl = TamperDatumLbl","name":"TamperDatumLbl TamperDatumLbl","module":"Cooked.Tweak.TamperDatum","link":"Cooked-Tweak-TamperDatum.html#t:TamperDatumLbl"},{"display_html":"malformDatumTweak :: forall a m. (MonadTweak m, ToData a, FromData a, Typeable a) => (a -> [BuiltinData]) -> m ()","name":"malformDatumTweak","module":"Cooked.Tweak.TamperDatum","link":"Cooked-Tweak-TamperDatum.html#v:malformDatumTweak"},{"display_html":"data MalformDatumLbl = MalformDatumLbl","name":"MalformDatumLbl MalformDatumLbl","module":"Cooked.Tweak.TamperDatum","link":"Cooked-Tweak-TamperDatum.html#t:MalformDatumLbl"},{"display_html":"ensureInputTweak :: MonadTweak m => TxOutRef -> TxSkelRedeemer -> m (Maybe (TxOutRef, TxSkelRedeemer))","name":"ensureInputTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:ensureInputTweak"},{"display_html":"addInputTweak :: MonadTweak m => TxOutRef -> TxSkelRedeemer -> m ()","name":"addInputTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:addInputTweak"},{"display_html":"removeInputTweak :: MonadTweak m => (TxOutRef -> TxSkelRedeemer -> Bool) -> m [(TxOutRef, TxSkelRedeemer)]","name":"removeInputTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:removeInputTweak"},{"display_html":"ensureOutputTweak :: MonadTweak m => TxSkelOut -> m (Maybe TxSkelOut)","name":"ensureOutputTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:ensureOutputTweak"},{"display_html":"addOutputTweak :: MonadTweak m => TxSkelOut -> m ()","name":"addOutputTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:addOutputTweak"},{"display_html":"removeOutputTweak :: MonadTweak m => (TxSkelOut -> Bool) -> m [TxSkelOut]","name":"removeOutputTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:removeOutputTweak"},{"display_html":"addMintTweak :: MonadTweak m => (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> m ()","name":"addMintTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:addMintTweak"},{"display_html":"removeMintTweak :: MonadTweak m => ((Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> Bool) -> m [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)]","name":"removeMintTweak","module":"Cooked.Tweak.AddInputsAndOutputs","link":"Cooked-Tweak-AddInputsAndOutputs.html#v:removeMintTweak"},{"display_html":"runUtxoSearch :: Monad m => UtxoSearch m a -> m [(TxOutRef, a)]","name":"runUtxoSearch","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:runUtxoSearch"},{"display_html":"allUtxosSearch :: MonadBlockChain m => UtxoSearch m TxOut","name":"allUtxosSearch","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:allUtxosSearch"},{"display_html":"allUtxosLedgerSearch :: MonadBlockChain m => UtxoSearch m TxOut","name":"allUtxosLedgerSearch","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:allUtxosLedgerSearch"},{"display_html":"utxosAtSearch :: MonadBlockChainBalancing m => Address -> UtxoSearch m TxOut","name":"utxosAtSearch","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:utxosAtSearch"},{"display_html":"utxosAtLedgerSearch :: MonadBlockChainBalancing m => Address -> UtxoSearch m TxOut","name":"utxosAtLedgerSearch","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:utxosAtLedgerSearch"},{"display_html":"utxosFromCardanoTxSearch :: Monad m => CardanoTx -> UtxoSearch m TxOut","name":"utxosFromCardanoTxSearch","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:utxosFromCardanoTxSearch"},{"display_html":"txOutByRefSearch :: MonadBlockChainBalancing m => [TxOutRef] -> UtxoSearch m TxOut","name":"txOutByRefSearch","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:txOutByRefSearch"},{"display_html":"filterWith :: Monad m => UtxoSearch m a -> (a -> m (Maybe b)) -> UtxoSearch m b","name":"filterWith","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:filterWith"},{"display_html":"filterWithPure :: Monad m => UtxoSearch m a -> (a -> Maybe b) -> UtxoSearch m b","name":"filterWithPure","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:filterWithPure"},{"display_html":"filterWithOptic :: (Is k An_AffineFold, Monad m) => UtxoSearch m a -> Optic' k is a b -> UtxoSearch m b","name":"filterWithOptic","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:filterWithOptic"},{"display_html":"filterWithPred :: Monad m => UtxoSearch m a -> (a -> Bool) -> UtxoSearch m a","name":"filterWithPred","module":"Cooked.MockChain.UtxoSearch","link":"Cooked-MockChain-UtxoSearch.html#v:filterWithPred"},{"display_html":"balancedTxSkel :: MonadBlockChainBalancing m => TxSkel -> m (TxSkel, Fee, Set TxOutRef)","name":"balancedTxSkel","module":"Cooked.MockChain.Balancing","link":"Cooked-MockChain-Balancing.html#v:balancedTxSkel"},{"display_html":"balancedTx :: MonadBlockChainBalancing m => (TxSkel, Fee, Set TxOutRef) -> m (Tx BabbageEra)","name":"balancedTx","module":"Cooked.MockChain.Balancing","link":"Cooked-MockChain-Balancing.html#v:balancedTx"},{"display_html":"txSkelInputData :: MonadBlockChainBalancing m => TxSkel -> m (Map DatumHash Datum)","name":"txSkelInputData","module":"Cooked.MockChain.Balancing","link":"Cooked-MockChain-Balancing.html#v:txSkelInputData"},{"display_html":"mcstToUtxoState :: MockChainSt -> UtxoState","name":"mcstToUtxoState","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:mcstToUtxoState"},{"display_html":"data MockChainSt = MockChainSt {}","name":"MockChainSt MockChainSt mcstCurrentSlot mcstValidators mcstDatums mcstIndex","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#t:MockChainSt"},{"display_html":"newtype MockChainEnv = MockChainEnv {}","name":"MockChainEnv MockChainEnv mceParams","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#t:MockChainEnv"},{"display_html":"newtype MockChainT m a = MockChainT {}","name":"MockChainT MockChainT unMockChain","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#t:MockChainT"},{"display_html":"type MockChain = MockChainT Identity","name":"MockChain","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#t:MockChain"},{"display_html":"combineMockChainT :: Monad m => (forall a. m a -> m a -> m a) -> MockChainT m x -> MockChainT m x -> MockChainT m x","name":"combineMockChainT","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:combineMockChainT"},{"display_html":"mapMockChainT :: (m (Either MockChainError (a, MockChainSt)) -> n (Either MockChainError (b, MockChainSt))) -> MockChainT m a -> MockChainT n b","name":"mapMockChainT","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:mapMockChainT"},{"display_html":"runMockChainTRaw :: Monad m => MockChainEnv -> MockChainSt -> MockChainT m a -> m (Either MockChainError (a, MockChainSt))","name":"runMockChainTRaw","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainTRaw"},{"display_html":"runMockChainTFrom :: Monad m => InitialDistribution -> MockChainT m a -> m (Either MockChainError (a, UtxoState))","name":"runMockChainTFrom","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainTFrom"},{"display_html":"runMockChainT :: Monad m => MockChainT m a -> m (Either MockChainError (a, UtxoState))","name":"runMockChainT","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainT"},{"display_html":"runMockChainRaw :: MockChainEnv -> MockChainSt -> MockChain a -> Either MockChainError (a, MockChainSt)","name":"runMockChainRaw","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainRaw"},{"display_html":"runMockChainFrom :: InitialDistribution -> MockChain a -> Either MockChainError (a, UtxoState)","name":"runMockChainFrom","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainFrom"},{"display_html":"runMockChain :: MockChain a -> Either MockChainError (a, UtxoState)","name":"runMockChain","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChain"},{"display_html":"utxoState0 :: UtxoState","name":"utxoState0","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:utxoState0"},{"display_html":"mockChainSt0 :: MockChainSt","name":"mockChainSt0","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:mockChainSt0"},{"display_html":"mockChainSt0From :: InitialDistribution -> MockChainSt","name":"mockChainSt0From","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:mockChainSt0From"},{"display_html":"utxoIndex0From :: InitialDistribution -> UtxoIndex","name":"utxoIndex0From","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:utxoIndex0From"},{"display_html":"utxoIndex0 :: UtxoIndex","name":"utxoIndex0","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:utxoIndex0"},{"display_html":"getIndex :: UtxoIndex -> Map TxOutRef TxOut","name":"getIndex","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:getIndex"},{"display_html":"runTransactionValidation :: Monad m => Params -> Tx BabbageEra -> [RawModTx] -> Map DatumHash Datum -> Map DatumHash TxSkelOutDatum -> Map ValidatorHash (Versioned Validator) -> MockChainT m CardanoTx","name":"runTransactionValidation","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runTransactionValidation"},{"display_html":"interpretAndRunWith :: (forall m. Monad m => MockChainT m a -> m res) -> StagedMockChain a -> [(res, MockChainLog)]","name":"interpretAndRunWith","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:interpretAndRunWith"},{"display_html":"interpretAndRun :: StagedMockChain a -> [(Either MockChainError (a, UtxoState), MockChainLog)]","name":"interpretAndRun","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:interpretAndRun"},{"display_html":"data MockChainLogEntry","name":"MockChainLogEntry MCLogSubmittedTxSkel MCLogNewTx MCLogFail","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#t:MockChainLogEntry"},{"display_html":"newtype MockChainLog = MockChainLog {}","name":"MockChainLog MockChainLog unMockChainLog","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#t:MockChainLog"},{"display_html":"type StagedMockChain = Staged MockChainOp","name":"StagedMockChain","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#t:StagedMockChain"},{"display_html":"runTweakFrom :: MockChainEnv -> MockChainSt -> Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)]","name":"runTweakFrom","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:runTweakFrom"},{"display_html":"type MonadModalBlockChain m = (MonadBlockChain m, MonadModal m, Modification m ~ UntypedTweak InterpMockChain)","name":"MonadModalBlockChain","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#t:MonadModalBlockChain"},{"display_html":"somewhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a","name":"somewhere","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:somewhere"},{"display_html":"runTweak :: Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)]","name":"runTweak","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:runTweak"},{"display_html":"everywhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a","name":"everywhere","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:everywhere"},{"display_html":"withTweak :: MonadModalBlockChain m => m x -> Tweak InterpMockChain a -> m x","name":"withTweak","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:withTweak"},{"display_html":"there :: MonadModalBlockChain m => Integer -> Tweak InterpMockChain b -> m a -> m a","name":"there","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:there"},{"display_html":"prettyTxSkel :: PrettyCookedOpts -> SkelContext -> TxSkel -> DocCooked","name":"prettyTxSkel","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyTxSkel"},{"display_html":"prettyBalancingWallet :: PrettyCookedOpts -> Wallet -> DocCooked","name":"prettyBalancingWallet","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyBalancingWallet"},{"display_html":"prettySigners :: PrettyCookedOpts -> TxOpts -> [Wallet] -> [DocCooked]","name":"prettySigners","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettySigners"},{"display_html":"prettyMints :: PrettyCookedOpts -> (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> DocCooked","name":"prettyMints","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyMints"},{"display_html":"mPrettyTxOpts :: PrettyCookedOpts -> TxOpts -> Maybe DocCooked","name":"mPrettyTxOpts","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:mPrettyTxOpts"},{"display_html":"prettyTxSkelOut :: PrettyCookedOpts -> TxSkelOut -> DocCooked","name":"prettyTxSkelOut","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyTxSkelOut"},{"display_html":"prettyTxSkelOutDatumMaybe :: PrettyCookedOpts -> TxSkelOutDatum -> Maybe DocCooked","name":"prettyTxSkelOutDatumMaybe","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyTxSkelOutDatumMaybe"},{"display_html":"prettyTxSkelIn :: PrettyCookedOpts -> SkelContext -> (TxOutRef, TxSkelRedeemer) -> DocCooked","name":"prettyTxSkelIn","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyTxSkelIn"},{"display_html":"prettyTxSkelInReference :: PrettyCookedOpts -> SkelContext -> TxOutRef -> Maybe DocCooked","name":"prettyTxSkelInReference","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyTxSkelInReference"},{"display_html":"prettyAddressState :: PrettyCookedOpts -> Address -> UtxoPayloadSet -> DocCooked","name":"prettyAddressState","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyAddressState"},{"display_html":"prettyPayloadGrouped :: PrettyCookedOpts -> [UtxoPayload] -> Maybe DocCooked","name":"prettyPayloadGrouped","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyPayloadGrouped"},{"display_html":"prettyPayload :: PrettyCookedOpts -> Bool -> UtxoPayload -> Maybe DocCooked","name":"prettyPayload","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyPayload"},{"display_html":"prettyReferenceScriptHash :: PrettyCookedOpts -> ScriptHash -> DocCooked","name":"prettyReferenceScriptHash","module":"Cooked.Pretty.Cooked","link":"Cooked-Pretty-Cooked.html#v:prettyReferenceScriptHash"},{"display_html":"module Cooked.Pretty.Options","name":"","module":"Cooked.Pretty","link":""},{"display_html":"module Cooked.Pretty.Cooked","name":"","module":"Cooked.Pretty","link":""},{"display_html":"module Cooked.Pretty.Common","name":"","module":"Cooked.Pretty","link":""},{"display_html":"module Cooked.Pretty.Class","name":"","module":"Cooked.Pretty","link":""},{"display_html":"class IsProp prop where","name":"IsProp testFailureMsg testSuccess testFailure testDisjoin testConjoin testCounterexample","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#t:IsProp"},{"display_html":"testBool :: IsProp prop => Bool -> prop","name":"testBool","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testBool"},{"display_html":"testAll :: IsProp prop => (a -> prop) -> [a] -> prop","name":"testAll","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testAll"},{"display_html":"(.==.) :: (IsProp prop, Eq a) => a -> a -> prop","name":".==.","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:.-61--61-."},{"display_html":"(.&&.) :: IsProp prop => prop -> prop -> prop","name":".&&.","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:.-38--38-."},{"display_html":"(.||.) :: IsProp prop => prop -> prop -> prop","name":".||.","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:.-124--124-."},{"display_html":"testSucceeds :: IsProp prop => PrettyCookedOpts -> StagedMockChain a -> prop","name":"testSucceeds","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testSucceeds"},{"display_html":"testFails :: (IsProp prop, Show a) => PrettyCookedOpts -> (MockChainError -> prop) -> StagedMockChain a -> prop","name":"testFails","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testFails"},{"display_html":"testSucceedsFrom :: IsProp prop => PrettyCookedOpts -> InitialDistribution -> StagedMockChain a -> prop","name":"testSucceedsFrom","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testSucceedsFrom"},{"display_html":"testSucceedsFrom' :: IsProp prop => PrettyCookedOpts -> (a -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testSucceedsFrom'","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testSucceedsFrom-39-"},{"display_html":"testFailsFrom :: (IsProp prop, Show a) => PrettyCookedOpts -> (MockChainError -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testFailsFrom","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testFailsFrom"},{"display_html":"isCekEvaluationFailure :: IsProp prop => PrettyCookedOpts -> MockChainError -> prop","name":"isCekEvaluationFailure","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:isCekEvaluationFailure"},{"display_html":"isCekEvaluationFailureWithMsg :: IsProp prop => PrettyCookedOpts -> (String -> Bool) -> MockChainError -> prop","name":"isCekEvaluationFailureWithMsg","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:isCekEvaluationFailureWithMsg"},{"display_html":"testAllSatisfiesFrom :: forall prop a. IsProp prop => PrettyCookedOpts -> (Either MockChainError (a, UtxoState) -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testAllSatisfiesFrom","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testAllSatisfiesFrom"},{"display_html":"testBinaryRelatedBy :: IsProp prop => PrettyCookedOpts -> (UtxoState -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testBinaryRelatedBy","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testBinaryRelatedBy"},{"display_html":"testOneEquivClass :: IsProp prop => PrettyCookedOpts -> (UtxoState -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testOneEquivClass","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testOneEquivClass"},{"display_html":"testSatisfiesFrom' :: ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testSatisfiesFrom'","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:testSatisfiesFrom-39-"},{"display_html":"assertionToMaybe :: Assertion -> IO (Maybe HUnitFailure)","name":"assertionToMaybe","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:assertionToMaybe"},{"display_html":"forAll :: Show a => Gen a -> (a -> Property) -> Property","name":"forAll","module":"Cooked.MockChain.Testing","link":"Cooked-MockChain-Testing.html#v:forAll"},{"display_html":"utxoPayloadReferenceScript :: UtxoPayload -> Maybe ScriptHash","name":"utxoPayloadReferenceScript","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoPayloadReferenceScript"},{"display_html":"utxoPayloadSkelOutDatum :: UtxoPayload -> TxSkelOutDatum","name":"utxoPayloadSkelOutDatum","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoPayloadSkelOutDatum"},{"display_html":"utxoPayloadTxOutRef :: UtxoPayload -> TxOutRef","name":"utxoPayloadTxOutRef","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoPayloadTxOutRef"},{"display_html":"utxoPayloadValue :: UtxoPayload -> Value","name":"utxoPayloadValue","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoPayloadValue"},{"display_html":"utxoPayloadSet :: UtxoPayloadSet -> [UtxoPayload]","name":"utxoPayloadSet","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoPayloadSet"},{"display_html":"data UtxoState","name":"UtxoState","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:UtxoState"},{"display_html":"holdsInState :: Address -> UtxoState -> Value","name":"holdsInState","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:holdsInState"},{"display_html":"newtype AsTrans t (m :: Type -> Type) a = AsTrans {}","name":"AsTrans AsTrans getTrans","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:AsTrans"},{"display_html":"class MonadBlockChainWithoutValidation m => MonadBlockChain m where","name":"MonadBlockChain validateTxSkel","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MonadBlockChain"},{"display_html":"class MonadBlockChainBalancing m => MonadBlockChainWithoutValidation m where","name":"MonadBlockChainWithoutValidation allUtxosLedger awaitSlot currentSlot","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MonadBlockChainWithoutValidation"},{"display_html":"class (MonadFail m, MonadError MockChainError m) => MonadBlockChainBalancing m where","name":"MonadBlockChainBalancing txOutByRefLedger validatorFromHash utxosAtLedger getParams datumFromHash","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MonadBlockChainBalancing"},{"display_html":"data MCEUnbalanceableError","name":"MCEUnbalanceableError MCEUnbalNotEnoughFunds MCEUnbalNotEnoughReturning","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MCEUnbalanceableError"},{"display_html":"data MockChainError where","name":"MockChainError OtherMockChainError FailWith MCEUnknownDatum MCEUnknownValidator MCEUnknownOutRefError MCECalcFee MCEGenerationError MCENoSuitableCollateral MCEValidationError MCEUnbalanceable","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MockChainError"},{"display_html":"allUtxos :: MonadBlockChainWithoutValidation m => m [(TxOutRef, TxOut)]","name":"allUtxos","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:allUtxos"},{"display_html":"utxosAt :: MonadBlockChainBalancing m => Address -> m [(TxOutRef, TxOut)]","name":"utxosAt","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxosAt"},{"display_html":"txOutByRef :: MonadBlockChainBalancing m => TxOutRef -> m (Maybe TxOut)","name":"txOutByRef","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:txOutByRef"},{"display_html":"utxosFromCardanoTx :: CardanoTx -> [(TxOutRef, TxOut)]","name":"utxosFromCardanoTx","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxosFromCardanoTx"},{"display_html":"txOutV2FromLedger :: TxOut -> TxOut","name":"txOutV2FromLedger","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:txOutV2FromLedger"},{"display_html":"resolveDatum :: (IsAbstractOutput out, ToOutputDatum (DatumType out), MonadBlockChainBalancing m) => out -> m (Maybe (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out)))","name":"resolveDatum","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:resolveDatum"},{"display_html":"resolveTypedDatum :: (IsAbstractOutput out, ToOutputDatum (DatumType out), MonadBlockChainBalancing m, FromData a) => out -> m (Maybe (ConcreteOutput (OwnerType out) a (ValueType out) (ReferenceScriptType out)))","name":"resolveTypedDatum","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:resolveTypedDatum"},{"display_html":"resolveValidator :: (IsAbstractOutput out, ToCredential (OwnerType out), MonadBlockChainBalancing m) => out -> m (Maybe (ConcreteOutput (Versioned Validator) (DatumType out) (ValueType out) (ReferenceScriptType out)))","name":"resolveValidator","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:resolveValidator"},{"display_html":"resolveReferenceScript :: (IsAbstractOutput out, ToScriptHash (ReferenceScriptType out), MonadBlockChainBalancing m) => out -> m (Maybe (ConcreteOutput (OwnerType out) (DatumType out) (ValueType out) (Versioned Validator)))","name":"resolveReferenceScript","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:resolveReferenceScript"},{"display_html":"outputDatumFromTxOutRef :: MonadBlockChainWithoutValidation m => TxOutRef -> m (Maybe OutputDatum)","name":"outputDatumFromTxOutRef","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:outputDatumFromTxOutRef"},{"display_html":"datumFromTxOutRef :: MonadBlockChainWithoutValidation m => TxOutRef -> m (Maybe Datum)","name":"datumFromTxOutRef","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:datumFromTxOutRef"},{"display_html":"typedDatumFromTxOutRef :: (FromData a, MonadBlockChainWithoutValidation m) => TxOutRef -> m (Maybe a)","name":"typedDatumFromTxOutRef","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:typedDatumFromTxOutRef"},{"display_html":"valueFromTxOutRef :: MonadBlockChainWithoutValidation m => TxOutRef -> m (Maybe Value)","name":"valueFromTxOutRef","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:valueFromTxOutRef"},{"display_html":"waitNSlots :: MonadBlockChainWithoutValidation m => Integer -> m Slot","name":"waitNSlots","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:waitNSlots"},{"display_html":"currentTime :: MonadBlockChainWithoutValidation m => m (POSIXTime, POSIXTime)","name":"currentTime","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:currentTime"},{"display_html":"slotToTimeInterval :: MonadBlockChainWithoutValidation m => Slot -> m (POSIXTime, POSIXTime)","name":"slotToTimeInterval","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:slotToTimeInterval"},{"display_html":"getEnclosingSlot :: MonadBlockChainWithoutValidation m => POSIXTime -> m Slot","name":"getEnclosingSlot","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:getEnclosingSlot"},{"display_html":"awaitEnclosingSlot :: MonadBlockChainWithoutValidation m => POSIXTime -> m Slot","name":"awaitEnclosingSlot","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:awaitEnclosingSlot"},{"display_html":"slotRangeBefore :: MonadBlockChainWithoutValidation m => POSIXTime -> m SlotRange","name":"slotRangeBefore","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:slotRangeBefore"},{"display_html":"slotRangeAfter :: MonadBlockChainWithoutValidation m => POSIXTime -> m SlotRange","name":"slotRangeAfter","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:slotRangeAfter"},{"display_html":"runUtxoSearch :: Monad m => UtxoSearch m a -> m [(TxOutRef, a)]","name":"runUtxoSearch","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runUtxoSearch"},{"display_html":"allUtxosSearch :: MonadBlockChain m => UtxoSearch m TxOut","name":"allUtxosSearch","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:allUtxosSearch"},{"display_html":"allUtxosLedgerSearch :: MonadBlockChain m => UtxoSearch m TxOut","name":"allUtxosLedgerSearch","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:allUtxosLedgerSearch"},{"display_html":"utxosAtSearch :: MonadBlockChainBalancing m => Address -> UtxoSearch m TxOut","name":"utxosAtSearch","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxosAtSearch"},{"display_html":"utxosAtLedgerSearch :: MonadBlockChainBalancing m => Address -> UtxoSearch m TxOut","name":"utxosAtLedgerSearch","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxosAtLedgerSearch"},{"display_html":"utxosFromCardanoTxSearch :: Monad m => CardanoTx -> UtxoSearch m TxOut","name":"utxosFromCardanoTxSearch","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxosFromCardanoTxSearch"},{"display_html":"txOutByRefSearch :: MonadBlockChainBalancing m => [TxOutRef] -> UtxoSearch m TxOut","name":"txOutByRefSearch","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:txOutByRefSearch"},{"display_html":"filterWith :: Monad m => UtxoSearch m a -> (a -> m (Maybe b)) -> UtxoSearch m b","name":"filterWith","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:filterWith"},{"display_html":"filterWithPure :: Monad m => UtxoSearch m a -> (a -> Maybe b) -> UtxoSearch m b","name":"filterWithPure","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:filterWithPure"},{"display_html":"filterWithOptic :: (Is k An_AffineFold, Monad m) => UtxoSearch m a -> Optic' k is a b -> UtxoSearch m b","name":"filterWithOptic","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:filterWithOptic"},{"display_html":"filterWithPred :: Monad m => UtxoSearch m a -> (a -> Bool) -> UtxoSearch m a","name":"filterWithPred","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:filterWithPred"},{"display_html":"balancedTxSkel :: MonadBlockChainBalancing m => TxSkel -> m (TxSkel, Fee, Set TxOutRef)","name":"balancedTxSkel","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:balancedTxSkel"},{"display_html":"balancedTx :: MonadBlockChainBalancing m => (TxSkel, Fee, Set TxOutRef) -> m (Tx BabbageEra)","name":"balancedTx","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:balancedTx"},{"display_html":"txSkelInputData :: MonadBlockChainBalancing m => TxSkel -> m (Map DatumHash Datum)","name":"txSkelInputData","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:txSkelInputData"},{"display_html":"type MockChain = MockChainT Identity","name":"MockChain","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MockChain"},{"display_html":"newtype MockChainT m a = MockChainT {}","name":"MockChainT MockChainT unMockChain","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MockChainT"},{"display_html":"newtype MockChainEnv = MockChainEnv {}","name":"MockChainEnv MockChainEnv mceParams","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MockChainEnv"},{"display_html":"data MockChainSt = MockChainSt {}","name":"MockChainSt MockChainSt mcstCurrentSlot mcstValidators mcstIndex mcstDatums","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MockChainSt"},{"display_html":"mcstToUtxoState :: MockChainSt -> UtxoState","name":"mcstToUtxoState","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:mcstToUtxoState"},{"display_html":"combineMockChainT :: Monad m => (forall a. m a -> m a -> m a) -> MockChainT m x -> MockChainT m x -> MockChainT m x","name":"combineMockChainT","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:combineMockChainT"},{"display_html":"mapMockChainT :: (m (Either MockChainError (a, MockChainSt)) -> n (Either MockChainError (b, MockChainSt))) -> MockChainT m a -> MockChainT n b","name":"mapMockChainT","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:mapMockChainT"},{"display_html":"runMockChainTRaw :: Monad m => MockChainEnv -> MockChainSt -> MockChainT m a -> m (Either MockChainError (a, MockChainSt))","name":"runMockChainTRaw","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainTRaw"},{"display_html":"runMockChainTFrom :: Monad m => InitialDistribution -> MockChainT m a -> m (Either MockChainError (a, UtxoState))","name":"runMockChainTFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainTFrom"},{"display_html":"runMockChainT :: Monad m => MockChainT m a -> m (Either MockChainError (a, UtxoState))","name":"runMockChainT","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainT"},{"display_html":"runMockChainRaw :: MockChainEnv -> MockChainSt -> MockChain a -> Either MockChainError (a, MockChainSt)","name":"runMockChainRaw","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainRaw"},{"display_html":"runMockChainFrom :: InitialDistribution -> MockChain a -> Either MockChainError (a, UtxoState)","name":"runMockChainFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainFrom"},{"display_html":"runMockChain :: MockChain a -> Either MockChainError (a, UtxoState)","name":"runMockChain","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChain"},{"display_html":"utxoState0 :: UtxoState","name":"utxoState0","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoState0"},{"display_html":"mockChainSt0 :: MockChainSt","name":"mockChainSt0","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:mockChainSt0"},{"display_html":"mockChainSt0From :: InitialDistribution -> MockChainSt","name":"mockChainSt0From","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:mockChainSt0From"},{"display_html":"utxoIndex0From :: InitialDistribution -> UtxoIndex","name":"utxoIndex0From","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoIndex0From"},{"display_html":"utxoIndex0 :: UtxoIndex","name":"utxoIndex0","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:utxoIndex0"},{"display_html":"getIndex :: UtxoIndex -> Map TxOutRef TxOut","name":"getIndex","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:getIndex"},{"display_html":"runTransactionValidation :: Monad m => Params -> Tx BabbageEra -> [RawModTx] -> Map DatumHash Datum -> Map DatumHash TxSkelOutDatum -> Map ValidatorHash (Versioned Validator) -> MockChainT m CardanoTx","name":"runTransactionValidation","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runTransactionValidation"},{"display_html":"type MonadModalBlockChain m = (MonadBlockChain m, MonadModal m, Modification m ~ UntypedTweak InterpMockChain)","name":"MonadModalBlockChain","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MonadModalBlockChain"},{"display_html":"unMockChainLog :: MockChainLog -> [MockChainLogEntry]","name":"unMockChainLog","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:unMockChainLog"},{"display_html":"pattern MCLogFail :: String -> MockChainLogEntry","name":"MCLogFail","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:MCLogFail"},{"display_html":"pattern MCLogSubmittedTxSkel :: SkelContext -> TxSkel -> MockChainLogEntry","name":"MCLogSubmittedTxSkel","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:MCLogSubmittedTxSkel"},{"display_html":"pattern MCLogNewTx :: TxId -> MockChainLogEntry","name":"MCLogNewTx","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:MCLogNewTx"},{"display_html":"interpretAndRunWith :: (forall m. Monad m => MockChainT m a -> m res) -> StagedMockChain a -> [(res, MockChainLog)]","name":"interpretAndRunWith","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:interpretAndRunWith"},{"display_html":"interpretAndRun :: StagedMockChain a -> [(Either MockChainError (a, UtxoState), MockChainLog)]","name":"interpretAndRun","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:interpretAndRun"},{"display_html":"runTweak :: Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)]","name":"runTweak","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runTweak"},{"display_html":"runTweakFrom :: MockChainEnv -> MockChainSt -> Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)]","name":"runTweakFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runTweakFrom"},{"display_html":"somewhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a","name":"somewhere","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:somewhere"},{"display_html":"everywhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a","name":"everywhere","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:everywhere"},{"display_html":"there :: MonadModalBlockChain m => Integer -> Tweak InterpMockChain b -> m a -> m a","name":"there","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:there"},{"display_html":"withTweak :: MonadModalBlockChain m => m x -> Tweak InterpMockChain a -> m x","name":"withTweak","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:withTweak"},{"display_html":"class IsProp prop where","name":"IsProp testFailureMsg testSuccess testFailure testDisjoin testCounterexample testConjoin","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:IsProp"},{"display_html":"testBool :: IsProp prop => Bool -> prop","name":"testBool","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testBool"},{"display_html":"testAll :: IsProp prop => (a -> prop) -> [a] -> prop","name":"testAll","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testAll"},{"display_html":"(.==.) :: (IsProp prop, Eq a) => a -> a -> prop","name":".==.","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:.-61--61-."},{"display_html":"(.&&.) :: IsProp prop => prop -> prop -> prop","name":".&&.","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:.-38--38-."},{"display_html":"(.||.) :: IsProp prop => prop -> prop -> prop","name":".||.","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:.-124--124-."},{"display_html":"testSucceeds :: IsProp prop => PrettyCookedOpts -> StagedMockChain a -> prop","name":"testSucceeds","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testSucceeds"},{"display_html":"testFails :: (IsProp prop, Show a) => PrettyCookedOpts -> (MockChainError -> prop) -> StagedMockChain a -> prop","name":"testFails","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testFails"},{"display_html":"testSucceedsFrom :: IsProp prop => PrettyCookedOpts -> InitialDistribution -> StagedMockChain a -> prop","name":"testSucceedsFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testSucceedsFrom"},{"display_html":"testSucceedsFrom' :: IsProp prop => PrettyCookedOpts -> (a -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testSucceedsFrom'","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testSucceedsFrom-39-"},{"display_html":"testFailsFrom :: (IsProp prop, Show a) => PrettyCookedOpts -> (MockChainError -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testFailsFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testFailsFrom"},{"display_html":"isCekEvaluationFailure :: IsProp prop => PrettyCookedOpts -> MockChainError -> prop","name":"isCekEvaluationFailure","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:isCekEvaluationFailure"},{"display_html":"isCekEvaluationFailureWithMsg :: IsProp prop => PrettyCookedOpts -> (String -> Bool) -> MockChainError -> prop","name":"isCekEvaluationFailureWithMsg","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:isCekEvaluationFailureWithMsg"},{"display_html":"testAllSatisfiesFrom :: forall prop a. IsProp prop => PrettyCookedOpts -> (Either MockChainError (a, UtxoState) -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testAllSatisfiesFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testAllSatisfiesFrom"},{"display_html":"testBinaryRelatedBy :: IsProp prop => PrettyCookedOpts -> (UtxoState -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testBinaryRelatedBy","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testBinaryRelatedBy"},{"display_html":"testOneEquivClass :: IsProp prop => PrettyCookedOpts -> (UtxoState -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testOneEquivClass","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testOneEquivClass"},{"display_html":"testSatisfiesFrom' :: ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) -> InitialDistribution -> StagedMockChain a -> prop","name":"testSatisfiesFrom'","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:testSatisfiesFrom-39-"},{"display_html":"assertionToMaybe :: Assertion -> IO (Maybe HUnitFailure)","name":"assertionToMaybe","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:assertionToMaybe"},{"display_html":"forAll :: Show a => Gen a -> (a -> Property) -> Property","name":"forAll","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:forAll"},{"display_html":"getValidityRangeTweak :: MonadTweak m => m SlotRange","name":"getValidityRangeTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:getValidityRangeTweak"},{"display_html":"setValidityRangeTweak :: MonadTweak m => SlotRange -> m SlotRange","name":"setValidityRangeTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:setValidityRangeTweak"},{"display_html":"setAlwaysValidRangeTweak :: MonadTweak m => m SlotRange","name":"setAlwaysValidRangeTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:setAlwaysValidRangeTweak"},{"display_html":"validityRangeSatisfiesTweak :: MonadTweak m => (SlotRange -> Bool) -> m Bool","name":"validityRangeSatisfiesTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:validityRangeSatisfiesTweak"},{"display_html":"isValidAtTweak :: MonadTweak m => Slot -> m Bool","name":"isValidAtTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:isValidAtTweak"},{"display_html":"isValidNowTweak :: MonadTweak m => m Bool","name":"isValidNowTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:isValidNowTweak"},{"display_html":"isValidDuringTweak :: MonadTweak m => SlotRange -> m Bool","name":"isValidDuringTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:isValidDuringTweak"},{"display_html":"hasEmptyTimeRangeTweak :: MonadTweak m => m Bool","name":"hasEmptyTimeRangeTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:hasEmptyTimeRangeTweak"},{"display_html":"hasFullTimeRangeTweak :: MonadTweak m => m Bool","name":"hasFullTimeRangeTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:hasFullTimeRangeTweak"},{"display_html":"intersectValidityRangeTweak :: MonadTweak m => SlotRange -> m SlotRange","name":"intersectValidityRangeTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:intersectValidityRangeTweak"},{"display_html":"centerAroundValidityRangeTweak :: MonadTweak m => Slot -> Integer -> m SlotRange","name":"centerAroundValidityRangeTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:centerAroundValidityRangeTweak"},{"display_html":"makeValidityRangeSingletonTweak :: MonadTweak m => Slot -> m SlotRange","name":"makeValidityRangeSingletonTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:makeValidityRangeSingletonTweak"},{"display_html":"makeValidityRangeNowTweak :: MonadTweak m => m SlotRange","name":"makeValidityRangeNowTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:makeValidityRangeNowTweak"},{"display_html":"waitUntilValidTweak :: MonadTweak m => m Slot","name":"waitUntilValidTweak","module":"Cooked.Tweak.ValidityRange","link":"Cooked-Tweak-ValidityRange.html#v:waitUntilValidTweak"},{"display_html":"class (MonadPlus m, MonadBlockChainWithoutValidation m) => MonadTweak m where","name":"MonadTweak getTxSkel putTxSkel","module":"Cooked.Tweak","link":"Cooked-Tweak.html#t:MonadTweak"},{"display_html":"failingTweak :: MonadTweak m => m a","name":"failingTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:failingTweak"},{"display_html":"doNothingTweak :: MonadTweak m => m ()","name":"doNothingTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:doNothingTweak"},{"display_html":"viewTweak :: (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a","name":"viewTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:viewTweak"},{"display_html":"iviewTweak :: (MonadTweak m, Is k A_Getter) => Optic' k (WithIx is) TxSkel a -> m (is, a)","name":"iviewTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:iviewTweak"},{"display_html":"viewAllTweak :: (MonadTweak m, Is k A_Fold) => Optic' k is TxSkel a -> m [a]","name":"viewAllTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:viewAllTweak"},{"display_html":"setTweak :: (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> a -> m ()","name":"setTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:setTweak"},{"display_html":"overTweak :: (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> (a -> a) -> m ()","name":"overTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:overTweak"},{"display_html":"overMaybeTweak :: (MonadTweak m, Is k A_Traversal) => Optic' k is TxSkel a -> (a -> Maybe a) -> m [a]","name":"overMaybeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:overMaybeTweak"},{"display_html":"overMaybeSelectingTweak :: forall a m k is. (MonadTweak m, Is k A_Traversal) => Optic' k is TxSkel a -> (a -> Maybe a) -> (Integer -> Bool) -> m [a]","name":"overMaybeSelectingTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:overMaybeSelectingTweak"},{"display_html":"combineModsTweak :: (Eq is, Is k A_Traversal, MonadTweak m) => ([is] -> [[is]]) -> Optic' k (WithIx is) TxSkel x -> (is -> x -> m [(x, l)]) -> m [l]","name":"combineModsTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:combineModsTweak"},{"display_html":"selectP :: (a -> Bool) -> Prism' a a","name":"selectP","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:selectP"},{"display_html":"getSignersTweak :: MonadTweak m => m [Wallet]","name":"getSignersTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:getSignersTweak"},{"display_html":"modifySignersTweak :: MonadTweak m => ([Wallet] -> [Wallet]) -> m [Wallet]","name":"modifySignersTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:modifySignersTweak"},{"display_html":"setSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet]","name":"setSignersTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:setSignersTweak"},{"display_html":"signersSatisfyTweak :: MonadTweak m => ([Wallet] -> Bool) -> m Bool","name":"signersSatisfyTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:signersSatisfyTweak"},{"display_html":"isSignerTweak :: MonadTweak m => Wallet -> m Bool","name":"isSignerTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:isSignerTweak"},{"display_html":"hasSignersTweak :: MonadTweak m => m Bool","name":"hasSignersTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:hasSignersTweak"},{"display_html":"addFirstSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"addFirstSignerTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:addFirstSignerTweak"},{"display_html":"addSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet]","name":"addSignersTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:addSignersTweak"},{"display_html":"addLastSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"addLastSignerTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:addLastSignerTweak"},{"display_html":"removeSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet]","name":"removeSignersTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:removeSignersTweak"},{"display_html":"removeSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"removeSignerTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:removeSignerTweak"},{"display_html":"replaceFirstSignerTweak :: MonadTweak m => Wallet -> m [Wallet]","name":"replaceFirstSignerTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:replaceFirstSignerTweak"},{"display_html":"data PermutOutTweakMode","name":"PermutOutTweakMode KeepIdentity OmitIdentity","module":"Cooked.Tweak","link":"Cooked-Tweak.html#t:PermutOutTweakMode"},{"display_html":"allOutPermutsTweak :: MonadTweak m => PermutOutTweakMode -> m ()","name":"allOutPermutsTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:allOutPermutsTweak"},{"display_html":"singleOutPermutTweak :: MonadTweak m => Int -> m ()","name":"singleOutPermutTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:singleOutPermutTweak"},{"display_html":"addLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m ()","name":"addLabelTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:addLabelTweak"},{"display_html":"removeLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m ()","name":"removeLabelTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:removeLabelTweak"},{"display_html":"hasLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m Bool","name":"hasLabelTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:hasLabelTweak"},{"display_html":"data MalformDatumLbl = MalformDatumLbl","name":"MalformDatumLbl MalformDatumLbl","module":"Cooked.Tweak","link":"Cooked-Tweak.html#t:MalformDatumLbl"},{"display_html":"data TamperDatumLbl = TamperDatumLbl","name":"TamperDatumLbl TamperDatumLbl","module":"Cooked.Tweak","link":"Cooked-Tweak.html#t:TamperDatumLbl"},{"display_html":"tamperDatumTweak :: forall a m. (MonadTweak m, Show a, PrettyCooked a, ToData a, FromData a, Typeable a) => (a -> Maybe a) -> m [a]","name":"tamperDatumTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:tamperDatumTweak"},{"display_html":"malformDatumTweak :: forall a m. (MonadTweak m, ToData a, FromData a, Typeable a) => (a -> [BuiltinData]) -> m ()","name":"malformDatumTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:malformDatumTweak"},{"display_html":"ensureInputTweak :: MonadTweak m => TxOutRef -> TxSkelRedeemer -> m (Maybe (TxOutRef, TxSkelRedeemer))","name":"ensureInputTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:ensureInputTweak"},{"display_html":"addInputTweak :: MonadTweak m => TxOutRef -> TxSkelRedeemer -> m ()","name":"addInputTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:addInputTweak"},{"display_html":"removeInputTweak :: MonadTweak m => (TxOutRef -> TxSkelRedeemer -> Bool) -> m [(TxOutRef, TxSkelRedeemer)]","name":"removeInputTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:removeInputTweak"},{"display_html":"ensureOutputTweak :: MonadTweak m => TxSkelOut -> m (Maybe TxSkelOut)","name":"ensureOutputTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:ensureOutputTweak"},{"display_html":"addOutputTweak :: MonadTweak m => TxSkelOut -> m ()","name":"addOutputTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:addOutputTweak"},{"display_html":"removeOutputTweak :: MonadTweak m => (TxSkelOut -> Bool) -> m [TxSkelOut]","name":"removeOutputTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:removeOutputTweak"},{"display_html":"addMintTweak :: MonadTweak m => (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> m ()","name":"addMintTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:addMintTweak"},{"display_html":"removeMintTweak :: MonadTweak m => ((Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> Bool) -> m [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)]","name":"removeMintTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:removeMintTweak"},{"display_html":"getValidityRangeTweak :: MonadTweak m => m SlotRange","name":"getValidityRangeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:getValidityRangeTweak"},{"display_html":"setValidityRangeTweak :: MonadTweak m => SlotRange -> m SlotRange","name":"setValidityRangeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:setValidityRangeTweak"},{"display_html":"setAlwaysValidRangeTweak :: MonadTweak m => m SlotRange","name":"setAlwaysValidRangeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:setAlwaysValidRangeTweak"},{"display_html":"validityRangeSatisfiesTweak :: MonadTweak m => (SlotRange -> Bool) -> m Bool","name":"validityRangeSatisfiesTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:validityRangeSatisfiesTweak"},{"display_html":"isValidAtTweak :: MonadTweak m => Slot -> m Bool","name":"isValidAtTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:isValidAtTweak"},{"display_html":"isValidNowTweak :: MonadTweak m => m Bool","name":"isValidNowTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:isValidNowTweak"},{"display_html":"isValidDuringTweak :: MonadTweak m => SlotRange -> m Bool","name":"isValidDuringTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:isValidDuringTweak"},{"display_html":"hasEmptyTimeRangeTweak :: MonadTweak m => m Bool","name":"hasEmptyTimeRangeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:hasEmptyTimeRangeTweak"},{"display_html":"hasFullTimeRangeTweak :: MonadTweak m => m Bool","name":"hasFullTimeRangeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:hasFullTimeRangeTweak"},{"display_html":"intersectValidityRangeTweak :: MonadTweak m => SlotRange -> m SlotRange","name":"intersectValidityRangeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:intersectValidityRangeTweak"},{"display_html":"centerAroundValidityRangeTweak :: MonadTweak m => Slot -> Integer -> m SlotRange","name":"centerAroundValidityRangeTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:centerAroundValidityRangeTweak"},{"display_html":"makeValidityRangeSingletonTweak :: MonadTweak m => Slot -> m SlotRange","name":"makeValidityRangeSingletonTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:makeValidityRangeSingletonTweak"},{"display_html":"makeValidityRangeNowTweak :: MonadTweak m => m SlotRange","name":"makeValidityRangeNowTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:makeValidityRangeNowTweak"},{"display_html":"waitUntilValidTweak :: MonadTweak m => m Slot","name":"waitUntilValidTweak","module":"Cooked.Tweak","link":"Cooked-Tweak.html#v:waitUntilValidTweak"},{"display_html":"redirectScriptOutputTweak :: (MonadTweak m, Is k A_Traversal, Show (DatumType a), ToData (DatumType a)) => Optic' k is TxSkel (ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script)) -> (ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -> Maybe (TypedValidator a)) -> (Integer -> Bool) -> m [ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script)]","name":"redirectScriptOutputTweak","module":"Cooked.Attack.DatumHijacking","link":"Cooked-Attack-DatumHijacking.html#v:redirectScriptOutputTweak"},{"display_html":"datumHijackingAttack :: forall a m. (MonadTweak m, Show (DatumType a), PrettyCooked (DatumType a), ToData (DatumType a), Typeable (DatumType a), Typeable a) => (ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -> Bool) -> (Integer -> Bool) -> m [ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script)]","name":"datumHijackingAttack","module":"Cooked.Attack.DatumHijacking","link":"Cooked-Attack-DatumHijacking.html#v:datumHijackingAttack"},{"display_html":"newtype DatumHijackingLbl = DatumHijackingLbl Address","name":"DatumHijackingLbl DatumHijackingLbl","module":"Cooked.Attack.DatumHijacking","link":"Cooked-Attack-DatumHijacking.html#t:DatumHijackingLbl"},{"display_html":"datumHijackingTarget :: TypedValidator a","name":"datumHijackingTarget","module":"Cooked.Attack.DatumHijacking","link":"Cooked-Attack-DatumHijacking.html#v:datumHijackingTarget"},{"display_html":"dupTokenAttack :: MonadTweak m => (AssetClass -> Integer -> Integer) -> Wallet -> m Value","name":"dupTokenAttack","module":"Cooked.Attack.DupToken","link":"Cooked-Attack-DupToken.html#v:dupTokenAttack"},{"display_html":"data DupTokenLbl = DupTokenLbl","name":"DupTokenLbl DupTokenLbl","module":"Cooked.Attack.DupToken","link":"Cooked-Attack-DupToken.html#t:DupTokenLbl"},{"display_html":"type DoubleSatDelta = (Map TxOutRef TxSkelRedeemer, [TxSkelOut], TxSkelMints)","name":"DoubleSatDelta","module":"Cooked.Attack.DoubleSat","link":"Cooked-Attack-DoubleSat.html#t:DoubleSatDelta"},{"display_html":"data DoubleSatLbl = DoubleSatLbl","name":"DoubleSatLbl DoubleSatLbl","module":"Cooked.Attack.DoubleSat","link":"Cooked-Attack-DoubleSat.html#t:DoubleSatLbl"},{"display_html":"doubleSatAttack :: (MonadTweak m, Eq is, Is k A_Traversal) => ([is] -> [[is]]) -> Optic' k (WithIx is) TxSkel a -> (is -> a -> m [(a, DoubleSatDelta)]) -> Wallet -> m ()","name":"doubleSatAttack","module":"Cooked.Attack.DoubleSat","link":"Cooked-Attack-DoubleSat.html#v:doubleSatAttack"},{"display_html":"addTokenAttack :: MonadTweak m => (Versioned MintingPolicy -> [(TokenName, Integer)]) -> Wallet -> m Value","name":"addTokenAttack","module":"Cooked.Attack.AddToken","link":"Cooked-Attack-AddToken.html#v:addTokenAttack"},{"display_html":"newtype AddTokenLbl = AddTokenLbl TokenName","name":"AddTokenLbl AddTokenLbl","module":"Cooked.Attack.AddToken","link":"Cooked-Attack-AddToken.html#t:AddTokenLbl"},{"display_html":"module Cooked.Attack.DupToken","name":"","module":"Cooked.Attack","link":""},{"display_html":"module Cooked.Attack.DoubleSat","name":"","module":"Cooked.Attack","link":""},{"display_html":"module Cooked.Attack.DatumHijacking","name":"","module":"Cooked.Attack","link":""},{"display_html":"module Cooked.Attack.AddToken","name":"","module":"Cooked.Attack","link":""},{"display_html":"module Cooked.Wallet","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.ValueUtils","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.Tweak","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.Skeleton","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.ShowBS","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.RawUPLC","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.Pretty","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.Output","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.MockChain","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.Currencies","name":"","module":"Cooked","link":""},{"display_html":"module Cooked.Attack","name":"","module":"Cooked","link":""},{"display_html":"class Monad m => MonadModal m where","name":"MonadModal Modification modifyLtl","module":"Cooked","link":"Cooked.html#t:MonadModal"},{"display_html":"data Ltl a","name":"Ltl LtlTruth LtlFalsity LtlAtom LtlOr LtlAnd LtlNext LtlUntil LtlRelease","module":"Cooked","link":"Cooked.html#t:Ltl"}] \ No newline at end of file diff --git a/src/Cooked.Attack.AddToken.html b/src/Cooked.Attack.AddToken.html index 4bd89f6ea..a2516710e 100644 --- a/src/Cooked.Attack.AddToken.html +++ b/src/Cooked.Attack.AddToken.html @@ -17,8 +17,8 @@ -- -- This attack adds an 'AddTokenLbl' with the token name of the additional -- minted token(s). It returns additional value minted. -addTokenAttack :: - MonadTweak m => +addTokenAttack :: + MonadTweak m => -- | For each policy that occurs in some 'Mints' constraint, return a list of -- token names together with how many tokens with that name should be -- minted. @@ -33,14 +33,14 @@ (Pl.Versioned Pl.MintingPolicy -> [(Pl.TokenName, Integer)]) -> -- | The wallet of the attacker. Any extra tokens will be paid to this wallet. Wallet -> - m Pl.Value + m Pl.Value addTokenAttack :: (Versioned MintingPolicy -> [(TokenName, Integer)]) -> Wallet -> m Value -addTokenAttack Versioned MintingPolicy -> [(TokenName, Integer)] -extraTokens Wallet -attacker = do - TxSkelMints -oldMints <- Optic' A_Lens NoIx TxSkel TxSkelMints -> m TxSkelMints +addTokenAttack Versioned MintingPolicy -> [(TokenName, Integer)] +extraTokens Wallet +attacker = do + TxSkelMints +oldMints <- Optic' A_Lens NoIx TxSkel TxSkelMints -> m TxSkelMints forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a @@ -61,9 +61,9 @@ -> [m Value] forall a b. (a -> b) -> [a] -> [b] map - ( \(Versioned MintingPolicy -policy, (MintsRedeemer -redeemer, NEMap TokenName (NonZero Integer) + ( \(Versioned MintingPolicy +policy, (MintsRedeemer +redeemer, NEMap TokenName (NonZero Integer) _)) -> [m Value] -> m Value forall (t :: * -> *) (m :: * -> *) a. @@ -76,32 +76,32 @@ -> [(TokenName, Integer)] -> [m Value] forall a b. (a -> b) -> [a] -> [b] map - ( \(TokenName -tName, Integer -amount) -> - let newMints :: TxSkelMints -newMints = (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) + ( \(TokenName +tName, Integer +amount) -> + let newMints :: TxSkelMints +newMints = (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> TxSkelMints -> TxSkelMints addToTxSkelMints (Versioned MintingPolicy -policy, MintsRedeemer -redeemer, TokenName -tName, Integer -amount) TxSkelMints -oldMints - increment :: Value -increment = +policy, MintsRedeemer +redeemer, TokenName +tName, Integer +amount) TxSkelMints +oldMints + increment :: Value +increment = TxSkelMints -> Value txSkelMintsValue TxSkelMints -newMints +newMints Value -> Value -> Value forall a. Semigroup a => a -> a -> a <> Value -> Value forall a. AdditiveGroup a => a -> a Pl.negate (TxSkelMints -> Value txSkelMintsValue TxSkelMints -oldMints) +oldMints) in if Value -increment Value -> Value -> Bool +increment Value -> Value -> Bool `Pl.geq` Value forall a. Monoid a => a mempty @@ -112,7 +112,7 @@ Optic' k is TxSkel a -> a -> m () setTweak Optic' A_Lens NoIx TxSkel TxSkelMints txSkelMintsL TxSkelMints -newMints +newMints TxSkelOut -> m () forall (m :: * -> *). MonadTweak m => TxSkelOut -> m () addOutputTweak (TxSkelOut -> m ()) -> TxSkelOut -> m () @@ -120,28 +120,28 @@ $ PubKeyHash -> Value -> TxSkelOut paysPK (Wallet -> PubKeyHash walletPKHash Wallet -attacker) Value -increment +attacker) Value +increment Value -> m Value forall (m :: * -> *) a. Monad m => a -> m a return Value -increment +increment else m Value forall (m :: * -> *) a. MonadTweak m => m a failingTweak ) (Versioned MintingPolicy -> [(TokenName, Integer)] -extraTokens Versioned MintingPolicy -policy) +extraTokens Versioned MintingPolicy +policy) ) (TxSkelMints -> [(Versioned MintingPolicy, (MintsRedeemer, NEMap TokenName (NonZero Integer)))] forall k a. Map k a -> [(k, a)] Map.toList TxSkelMints -oldMints) +oldMints) -newtype AddTokenLbl = AddTokenLbl Pl.TokenName deriving (Int -> AddTokenLbl -> ShowS +newtype AddTokenLbl = AddTokenLbl Pl.TokenName deriving (Int -> AddTokenLbl -> ShowS [AddTokenLbl] -> ShowS AddTokenLbl -> String (Int -> AddTokenLbl -> ShowS) @@ -156,7 +156,7 @@ $cshow :: AddTokenLbl -> String showsPrec :: Int -> AddTokenLbl -> ShowS $cshowsPrec :: Int -> AddTokenLbl -> ShowS -Show, AddTokenLbl -> AddTokenLbl -> Bool +Show, AddTokenLbl -> AddTokenLbl -> Bool (AddTokenLbl -> AddTokenLbl -> Bool) -> (AddTokenLbl -> AddTokenLbl -> Bool) -> Eq AddTokenLbl forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a diff --git a/src/Cooked.Attack.DatumHijacking.html b/src/Cooked.Attack.DatumHijacking.html index 1d881db9e..d3a420ae1 100644 --- a/src/Cooked.Attack.DatumHijacking.html +++ b/src/Cooked.Attack.DatumHijacking.html @@ -35,23 +35,23 @@ -- -- Something like @txSkelOutsL % traversed % txSkelOutOwnerTypeP @(Pl.TypedValidator a)@ -- might be useful to construct the optics used by this tweak. -redirectScriptOutputTweak :: - ( MonadTweak m, - Is k A_Traversal, - Show (Pl.DatumType a), - Pl.ToData (Pl.DatumType a) +redirectScriptOutputTweak :: + ( MonadTweak m, + Is k A_Traversal, + Show (Pl.DatumType a), + Pl.ToData (Pl.DatumType a) ) => - Optic' k is TxSkel (ConcreteOutput (Pl.TypedValidator a) TxSkelOutDatum Pl.Value (Pl.Versioned Pl.Script)) -> + Optic' k is TxSkel (ConcreteOutput (Pl.TypedValidator a) TxSkelOutDatum Pl.Value (Pl.Versioned Pl.Script)) -> -- | Return @Just@ the new validator, or @Nothing@ if you want to leave this -- output unchanged. - (ConcreteOutput (Pl.TypedValidator a) TxSkelOutDatum Pl.Value (Pl.Versioned Pl.Script) -> Maybe (Pl.TypedValidator a)) -> + (ConcreteOutput (Pl.TypedValidator a) TxSkelOutDatum Pl.Value (Pl.Versioned Pl.Script) -> Maybe (Pl.TypedValidator a)) -> -- | The redirection described by the previous argument might apply to more -- than one of the script outputs of the transaction. Use this predicate to -- select which of the redirectable script outputs to actually redirect. We -- count the redirectable script outputs from the left to the right, starting -- with zero. (Integer -> Bool) -> - m [ConcreteOutput (Pl.TypedValidator a) TxSkelOutDatum Pl.Value (Pl.Versioned Pl.Script)] + m [ConcreteOutput (Pl.TypedValidator a) TxSkelOutDatum Pl.Value (Pl.Versioned Pl.Script)] redirectScriptOutputTweak :: Optic' k is @@ -64,16 +64,16 @@ -> (Integer -> Bool) -> m [ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script)] -redirectScriptOutputTweak Optic' +redirectScriptOutputTweak Optic' k is TxSkel (ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script)) -optic ConcreteOutput +optic ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -> Maybe (TypedValidator a) -change = +change = Optic' k is @@ -99,23 +99,23 @@ TxSkel (ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script)) -optic - ( \ConcreteOutput +optic + ( \ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -output -> case ConcreteOutput +output -> case ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -> Maybe (TypedValidator a) -change ConcreteOutput +change ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -output of +output of Maybe (TypedValidator a) Nothing -> Maybe (ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script)) forall a. Maybe a Nothing - Just TypedValidator a -newValidator -> ConcreteOutput + Just TypedValidator a +newValidator -> ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -> Maybe (ConcreteOutput @@ -134,7 +134,7 @@ forall a b. (a -> b) -> a -> b $ ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -output ConcreteOutput +output ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -> (ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) @@ -171,7 +171,7 @@ Is k A_Setter => Optic k is s t a b -> b -> s -> t .~ TypedValidator a -newValidator +newValidator ) -- | A datum hijacking attack, simplified: This attack tries to substitute a @@ -189,36 +189,36 @@ -- they occurred on the original transaction. If no output is redirected, this -- attack fails. datumHijackingAttack :: - forall a m. - ( MonadTweak m, - Show (Pl.DatumType a), - PrettyCooked (Pl.DatumType a), - Pl.ToData (Pl.DatumType a), - Typeable (Pl.DatumType a), - Typeable a + forall a m. + ( MonadTweak m, + Show (Pl.DatumType a), + PrettyCooked (Pl.DatumType a), + Pl.ToData (Pl.DatumType a), + Typeable (Pl.DatumType a), + Typeable a ) => -- | Predicate to select outputs to steal, depending on the intended -- recipient, the datum, and the value. - (ConcreteOutput (Pl.TypedValidator a) TxSkelOutDatum Pl.Value (Pl.Versioned Pl.Script) -> Bool) -> + (ConcreteOutput (Pl.TypedValidator a) TxSkelOutDatum Pl.Value (Pl.Versioned Pl.Script) -> Bool) -> -- | The selection predicate may match more than one output. Use this -- predicate to restrict to the i-th of the outputs (counting from the left, -- starting at zero) chosen by the selection predicate with this predicate. (Integer -> Bool) -> - m [ConcreteOutput (Pl.TypedValidator a) TxSkelOutDatum Pl.Value (Pl.Versioned Pl.Script)] + m [ConcreteOutput (Pl.TypedValidator a) TxSkelOutDatum Pl.Value (Pl.Versioned Pl.Script)] datumHijackingAttack :: (ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -> Bool) -> (Integer -> Bool) -> m [ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script)] -datumHijackingAttack ConcreteOutput +datumHijackingAttack ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -> Bool -change Integer -> Bool -select = do - [ConcreteOutput +change Integer -> Bool +select = do + [ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script)] -redirected <- +redirected <- Optic' A_Traversal NoIx @@ -298,22 +298,22 @@ Prism' TxSkelOut (ConcreteOutput ownerType TxSkelOutDatum Value (Versioned Script)) -txSkelOutOwnerTypeP @(Pl.TypedValidator a)) - (\ConcreteOutput +txSkelOutOwnerTypeP @(Pl.TypedValidator a)) + (\ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -output -> if ConcreteOutput +output -> if ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -> Bool -change ConcreteOutput +change ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -output then TypedValidator a -> Maybe (TypedValidator a) +output then TypedValidator a -> Maybe (TypedValidator a) forall a. a -> Maybe a Just TypedValidator a -thief else Maybe (TypedValidator a) +thief else Maybe (TypedValidator a) forall a. Maybe a Nothing) Integer -> Bool -select +select Bool -> m () forall (f :: * -> *). Alternative f => Bool -> f () guard (Bool -> m ()) -> (Bool -> Bool) -> Bool -> m () @@ -327,7 +327,7 @@ forall (t :: * -> *) a. Foldable t => t a -> Bool null [ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script)] -redirected +redirected DatumHijackingLbl -> m () forall (m :: * -> *) x. (MonadTweak m, LabelConstrs x) => x -> m () addLabelTweak (DatumHijackingLbl -> m ()) -> DatumHijackingLbl -> m () @@ -338,7 +338,7 @@ $ TypedValidator a -> Address forall a. TypedValidator a -> Address Pl.validatorAddress TypedValidator a -thief +thief [ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script)] -> m [ConcreteOutput @@ -346,15 +346,15 @@ forall (m :: * -> *) a. Monad m => a -> m a return [ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script)] -redirected +redirected where - thief :: TypedValidator a -thief = TypedValidator a + thief :: TypedValidator a +thief = TypedValidator a forall a. TypedValidator a -datumHijackingTarget @a +datumHijackingTarget @a newtype DatumHijackingLbl = DatumHijackingLbl Pl.Address - deriving (Int -> DatumHijackingLbl -> ShowS + deriving (Int -> DatumHijackingLbl -> ShowS [DatumHijackingLbl] -> ShowS DatumHijackingLbl -> String (Int -> DatumHijackingLbl -> ShowS) @@ -369,7 +369,7 @@ $cshow :: DatumHijackingLbl -> String showsPrec :: Int -> DatumHijackingLbl -> ShowS $cshowsPrec :: Int -> DatumHijackingLbl -> ShowS -Show, DatumHijackingLbl -> DatumHijackingLbl -> Bool +Show, DatumHijackingLbl -> DatumHijackingLbl -> Bool (DatumHijackingLbl -> DatumHijackingLbl -> Bool) -> (DatumHijackingLbl -> DatumHijackingLbl -> Bool) -> Eq DatumHijackingLbl @@ -378,7 +378,7 @@ $c/= :: DatumHijackingLbl -> DatumHijackingLbl -> Bool == :: DatumHijackingLbl -> DatumHijackingLbl -> Bool $c== :: DatumHijackingLbl -> DatumHijackingLbl -> Bool -Eq, Eq DatumHijackingLbl +Eq, Eq DatumHijackingLbl Eq DatumHijackingLbl -> (DatumHijackingLbl -> DatumHijackingLbl -> Ordering) -> (DatumHijackingLbl -> DatumHijackingLbl -> Bool) @@ -421,7 +421,7 @@ -- | The trivial validator that always succeds; this is a sufficient target for -- the datum hijacking attack since we only want to show feasibility of the -- attack. -datumHijackingTarget :: Pl.TypedValidator a +datumHijackingTarget :: Pl.TypedValidator a datumHijackingTarget :: TypedValidator a datumHijackingTarget = Program NamedDeBruijn DefaultUni DefaultFun () -> TypedValidator a forall a. @@ -437,9 +437,9 @@ CompiledCodeIn uni fun a -> Program NamedDeBruijn uni fun () Pl.getPlc $$(Pl.compile [||tgt||])) where - tgt :: Pl.BuiltinData -> Pl.BuiltinData -> Pl.BuiltinData -> () - tgt :: BuiltinData -> BuiltinData -> BuiltinData -> () -tgt BuiltinData + tgt :: Pl.BuiltinData -> Pl.BuiltinData -> Pl.BuiltinData -> () + tgt :: BuiltinData -> BuiltinData -> BuiltinData -> () +tgt BuiltinData _ BuiltinData _ BuiltinData _ = () diff --git a/src/Cooked.Attack.DoubleSat.html b/src/Cooked.Attack.DoubleSat.html index 9a86f4b86..78329fb0c 100644 --- a/src/Cooked.Attack.DoubleSat.html +++ b/src/Cooked.Attack.DoubleSat.html @@ -49,35 +49,35 @@ -- attack. type DoubleSatDelta = (Map Pl.TxOutRef TxSkelRedeemer, [TxSkelOut], TxSkelMints) -instance {-# OVERLAPPING #-} Semigroup DoubleSatDelta where - (Map TxOutRef TxSkelRedeemer -i, [TxSkelOut] -o, TxSkelMints -m) <> :: DoubleSatDelta -> DoubleSatDelta -> DoubleSatDelta -<> (Map TxOutRef TxSkelRedeemer -i', [TxSkelOut] -o', TxSkelMints -m') = +instance {-# OVERLAPPING #-} Semigroup DoubleSatDelta where + (Map TxOutRef TxSkelRedeemer +i, [TxSkelOut] +o, TxSkelMints +m) <> :: DoubleSatDelta -> DoubleSatDelta -> DoubleSatDelta +<> (Map TxOutRef TxSkelRedeemer +i', [TxSkelOut] +o', TxSkelMints +m') = ( Map TxOutRef TxSkelRedeemer -i Map TxOutRef TxSkelRedeemer +i Map TxOutRef TxSkelRedeemer -> Map TxOutRef TxSkelRedeemer -> Map TxOutRef TxSkelRedeemer forall a. Semigroup a => a -> a -> a <> Map TxOutRef TxSkelRedeemer -i', -- this is left-biased union +i', -- this is left-biased union [TxSkelOut] -o [TxSkelOut] -> [TxSkelOut] -> [TxSkelOut] +o [TxSkelOut] -> [TxSkelOut] -> [TxSkelOut] forall a. [a] -> [a] -> [a] ++ [TxSkelOut] -o', +o', TxSkelMints -m TxSkelMints -> TxSkelMints -> TxSkelMints +m TxSkelMints -> TxSkelMints -> TxSkelMints forall a. Semigroup a => a -> a -> a <> TxSkelMints -m' -- see the 'Semigroup' instance of 'TxSkelMints' +m' -- see the 'Semigroup' instance of 'TxSkelMints' ) -instance {-# OVERLAPPING #-} Monoid DoubleSatDelta where - mempty :: DoubleSatDelta +instance {-# OVERLAPPING #-} Monoid DoubleSatDelta where + mempty :: DoubleSatDelta mempty = (Map TxOutRef TxSkelRedeemer forall k a. Map k a Map.empty, [], TxSkelMints @@ -92,11 +92,11 @@ -- involved are fooled by what's already present on the transaction. Any extra -- value contained in new inputs to the transaction is then paid to the -- attacker. -doubleSatAttack :: - (MonadTweak m, Eq is, Is k A_Traversal) => +doubleSatAttack :: + (MonadTweak m, Eq is, Is k A_Traversal) => -- | how to combine modifications from caused by different foci. See the -- comment at 'combineModsTweak', which uses the same logic. - ([is] -> [[is]]) -> + ([is] -> [[is]]) -> -- | Each focus of this optic is a potential reason to add some extra -- constraints. -- @@ -104,7 +104,7 @@ -- validators of type @t@ with the following traversal: -- -- > txSkelOutsL % itaversed % txSkelOutputToTypedValidatorP @t - Optic' k (WithIx is) TxSkel a -> + Optic' k (WithIx is) TxSkel a -> -- | How to change each focus, and which inputs, outputs, and mints to add, -- for each of the foci. There might be different options for each focus, -- that's why the return value is a list. @@ -129,25 +129,25 @@ -- 'UtxoState' argument. -- -- ################################### - (is -> a -> m [(a, DoubleSatDelta)]) -> + (is -> a -> m [(a, DoubleSatDelta)]) -> -- | The wallet of the attacker, where any surplus is paid to. -- -- In the example, the extra value in the added 'spendsScript' constraints -- will be paid to the attacker. Wallet -> - m () + m () doubleSatAttack :: ([is] -> [[is]]) -> Optic' k (WithIx is) TxSkel a -> (is -> a -> m [(a, DoubleSatDelta)]) -> Wallet -> m () -doubleSatAttack [is] -> [[is]] -groupings Optic' k (WithIx is) TxSkel a -optic is -> a -> m [(a, DoubleSatDelta)] -change Wallet -attacker = do - [DoubleSatDelta] -deltas <- ([is] -> [[is]]) +doubleSatAttack [is] -> [[is]] +groupings Optic' k (WithIx is) TxSkel a +optic is -> a -> m [(a, DoubleSatDelta)] +change Wallet +attacker = do + [DoubleSatDelta] +deltas <- ([is] -> [[is]]) -> Optic' k (WithIx is) TxSkel a -> (is -> a -> m [(a, DoubleSatDelta)]) -> m [DoubleSatDelta] @@ -158,24 +158,24 @@ -> (is -> x -> m [(x, l)]) -> m [l] combineModsTweak [is] -> [[is]] -groupings Optic' k (WithIx is) TxSkel a -optic is -> a -> m [(a, DoubleSatDelta)] -change - let delta :: DoubleSatDelta -delta = [DoubleSatDelta] -> DoubleSatDelta -joinDoubleSatDeltas [DoubleSatDelta] -deltas +groupings Optic' k (WithIx is) TxSkel a +optic is -> a -> m [(a, DoubleSatDelta)] +change + let delta :: DoubleSatDelta +delta = [DoubleSatDelta] -> DoubleSatDelta +joinDoubleSatDeltas [DoubleSatDelta] +deltas DoubleSatDelta -> m () forall (m :: * -> *). MonadTweak m => DoubleSatDelta -> m () -addDoubleSatDeltaTweak DoubleSatDelta -delta - Value -addedValue <- DoubleSatDelta -> m Value +addDoubleSatDeltaTweak DoubleSatDelta +delta + Value +addedValue <- DoubleSatDelta -> m Value forall (m :: * -> *). MonadTweak m => DoubleSatDelta -> m Value -deltaBalance DoubleSatDelta -delta +deltaBalance DoubleSatDelta +delta if Value -addedValue Value -> Value -> Bool +addedValue Value -> Value -> Bool `Pl.gt` Value forall a. Monoid a => a mempty @@ -186,8 +186,8 @@ $ PubKeyHash -> Value -> TxSkelOut paysPK (Wallet -> PubKeyHash walletPKHash Wallet -attacker) Value -addedValue +attacker) Value +addedValue else m () forall (m :: * -> *) a. MonadTweak m => m a failingTweak @@ -197,14 +197,14 @@ DoubleSatLbl where -- for each triple of additional inputs, outputs, and mints, calculate its balance - deltaBalance :: MonadTweak m => DoubleSatDelta -> m Pl.Value - deltaBalance :: DoubleSatDelta -> m Value -deltaBalance (Map TxOutRef TxSkelRedeemer -inputs, [TxSkelOut] -outputs, TxSkelMints -mints) = do - Value -inValue <- ((TxOutRef, TxOut) -> Value) -> [(TxOutRef, TxOut)] -> Value + deltaBalance :: MonadTweak m => DoubleSatDelta -> m Pl.Value + deltaBalance :: DoubleSatDelta -> m Value +deltaBalance (Map TxOutRef TxSkelRedeemer +inputs, [TxSkelOut] +outputs, TxSkelMints +mints) = do + Value +inValue <- ((TxOutRef, TxOut) -> Value) -> [(TxOutRef, TxOut)] -> Value forall (t :: * -> *) m a. (Foldable t, Monoid m) => (a -> m) -> t a -> m @@ -228,7 +228,7 @@ `elem` Map TxOutRef TxSkelRedeemer -> [TxOutRef] forall k a. Map k a -> [k] Map.keys Map TxOutRef TxSkelRedeemer -inputs) (TxOutRef -> Bool) +inputs) (TxOutRef -> Bool) -> ((TxOutRef, TxOut) -> TxOutRef) -> (TxOutRef, TxOut) -> Bool forall b c a. (b -> c) -> (a -> b) -> a -> c . (TxOutRef, TxOut) -> TxOutRef @@ -245,18 +245,18 @@ return (Value -> m Value) -> Value -> m Value forall a b. (a -> b) -> a -> b $ Value -inValue Value -> Value -> Value +inValue Value -> Value -> Value forall a. Semigroup a => a -> a -> a <> Value -> Value forall a. AdditiveGroup a => a -> a Pl.negate Value -outValue Value -> Value -> Value +outValue Value -> Value -> Value forall a. Semigroup a => a -> a -> a <> Value -mintValue +mintValue where - outValue :: Value -outValue = Optic' A_Traversal '[] [TxSkelOut] Value -> [TxSkelOut] -> Value + outValue :: Value +outValue = Optic' A_Traversal '[] [TxSkelOut] Value -> [TxSkelOut] -> Value forall k a (is :: IxList) s. (Is k A_Fold, Monoid a) => Optic' k is s a -> s -> a @@ -273,19 +273,19 @@ Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b % Optic A_Lens '[] TxSkelOut TxSkelOut Value Value txSkelOutValueL) [TxSkelOut] -outputs - mintValue :: Value -mintValue = TxSkelMints -> Value +outputs + mintValue :: Value +mintValue = TxSkelMints -> Value txSkelMintsValue TxSkelMints -mints +mints -- Helper tweak to add a 'DoubleSatDelta' to a transaction - addDoubleSatDeltaTweak :: MonadTweak m => DoubleSatDelta -> m () - addDoubleSatDeltaTweak :: DoubleSatDelta -> m () -addDoubleSatDeltaTweak (Map TxOutRef TxSkelRedeemer -ins, [TxSkelOut] -outs, TxSkelMints -mints) = + addDoubleSatDeltaTweak :: MonadTweak m => DoubleSatDelta -> m () + addDoubleSatDeltaTweak :: DoubleSatDelta -> m () +addDoubleSatDeltaTweak (Map TxOutRef TxSkelRedeemer +ins, [TxSkelOut] +outs, TxSkelMints +mints) = ((TxOutRef, TxSkelRedeemer) -> m ()) -> [(TxOutRef, TxSkelRedeemer)] -> m () forall (t :: * -> *) (m :: * -> *) a b. @@ -301,7 +301,7 @@ addInputTweak) (Map TxOutRef TxSkelRedeemer -> [(TxOutRef, TxSkelRedeemer)] forall k a. Map k a -> [(k, a)] Map.toList Map TxOutRef TxSkelRedeemer -ins) +ins) m () -> m () -> m () forall (m :: * -> *) a b. Monad m => m a -> m b -> m b >> (TxSkelOut -> m ()) -> [TxSkelOut] -> m () @@ -311,7 +311,7 @@ mapM_ TxSkelOut -> m () forall (m :: * -> *). MonadTweak m => TxSkelOut -> m () addOutputTweak [TxSkelOut] -outs +outs m () -> m () -> m () forall (m :: * -> *) a b. Monad m => m a -> m b -> m b >> ((Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) @@ -330,18 +330,18 @@ addMintTweak (TxSkelMints -> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] txSkelMintsToList TxSkelMints -mints) +mints) -- Join a list of 'DoubleSatDelta's into one 'DoubleSatDelta' that specifies -- eveything that is contained in the input. - joinDoubleSatDeltas :: [DoubleSatDelta] -> DoubleSatDelta - joinDoubleSatDeltas :: [DoubleSatDelta] -> DoubleSatDelta -joinDoubleSatDeltas = [DoubleSatDelta] -> DoubleSatDelta + joinDoubleSatDeltas :: [DoubleSatDelta] -> DoubleSatDelta + joinDoubleSatDeltas :: [DoubleSatDelta] -> DoubleSatDelta +joinDoubleSatDeltas = [DoubleSatDelta] -> DoubleSatDelta forall a. Monoid a => [a] -> a mconcat data DoubleSatLbl = DoubleSatLbl - deriving (DoubleSatLbl -> DoubleSatLbl -> Bool + deriving (DoubleSatLbl -> DoubleSatLbl -> Bool (DoubleSatLbl -> DoubleSatLbl -> Bool) -> (DoubleSatLbl -> DoubleSatLbl -> Bool) -> Eq DoubleSatLbl forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a @@ -349,7 +349,7 @@ $c/= :: DoubleSatLbl -> DoubleSatLbl -> Bool == :: DoubleSatLbl -> DoubleSatLbl -> Bool $c== :: DoubleSatLbl -> DoubleSatLbl -> Bool -Eq, Int -> DoubleSatLbl -> ShowS +Eq, Int -> DoubleSatLbl -> ShowS [DoubleSatLbl] -> ShowS DoubleSatLbl -> String (Int -> DoubleSatLbl -> ShowS) @@ -364,7 +364,7 @@ $cshow :: DoubleSatLbl -> String showsPrec :: Int -> DoubleSatLbl -> ShowS $cshowsPrec :: Int -> DoubleSatLbl -> ShowS -Show, Eq DoubleSatLbl +Show, Eq DoubleSatLbl Eq DoubleSatLbl -> (DoubleSatLbl -> DoubleSatLbl -> Ordering) -> (DoubleSatLbl -> DoubleSatLbl -> Bool) diff --git a/src/Cooked.Attack.DupToken.html b/src/Cooked.Attack.DupToken.html index 34bc5a168..fa8db6969 100644 --- a/src/Cooked.Attack.DupToken.html +++ b/src/Cooked.Attack.DupToken.html @@ -17,8 +17,8 @@ -- given recipient wallet. This adds a 'DupTokenLbl' to the labels of the -- transaction using 'addLabel'. Returns the 'Value' by which the minted value -- was increased. -dupTokenAttack :: - MonadTweak m => +dupTokenAttack :: + MonadTweak m => -- | A function describing how the amount of tokens specified by a 'Mints' -- constraint should be changed, depending on the asset class and the amount -- specified by the constraint. The given function @f@ should probably satisfy @@ -30,15 +30,15 @@ -- modified transaction but were not minted by the original transaction are -- paid to this wallet. Wallet -> - m Pl.Value + m Pl.Value dupTokenAttack :: (AssetClass -> Integer -> Integer) -> Wallet -> m Value -dupTokenAttack AssetClass -> Integer -> Integer -change Wallet -attacker = do - Value -totalIncrement <- m Value +dupTokenAttack AssetClass -> Integer -> Integer +change Wallet +attacker = do + Value +totalIncrement <- m Value forall (m :: * -> *). MonadTweak m => m Value -changeMintAmountsTweak +changeMintAmountsTweak TxSkelOut -> m () forall (m :: * -> *). MonadTweak m => TxSkelOut -> m () addOutputTweak (TxSkelOut -> m ()) -> TxSkelOut -> m () @@ -46,8 +46,8 @@ $ PubKeyHash -> Value -> TxSkelOut paysPK (Wallet -> PubKeyHash walletPKHash Wallet -attacker) Value -totalIncrement +attacker) Value +totalIncrement DupTokenLbl -> m () forall (m :: * -> *) x. (MonadTweak m, LabelConstrs x) => x -> m () addLabelTweak DupTokenLbl @@ -55,13 +55,13 @@ Value -> m Value forall (m :: * -> *) a. Monad m => a -> m a return Value -totalIncrement +totalIncrement where - changeMintAmountsTweak :: MonadTweak m => m Pl.Value - changeMintAmountsTweak :: m Value -changeMintAmountsTweak = do - [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -oldMintsList <- Optic' + changeMintAmountsTweak :: MonadTweak m => m Pl.Value + changeMintAmountsTweak :: m Value +changeMintAmountsTweak = do + [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] +oldMintsList <- Optic' A_Getter '[] TxSkel @@ -115,98 +115,98 @@ to TxSkelMints -> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] txSkelMintsToList - let newMintsList :: [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -newMintsList = + let newMintsList :: [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] +newMintsList = ((Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)) -> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] forall a b. (a -> b) -> [a] -> [b] map - ( \(Pl.Versioned MintingPolicy -policy Language -version, MintsRedeemer -redeemer, TokenName -tName, Integer -oldAmount) -> - let ac :: AssetClass -ac = CurrencySymbol -> TokenName -> AssetClass + ( \(Pl.Versioned MintingPolicy +policy Language +version, MintsRedeemer +redeemer, TokenName +tName, Integer +oldAmount) -> + let ac :: AssetClass +ac = CurrencySymbol -> TokenName -> AssetClass Pl.assetClass (MintingPolicyHash -> CurrencySymbol Pl.mpsSymbol (MintingPolicyHash -> CurrencySymbol) -> MintingPolicyHash -> CurrencySymbol forall a b. (a -> b) -> a -> b $ MintingPolicy -> MintingPolicyHash Pl.mintingPolicyHash MintingPolicy -policy) TokenName -tName - newAmount :: Integer -newAmount = AssetClass -> Integer -> Integer -change AssetClass -ac Integer -oldAmount +policy) TokenName +tName + newAmount :: Integer +newAmount = AssetClass -> Integer -> Integer +change AssetClass +ac Integer +oldAmount in (MintingPolicy -> Language -> Versioned MintingPolicy forall script. script -> Language -> Versioned script Pl.Versioned MintingPolicy -policy Language -version, MintsRedeemer -redeemer, TokenName -tName, Integer -> Integer -> Integer +policy Language +version, MintsRedeemer +redeemer, TokenName +tName, Integer -> Integer -> Integer forall a. Ord a => a -> a -> a max Integer -newAmount Integer -oldAmount) +newAmount Integer +oldAmount) ) [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -oldMintsList +oldMintsList Bool -> m () forall (f :: * -> *). Alternative f => Bool -> f () guard (Bool -> m ()) -> Bool -> m () forall a b. (a -> b) -> a -> b $ [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -newMintsList [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] +newMintsList [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -> Bool forall a. Eq a => a -> a -> Bool /= [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -oldMintsList - let newMints :: TxSkelMints -newMints = [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] +oldMintsList + let newMints :: TxSkelMints +newMints = [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -> TxSkelMints txSkelMintsFromList [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -newMintsList - newValue :: Value -newValue = TxSkelMints -> Value +newMintsList + newValue :: Value +newValue = TxSkelMints -> Value txSkelMintsValue TxSkelMints -newMints - oldValue :: Value -oldValue = TxSkelMints -> Value +newMints + oldValue :: Value +oldValue = TxSkelMints -> Value txSkelMintsValue (TxSkelMints -> Value) -> TxSkelMints -> Value forall a b. (a -> b) -> a -> b $ [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -> TxSkelMints txSkelMintsFromList [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -oldMintsList +oldMintsList Lens' TxSkel TxSkelMints -> TxSkelMints -> m () forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> a -> m () setTweak Lens' TxSkel TxSkelMints txSkelMintsL TxSkelMints -newMints +newMints Value -> m Value forall (m :: * -> *) a. Monad m => a -> m a return (Value -> m Value) -> Value -> m Value forall a b. (a -> b) -> a -> b $ Value -newValue Value -> Value -> Value +newValue Value -> Value -> Value forall a. Semigroup a => a -> a -> a <> Value -> Value forall a. AdditiveGroup a => a -> a Pl.negate Value -oldValue +oldValue data DupTokenLbl = DupTokenLbl - deriving (DupTokenLbl -> DupTokenLbl -> Bool + deriving (DupTokenLbl -> DupTokenLbl -> Bool (DupTokenLbl -> DupTokenLbl -> Bool) -> (DupTokenLbl -> DupTokenLbl -> Bool) -> Eq DupTokenLbl forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a @@ -214,7 +214,7 @@ $c/= :: DupTokenLbl -> DupTokenLbl -> Bool == :: DupTokenLbl -> DupTokenLbl -> Bool $c== :: DupTokenLbl -> DupTokenLbl -> Bool -Eq, Int -> DupTokenLbl -> ShowS +Eq, Int -> DupTokenLbl -> ShowS [DupTokenLbl] -> ShowS DupTokenLbl -> String (Int -> DupTokenLbl -> ShowS) @@ -229,7 +229,7 @@ $cshow :: DupTokenLbl -> String showsPrec :: Int -> DupTokenLbl -> ShowS $cshowsPrec :: Int -> DupTokenLbl -> ShowS -Show, Eq DupTokenLbl +Show, Eq DupTokenLbl Eq DupTokenLbl -> (DupTokenLbl -> DupTokenLbl -> Ordering) -> (DupTokenLbl -> DupTokenLbl -> Bool) diff --git a/src/Cooked.Ltl.html b/src/Cooked.Ltl.html index 4fbb2b6ba..d086827ee 100644 --- a/src/Cooked.Ltl.html +++ b/src/Cooked.Ltl.html @@ -29,33 +29,33 @@ -- apply modifications. Since it does not make (obvious) sense to talk of a -- negated modification or of one modification (possibly in the future) to -- imply another modification, implication and negation are absent. -data Ltl a +data Ltl a = -- | The "do nothing" modification that never fails LtlTruth | -- | The modification that never applies (i.e. always fails) LtlFalsity | -- | The modification that applies a given atomic modification at the current time step - LtlAtom a + LtlAtom a | -- | Disjunction will be interpreted in an "intuitionistic" way, i.e. as -- branching into the "timeline" where the left disjunct holds and the one -- where the right disjunct holds. In that sense, it is an exclusive or, -- as it does not introduce the branch where both disjuncts hold. - LtlOr (Ltl a) (Ltl a) + LtlOr (Ltl a) (Ltl a) | -- | Conjunction will be interpreted as "apply both -- modifications". Attention: The "apply both" operation will be -- user-defined for atomic modifications, so that conjunction may for -- example fail to be commutative if the operation on atomic modification is -- not commutative. - LtlAnd (Ltl a) (Ltl a) + LtlAnd (Ltl a) (Ltl a) | -- | Assert that the given formula holds at the next time step. - LtlNext (Ltl a) + LtlNext (Ltl a) | -- | Assert that the first formula holds at least until the second one begins -- to hold, which must happen eventually. The formulas -- > a `LtlUntil` b -- and -- > b `LtlOr` (a `LtlAnd` LtlNext (a `LtlUntil` b)) -- are equivalent. - LtlUntil (Ltl a) (Ltl a) + LtlUntil (Ltl a) (Ltl a) | -- | Assert that the second formula has to be true up to and including the -- point when the first one becomes true; if that never happens, the second -- formula has to remain true forever. View this as dual to 'LtlUntil'. The @@ -64,8 +64,8 @@ -- and -- > b `LtlAnd` (a `LtlOr` LtlNext (a `LtlRelease` b)) -- are equivalent. - LtlRelease (Ltl a) (Ltl a) - deriving (Int -> Ltl a -> ShowS + LtlRelease (Ltl a) (Ltl a) + deriving (Int -> Ltl a -> ShowS [Ltl a] -> ShowS Ltl a -> String (Int -> Ltl a -> ShowS) @@ -102,7 +102,7 @@ -- <> b@ as the modification that first applies @b@ and then @a@. Attention: -- Since we use '<>' to define conjunction, if '<>' is not commutative, -- conjunction will also fail to be commutative! -nowLater :: Monoid a => Ltl a -> [(a, Ltl a)] +nowLater :: Monoid a => Ltl a -> [(a, Ltl a)] nowLater :: Ltl a -> [(a, Ltl a)] nowLater Ltl a LtlTruth = [(a @@ -112,100 +112,100 @@ LtlTruth)] nowLater Ltl a LtlFalsity = [] -nowLater (LtlAtom a -g) = [(a -g, Ltl a +nowLater (LtlAtom a +g) = [(a +g, Ltl a forall a. Ltl a LtlTruth)] -nowLater (Ltl a -a `LtlOr` Ltl a -b) = Ltl a -> [(a, Ltl a)] +nowLater (Ltl a +a `LtlOr` Ltl a +b) = Ltl a -> [(a, Ltl a)] forall a. Monoid a => Ltl a -> [(a, Ltl a)] nowLater Ltl a -a [(a, Ltl a)] -> [(a, Ltl a)] -> [(a, Ltl a)] +a [(a, Ltl a)] -> [(a, Ltl a)] -> [(a, Ltl a)] forall a. [a] -> [a] -> [a] ++ Ltl a -> [(a, Ltl a)] forall a. Monoid a => Ltl a -> [(a, Ltl a)] nowLater Ltl a -b -nowLater (Ltl a -a `LtlAnd` Ltl a -b) = +b +nowLater (Ltl a +a `LtlAnd` Ltl a +b) = [ (a -f a -> a -> a +f a -> a -> a forall a. Semigroup a => a -> a -> a <> a -g, Ltl a -> Ltl a +g, Ltl a -> Ltl a forall a. Ltl a -> Ltl a ltlSimpl (Ltl a -> Ltl a) -> Ltl a -> Ltl a forall a b. (a -> b) -> a -> b $ Ltl a -c Ltl a -> Ltl a -> Ltl a +c Ltl a -> Ltl a -> Ltl a forall a. Ltl a -> Ltl a -> Ltl a `LtlAnd` Ltl a -d) - | (a -f, Ltl a -c) <- Ltl a -> [(a, Ltl a)] +d) + | (a +f, Ltl a +c) <- Ltl a -> [(a, Ltl a)] forall a. Monoid a => Ltl a -> [(a, Ltl a)] nowLater Ltl a -a, - (a -g, Ltl a -d) <- Ltl a -> [(a, Ltl a)] +a, + (a +g, Ltl a +d) <- Ltl a -> [(a, Ltl a)] forall a. Monoid a => Ltl a -> [(a, Ltl a)] nowLater Ltl a -b +b ] -nowLater (LtlNext Ltl a -a) = [(a +nowLater (LtlNext Ltl a +a) = [(a forall a. Monoid a => a mempty, Ltl a -a)] -nowLater (Ltl a -a `LtlUntil` Ltl a -b) = +a)] +nowLater (Ltl a +a `LtlUntil` Ltl a +b) = Ltl a -> [(a, Ltl a)] forall a. Monoid a => Ltl a -> [(a, Ltl a)] nowLater (Ltl a -> [(a, Ltl a)]) -> Ltl a -> [(a, Ltl a)] forall a b. (a -> b) -> a -> b $ Ltl a -b Ltl a -> Ltl a -> Ltl a +b Ltl a -> Ltl a -> Ltl a forall a. Ltl a -> Ltl a -> Ltl a `LtlOr` (Ltl a -a Ltl a -> Ltl a -> Ltl a +a Ltl a -> Ltl a -> Ltl a forall a. Ltl a -> Ltl a -> Ltl a `LtlAnd` Ltl a -> Ltl a forall a. Ltl a -> Ltl a LtlNext (Ltl a -a Ltl a -> Ltl a -> Ltl a +a Ltl a -> Ltl a -> Ltl a forall a. Ltl a -> Ltl a -> Ltl a `LtlUntil` Ltl a -b)) -nowLater (Ltl a -a `LtlRelease` Ltl a -b) = +b)) +nowLater (Ltl a +a `LtlRelease` Ltl a +b) = Ltl a -> [(a, Ltl a)] forall a. Monoid a => Ltl a -> [(a, Ltl a)] nowLater (Ltl a -> [(a, Ltl a)]) -> Ltl a -> [(a, Ltl a)] forall a b. (a -> b) -> a -> b $ Ltl a -b Ltl a -> Ltl a -> Ltl a +b Ltl a -> Ltl a -> Ltl a forall a. Ltl a -> Ltl a -> Ltl a `LtlAnd` (Ltl a -a Ltl a -> Ltl a -> Ltl a +a Ltl a -> Ltl a -> Ltl a forall a. Ltl a -> Ltl a -> Ltl a `LtlOr` Ltl a -> Ltl a forall a. Ltl a -> Ltl a LtlNext (Ltl a -a Ltl a -> Ltl a -> Ltl a +a Ltl a -> Ltl a -> Ltl a forall a. Ltl a -> Ltl a -> Ltl a `LtlRelease` Ltl a -b)) +b)) -- | If there are no more steps and the next step should satisfy the given -- formula: Are we finished, i.e. was the initial formula satisfied by now? -finished :: Ltl a -> Bool +finished :: Ltl a -> Bool finished :: Ltl a -> Bool finished Ltl a LtlTruth = Bool @@ -216,26 +216,26 @@ finished (LtlAtom a _) = Bool False -finished (Ltl a -a `LtlAnd` Ltl a -b) = Ltl a -> Bool +finished (Ltl a +a `LtlAnd` Ltl a +b) = Ltl a -> Bool forall a. Ltl a -> Bool finished Ltl a -a Bool -> Bool -> Bool +a Bool -> Bool -> Bool && Ltl a -> Bool forall a. Ltl a -> Bool finished Ltl a -b -finished (Ltl a -a `LtlOr` Ltl a -b) = Ltl a -> Bool +b +finished (Ltl a +a `LtlOr` Ltl a +b) = Ltl a -> Bool forall a. Ltl a -> Bool finished Ltl a -a Bool -> Bool -> Bool +a Bool -> Bool -> Bool || Ltl a -> Bool forall a. Ltl a -> Bool finished Ltl a -b +b finished (LtlNext Ltl a _) = Bool False @@ -254,11 +254,11 @@ -- then the third and so on. We'd still like to compute a list of @(doNow, -- doLater)@ pairs as in 'nowLater', only that the @doLater@ should again be a -- list of formulas. -nowLaterList :: Monoid a => [Ltl a] -> [(a, [Ltl a])] +nowLaterList :: Monoid a => [Ltl a] -> [(a, [Ltl a])] nowLaterList :: [Ltl a] -> [(a, [Ltl a])] nowLaterList = [[(a, Ltl a)]] -> [(a, [Ltl a])] forall a a. Monoid a => [[(a, a)]] -> [(a, [a])] -joinNowLaters ([[(a, Ltl a)]] -> [(a, [Ltl a])]) +joinNowLaters ([[(a, Ltl a)]] -> [(a, [Ltl a])]) -> ([Ltl a] -> [[(a, Ltl a)]]) -> [Ltl a] -> [(a, [Ltl a])] forall b c a. (b -> c) -> (a -> b) -> a -> c . (Ltl a -> [(a, Ltl a)]) -> [Ltl a] -> [[(a, Ltl a)]] @@ -267,31 +267,31 @@ forall a. Monoid a => Ltl a -> [(a, Ltl a)] nowLater where - joinNowLaters :: [[(a, a)]] -> [(a, [a])] -joinNowLaters [] = [(a + joinNowLaters :: [[(a, a)]] -> [(a, [a])] +joinNowLaters [] = [(a forall a. Monoid a => a mempty, [])] - joinNowLaters ([(a, a)] -l : [[(a, a)]] -ls) = + joinNowLaters ([(a, a)] +l : [[(a, a)]] +ls) = [ (a -g a -> a -> a +g a -> a -> a forall a. Semigroup a => a -> a -> a <> a -f, a -c a -> [a] -> [a] +f, a +c a -> [a] -> [a] forall a. a -> [a] -> [a] : [a] -cs) - | (a -f, a -c) <- [(a, a)] -l, - (a -g, [a] -cs) <- [[(a, a)]] -> [(a, [a])] -joinNowLaters [[(a, a)]] -ls +cs) + | (a +f, a +c) <- [(a, a)] +l, + (a +g, [a] +cs) <- [[(a, a)]] -> [(a, [a])] +joinNowLaters [[(a, a)]] +ls ] -- | Straightforward simplification procedure for LTL formulas. This function @@ -299,111 +299,111 @@ -- and recursively applies this knowledge; it does not do anything "fancy" like -- computing a normal form and is only used to keep the formulas 'nowLater' -- generates from growing too wildly. -ltlSimpl :: Ltl a -> Ltl a +ltlSimpl :: Ltl a -> Ltl a ltlSimpl :: Ltl a -> Ltl a -ltlSimpl Ltl a -expr = - let (Ltl a -expr', Bool -progress) = Ltl a -> (Ltl a, Bool) +ltlSimpl Ltl a +expr = + let (Ltl a +expr', Bool +progress) = Ltl a -> (Ltl a, Bool) forall a. Ltl a -> (Ltl a, Bool) -simpl Ltl a -expr +simpl Ltl a +expr in if Bool -progress then Ltl a -expr' else Ltl a -expr +progress then Ltl a +expr' else Ltl a +expr where - simpl :: Ltl a -> (Ltl a, Bool) - simpl :: Ltl a -> (Ltl a, Bool) -simpl (LtlAnd Ltl a -a Ltl a -b) = Ltl a -> Ltl a -> (Ltl a, Bool) + simpl :: Ltl a -> (Ltl a, Bool) + simpl :: Ltl a -> (Ltl a, Bool) +simpl (LtlAnd Ltl a +a Ltl a +b) = Ltl a -> Ltl a -> (Ltl a, Bool) forall a. Ltl a -> Ltl a -> (Ltl a, Bool) -simplAnd Ltl a -a Ltl a -b - simpl (LtlOr Ltl a -a Ltl a -b) = Ltl a -> Ltl a -> (Ltl a, Bool) +simplAnd Ltl a +a Ltl a +b + simpl (LtlOr Ltl a +a Ltl a +b) = Ltl a -> Ltl a -> (Ltl a, Bool) forall a. Ltl a -> Ltl a -> (Ltl a, Bool) -simplOr Ltl a -a Ltl a -b - simpl (LtlNext Ltl a -a) = - let (Ltl a -a', Bool -pa) = Ltl a -> (Ltl a, Bool) +simplOr Ltl a +a Ltl a +b + simpl (LtlNext Ltl a +a) = + let (Ltl a +a', Bool +pa) = Ltl a -> (Ltl a, Bool) forall a. Ltl a -> (Ltl a, Bool) -simpl Ltl a -a +simpl Ltl a +a in if Bool -pa +pa then (Ltl a -> Ltl a forall a. Ltl a -> Ltl a LtlNext Ltl a -a', Bool +a', Bool True) else (Ltl a -> Ltl a forall a. Ltl a -> Ltl a LtlNext Ltl a -a, Bool +a, Bool False) - simpl (LtlUntil Ltl a -a Ltl a -b) = (Ltl a -> Ltl a -> Ltl a) -> Ltl a -> Ltl a -> (Ltl a, Bool) + simpl (LtlUntil Ltl a +a Ltl a +b) = (Ltl a -> Ltl a -> Ltl a) -> Ltl a -> Ltl a -> (Ltl a, Bool) forall a. (Ltl a -> Ltl a -> Ltl a) -> Ltl a -> Ltl a -> (Ltl a, Bool) -recurse2 Ltl a -> Ltl a -> Ltl a +recurse2 Ltl a -> Ltl a -> Ltl a forall a. Ltl a -> Ltl a -> Ltl a LtlUntil Ltl a -a Ltl a -b - simpl (LtlRelease Ltl a -a Ltl a -b) = (Ltl a -> Ltl a -> Ltl a) -> Ltl a -> Ltl a -> (Ltl a, Bool) +a Ltl a +b + simpl (LtlRelease Ltl a +a Ltl a +b) = (Ltl a -> Ltl a -> Ltl a) -> Ltl a -> Ltl a -> (Ltl a, Bool) forall a. (Ltl a -> Ltl a -> Ltl a) -> Ltl a -> Ltl a -> (Ltl a, Bool) -recurse2 Ltl a -> Ltl a -> Ltl a +recurse2 Ltl a -> Ltl a -> Ltl a forall a. Ltl a -> Ltl a -> Ltl a LtlRelease Ltl a -a Ltl a -b - simpl Ltl a -x = (Ltl a -x, Bool +a Ltl a +b + simpl Ltl a +x = (Ltl a +x, Bool False) - simplAnd :: Ltl a -> Ltl a -> (Ltl a, Bool) - simplAnd :: Ltl a -> Ltl a -> (Ltl a, Bool) -simplAnd Ltl a -a Ltl a -b = - let (Ltl a -a', Bool -pa) = Ltl a -> (Ltl a, Bool) + simplAnd :: Ltl a -> Ltl a -> (Ltl a, Bool) + simplAnd :: Ltl a -> Ltl a -> (Ltl a, Bool) +simplAnd Ltl a +a Ltl a +b = + let (Ltl a +a', Bool +pa) = Ltl a -> (Ltl a, Bool) forall a. Ltl a -> (Ltl a, Bool) -simpl Ltl a -a - (Ltl a -b', Bool -pb) = Ltl a -> (Ltl a, Bool) +simpl Ltl a +a + (Ltl a +b', Bool +pb) = Ltl a -> (Ltl a, Bool) forall a. Ltl a -> (Ltl a, Bool) -simpl Ltl a -b +simpl Ltl a +b in case (Ltl a -a', Ltl a -b') of +a', Ltl a +b') of (Ltl a LtlTruth, Ltl a _) -> (Ltl a -b', Bool +b', Bool True) (Ltl a _, Ltl a LtlTruth) -> (Ltl a -a', Bool +a', Bool True) (Ltl a LtlFalsity, Ltl a @@ -419,40 +419,40 @@ True) (Ltl a, Ltl a) _ -> if Bool -pa Bool -> Bool -> Bool +pa Bool -> Bool -> Bool || Bool -pb then (Ltl a -> Ltl a -> Ltl a +pb then (Ltl a -> Ltl a -> Ltl a forall a. Ltl a -> Ltl a -> Ltl a LtlAnd Ltl a -a' Ltl a -b', Bool +a' Ltl a +b', Bool True) else (Ltl a -> Ltl a -> Ltl a forall a. Ltl a -> Ltl a -> Ltl a LtlAnd Ltl a -a Ltl a -b, Bool +a Ltl a +b, Bool False) - simplOr :: Ltl a -> Ltl a -> (Ltl a, Bool) - simplOr :: Ltl a -> Ltl a -> (Ltl a, Bool) -simplOr Ltl a -a Ltl a -b = - let (Ltl a -a', Bool -pa) = Ltl a -> (Ltl a, Bool) + simplOr :: Ltl a -> Ltl a -> (Ltl a, Bool) + simplOr :: Ltl a -> Ltl a -> (Ltl a, Bool) +simplOr Ltl a +a Ltl a +b = + let (Ltl a +a', Bool +pa) = Ltl a -> (Ltl a, Bool) forall a. Ltl a -> (Ltl a, Bool) -simpl Ltl a -a - (Ltl a -b', Bool -pb) = Ltl a -> (Ltl a, Bool) +simpl Ltl a +a + (Ltl a +b', Bool +pb) = Ltl a -> (Ltl a, Bool) forall a. Ltl a -> (Ltl a, Bool) -simpl Ltl a -b +simpl Ltl a +b in case (Ltl a -a', Ltl a -b') of +a', Ltl a +b') of (Ltl a LtlTruth, Ltl a _) -> (Ltl a @@ -468,64 +468,64 @@ (Ltl a LtlFalsity, Ltl a _) -> (Ltl a -b', Bool +b', Bool True) (Ltl a _, Ltl a LtlFalsity) -> (Ltl a -a', Bool +a', Bool True) (Ltl a, Ltl a) _ -> if Bool -pa Bool -> Bool -> Bool +pa Bool -> Bool -> Bool || Bool -pb then (Ltl a -> Ltl a -> Ltl a +pb then (Ltl a -> Ltl a -> Ltl a forall a. Ltl a -> Ltl a -> Ltl a LtlOr Ltl a -a' Ltl a -b', Bool +a' Ltl a +b', Bool True) else (Ltl a -> Ltl a -> Ltl a forall a. Ltl a -> Ltl a -> Ltl a LtlOr Ltl a -a Ltl a -b, Bool +a Ltl a +b, Bool False) - recurse2 :: - (Ltl a -> Ltl a -> Ltl a) -> - Ltl a -> - Ltl a -> - (Ltl a, Bool) - recurse2 :: (Ltl a -> Ltl a -> Ltl a) -> Ltl a -> Ltl a -> (Ltl a, Bool) -recurse2 Ltl a -> Ltl a -> Ltl a -f Ltl a -a Ltl a -b = - let (Ltl a -a', Bool -pa) = Ltl a -> (Ltl a, Bool) + recurse2 :: + (Ltl a -> Ltl a -> Ltl a) -> + Ltl a -> + Ltl a -> + (Ltl a, Bool) + recurse2 :: (Ltl a -> Ltl a -> Ltl a) -> Ltl a -> Ltl a -> (Ltl a, Bool) +recurse2 Ltl a -> Ltl a -> Ltl a +f Ltl a +a Ltl a +b = + let (Ltl a +a', Bool +pa) = Ltl a -> (Ltl a, Bool) forall a. Ltl a -> (Ltl a, Bool) -simpl Ltl a -a - (Ltl a -b', Bool -pb) = Ltl a -> (Ltl a, Bool) +simpl Ltl a +a + (Ltl a +b', Bool +pb) = Ltl a -> (Ltl a, Bool) forall a. Ltl a -> (Ltl a, Bool) -simpl Ltl a -b +simpl Ltl a +b in if Bool -pa Bool -> Bool -> Bool +pa Bool -> Bool -> Bool || Bool -pb +pb then (Ltl a -> Ltl a -> Ltl a -f Ltl a -a' Ltl a -b', Bool +f Ltl a +a' Ltl a +b', Bool True) else (Ltl a -> Ltl a -> Ltl a -f Ltl a -a Ltl a -b, Bool +f Ltl a +a Ltl a +b, Bool False) -- * An AST for "reified computations" @@ -539,81 +539,81 @@ -- * every step can be modified by a @modification@. -- | Operations for computations that can be modified using LTL formulas. -data LtlOp (modification :: *) (builtin :: * -> *) :: * -> * where +data LtlOp (modification :: *) (builtin :: * -> *) :: * -> * where -- | The operation that introduces a new LTL formula that should be used to -- modify the following computations. Think of this operation as coming -- between time steps and adding a new formula to be applied before all of the -- formulas that should already be applied to the next time step. - StartLtl :: Ltl modification -> LtlOp modification builtin () + StartLtl :: Ltl modification -> LtlOp modification builtin () -- | The operation that removes the last LTL formula that was introduced. If -- the formula is not yet 'finished', the current time line will fail. - StopLtl :: LtlOp modification builtin () - Builtin :: builtin a -> LtlOp modification builtin a + StopLtl :: LtlOp modification builtin () + Builtin :: builtin a -> LtlOp modification builtin a -- | The freer monad on @op@. We think of this as the AST of a computation with -- operations of types @op a@. -data Staged (op :: * -> *) :: * -> * where - Return :: a -> Staged op a - Instr :: op a -> (a -> Staged op b) -> Staged op b +data Staged (op :: * -> *) :: * -> * where + Return :: a -> Staged op a + Instr :: op a -> (a -> Staged op b) -> Staged op b -instance Functor (Staged op) where - fmap :: (a -> b) -> Staged op a -> Staged op b -fmap a -> b -f (Return a -x) = b -> Staged op b +instance Functor (Staged op) where + fmap :: (a -> b) -> Staged op a -> Staged op b +fmap a -> b +f (Return a +x) = b -> Staged op b forall a (op :: * -> *). a -> Staged op a Return (b -> Staged op b) -> b -> Staged op b forall a b. (a -> b) -> a -> b $ a -> b -f a -x - fmap a -> b -f (Instr op a -op a -> Staged op a -cont) = op a -> (a -> Staged op b) -> Staged op b +f a +x + fmap a -> b +f (Instr op a +op a -> Staged op a +cont) = op a -> (a -> Staged op b) -> Staged op b forall (op :: * -> *) a b. op a -> (a -> Staged op b) -> Staged op b Instr op a -op ((a -> b) -> Staged op a -> Staged op b +op ((a -> b) -> Staged op a -> Staged op b forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap a -> b -f (Staged op a -> Staged op b) +f (Staged op a -> Staged op b) -> (a -> Staged op a) -> a -> Staged op b forall b c a. (b -> c) -> (a -> b) -> a -> c . a -> Staged op a -cont) +cont) -instance Applicative (Staged op) where - pure :: a -> Staged op a +instance Applicative (Staged op) where + pure :: a -> Staged op a pure = a -> Staged op a forall a (op :: * -> *). a -> Staged op a Return - <*> :: Staged op (a -> b) -> Staged op a -> Staged op b + <*> :: Staged op (a -> b) -> Staged op a -> Staged op b (<*>) = Staged op (a -> b) -> Staged op a -> Staged op b forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b ap -instance Monad (Staged op) where - (Return a -x) >>= :: Staged op a -> (a -> Staged op b) -> Staged op b ->>= a -> Staged op b -f = a -> Staged op b -f a -x - (Instr op a -i a -> Staged op a -m) >>= a -> Staged op b -f = op a -> (a -> Staged op b) -> Staged op b +instance Monad (Staged op) where + (Return a +x) >>= :: Staged op a -> (a -> Staged op b) -> Staged op b +>>= a -> Staged op b +f = a -> Staged op b +f a +x + (Instr op a +i a -> Staged op a +m) >>= a -> Staged op b +f = op a -> (a -> Staged op b) -> Staged op b forall (op :: * -> *) a b. op a -> (a -> Staged op b) -> Staged op b Instr op a -i (a -> Staged op a -m (a -> Staged op a) -> (a -> Staged op b) -> a -> Staged op b +i (a -> Staged op a +m (a -> Staged op a) -> (a -> Staged op b) -> a -> Staged op b forall (m :: * -> *) a b c. Monad m => (a -> m b) -> (b -> m c) -> a -> m c >=> a -> Staged op b -f) +f) -- * Interpreting the AST @@ -640,25 +640,25 @@ -- (But to write this, @modification@ has to be a 'Monoid' to make -- 'nowLaterList' work!) Look at the tests for this module and at -- "Cooked.MockChain.Monad.Staged" for examples of how to use this type class. -class MonadPlus m => InterpLtl modification builtin m where - interpBuiltin :: builtin a -> StateT [Ltl modification] m a +class MonadPlus m => InterpLtl modification builtin m where + interpBuiltin :: builtin a -> StateT [Ltl modification] m a -- | Interpret a 'Staged' computation into a suitable domain, using the function -- 'interpBuiltin' to interpret the builtins. -interpLtl :: - (InterpLtl modification builtin m) => - Staged (LtlOp modification builtin) a -> - StateT [Ltl modification] m a +interpLtl :: + (InterpLtl modification builtin m) => + Staged (LtlOp modification builtin) a -> + StateT [Ltl modification] m a interpLtl :: Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a -interpLtl (Return a -a) = a -> StateT [Ltl modification] m a +interpLtl (Return a +a) = a -> StateT [Ltl modification] m a forall (m :: * -> *) a. Monad m => a -> m a return a -a -interpLtl (Instr (StartLtl Ltl modification -x) a -> Staged (LtlOp modification builtin) a -f) = StateT [Ltl modification] m [Ltl modification] +a +interpLtl (Instr (StartLtl Ltl modification +x) a -> Staged (LtlOp modification builtin) a +f) = StateT [Ltl modification] m [Ltl modification] forall s (m :: * -> *). MonadState s m => m s get StateT [Ltl modification] m [Ltl modification] -> ([Ltl modification] -> StateT [Ltl modification] m ()) @@ -672,7 +672,7 @@ -> StateT [Ltl modification] m () forall b c a. (b -> c) -> (a -> b) -> a -> c . (Ltl modification -x Ltl modification -> [Ltl modification] -> [Ltl modification] +x Ltl modification -> [Ltl modification] -> [Ltl modification] forall a. a -> [a] -> [a] :) StateT [Ltl modification] m () -> (() -> StateT [Ltl modification] m a) @@ -691,32 +691,32 @@ -> StateT [Ltl modification] m a forall b c a. (b -> c) -> (a -> b) -> a -> c . a -> Staged (LtlOp modification builtin) a -f +f interpLtl (Instr LtlOp modification builtin a -StopLtl a -> Staged (LtlOp modification builtin) a -f) = do - [Ltl modification] -xs <- StateT [Ltl modification] m [Ltl modification] +StopLtl a -> Staged (LtlOp modification builtin) a +f) = do + [Ltl modification] +xs <- StateT [Ltl modification] m [Ltl modification] forall s (m :: * -> *). MonadState s m => m s get case [Ltl modification] -xs of +xs of [] -> String -> StateT [Ltl modification] m a forall a. HasCallStack => String -> a error String "You called 'StopLtl' before 'StartLtl'. This is only possible if you're using internals." - Ltl modification -x : [Ltl modification] -rest -> + Ltl modification +x : [Ltl modification] +rest -> if Ltl modification -> Bool forall a. Ltl a -> Bool finished Ltl modification -x +x then do [Ltl modification] -> StateT [Ltl modification] m () forall s (m :: * -> *). MonadState s m => s -> m () put [Ltl modification] -rest +rest Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a forall modification (builtin :: * -> *) (m :: * -> *) a. @@ -729,18 +729,18 @@ -> StateT [Ltl modification] m a forall a b. (a -> b) -> a -> b $ a -> Staged (LtlOp modification builtin) a -f () +f () else StateT [Ltl modification] m a forall (m :: * -> *) a. MonadPlus m => m a mzero -interpLtl (Instr (Builtin builtin a -b) a -> Staged (LtlOp modification builtin) a -f) = builtin a -> StateT [Ltl modification] m a +interpLtl (Instr (Builtin builtin a +b) a -> Staged (LtlOp modification builtin) a +f) = builtin a -> StateT [Ltl modification] m a forall modification (builtin :: * -> *) (m :: * -> *) a. InterpLtl modification builtin m => builtin a -> StateT [Ltl modification] m a interpBuiltin builtin a -b StateT [Ltl modification] m a +b StateT [Ltl modification] m a -> (a -> StateT [Ltl modification] m a) -> StateT [Ltl modification] m a forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b @@ -757,32 +757,32 @@ -> StateT [Ltl modification] m a forall b c a. (b -> c) -> (a -> b) -> a -> c . a -> Staged (LtlOp modification builtin) a -f +f -- | Interpret a 'Staged' computation into a suitable domain, using the function -- 'interpBuiltin' to interpret the builtins. At the end of the computation, -- prune branches that still have un'finished' modifications applied to -- them. See the discussion on the regression test case for PRs 110 and 131 in -- 'StagedSpec.hs' for a discussion on why this function has to exist. -interpLtlAndPruneUnfinished :: - (InterpLtl modification builtin m) => - Staged (LtlOp modification builtin) a -> - StateT [Ltl modification] m a +interpLtlAndPruneUnfinished :: + (InterpLtl modification builtin m) => + Staged (LtlOp modification builtin) a -> + StateT [Ltl modification] m a interpLtlAndPruneUnfinished :: Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a -interpLtlAndPruneUnfinished Staged (LtlOp modification builtin) a -f = do - a -res <- Staged (LtlOp modification builtin) a +interpLtlAndPruneUnfinished Staged (LtlOp modification builtin) a +f = do + a +res <- Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a forall modification (builtin :: * -> *) (m :: * -> *) a. InterpLtl modification builtin m => Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a interpLtl Staged (LtlOp modification builtin) a -f - [Ltl modification] -mods <- StateT [Ltl modification] m [Ltl modification] +f + [Ltl modification] +mods <- StateT [Ltl modification] m [Ltl modification] forall s (m :: * -> *). MonadState s m => m s get if (Ltl modification -> Bool) -> [Ltl modification] -> Bool @@ -790,10 +790,10 @@ all Ltl modification -> Bool forall a. Ltl a -> Bool finished [Ltl modification] -mods then a -> StateT [Ltl modification] m a +mods then a -> StateT [Ltl modification] m a forall (m :: * -> *) a. Monad m => a -> m a return a -res else StateT [Ltl modification] m a +res else StateT [Ltl modification] m a forall (m :: * -> *) a. MonadPlus m => m a mzero @@ -806,18 +806,18 @@ -- LTL modifications beside the method above. -- | Monads that allow modificaitons with LTL formulas. -class Monad m => MonadModal m where - type Modification m :: Type - modifyLtl :: Ltl (Modification m) -> m a -> m a +class Monad m => MonadModal m where + type Modification m :: Type + modifyLtl :: Ltl (Modification m) -> m a -> m a -instance MonadModal (Staged (LtlOp modification builtin)) where - type Modification (Staged (LtlOp modification builtin)) = modification - modifyLtl :: Ltl (Modification (Staged (LtlOp modification builtin))) +instance MonadModal (Staged (LtlOp modification builtin)) where + type Modification (Staged (LtlOp modification builtin)) = modification + modifyLtl :: Ltl (Modification (Staged (LtlOp modification builtin))) -> Staged (LtlOp modification builtin) a -> Staged (LtlOp modification builtin) a -modifyLtl Ltl (Modification (Staged (LtlOp modification builtin))) -x Staged (LtlOp modification builtin) a -tr = LtlOp modification builtin () +modifyLtl Ltl (Modification (Staged (LtlOp modification builtin))) +x Staged (LtlOp modification builtin) a +tr = LtlOp modification builtin () -> (() -> Staged (LtlOp modification builtin) ()) -> Staged (LtlOp modification builtin) () forall (op :: * -> *) a b. @@ -827,19 +827,19 @@ Ltl modification -> LtlOp modification builtin () StartLtl Ltl modification Ltl (Modification (Staged (LtlOp modification builtin))) -x) () -> Staged (LtlOp modification builtin) () +x) () -> Staged (LtlOp modification builtin) () forall a (op :: * -> *). a -> Staged op a Return Staged (LtlOp modification builtin) () -> Staged (LtlOp modification builtin) a -> Staged (LtlOp modification builtin) a forall (m :: * -> *) a b. Monad m => m a -> m b -> m b >> Staged (LtlOp modification builtin) a -tr Staged (LtlOp modification builtin) a +tr Staged (LtlOp modification builtin) a -> (a -> Staged (LtlOp modification builtin) a) -> Staged (LtlOp modification builtin) a forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b ->>= \a -res -> LtlOp modification builtin () +>>= \a +res -> LtlOp modification builtin () -> (() -> Staged (LtlOp modification builtin) ()) -> Staged (LtlOp modification builtin) () forall (op :: * -> *) a b. @@ -856,5 +856,5 @@ >> a -> Staged (LtlOp modification builtin) a forall (m :: * -> *) a. Monad m => a -> m a return a -res +res \ No newline at end of file diff --git a/src/Cooked.MockChain.Balancing.html b/src/Cooked.MockChain.Balancing.html index a51196c61..608e27d13 100644 --- a/src/Cooked.MockChain.Balancing.html +++ b/src/Cooked.MockChain.Balancing.html @@ -42,12 +42,12 @@ import qualified Plutus.V2.Ledger.Api as PV2 import qualified PlutusTx.Numeric as Pl -balancedTxSkel :: MonadBlockChainBalancing m => TxSkel -> m (TxSkel, Fee, Set PV2.TxOutRef) +balancedTxSkel :: MonadBlockChainBalancing m => TxSkel -> m (TxSkel, Fee, Set PV2.TxOutRef) balancedTxSkel :: TxSkel -> m (TxSkel, Fee, Set TxOutRef) -balancedTxSkel TxSkel -skelUnbal = do - let balancingWallet :: Wallet -balancingWallet = +balancedTxSkel TxSkel +skelUnbal = do + let balancingWallet :: Wallet +balancingWallet = case TxOpts -> BalancingWallet txOptBalanceWallet (TxOpts -> BalancingWallet) -> (TxSkel -> TxOpts) -> TxSkel -> BalancingWallet @@ -56,28 +56,28 @@ txSkelOpts (TxSkel -> BalancingWallet) -> TxSkel -> BalancingWallet forall a b. (a -> b) -> a -> b $ TxSkel -skelUnbal of +skelUnbal of BalancingWallet BalanceWithFirstSigner -> case TxSkel -> [Wallet] txSkelSigners TxSkel -skelUnbal of +skelUnbal of [] -> [Char] -> Wallet forall a. HasCallStack => [Char] -> a error [Char] "Can't select balancing wallet: There has to be at least one wallet in txSkelSigners" - Wallet -bw : [Wallet] + Wallet +bw : [Wallet] _ -> Wallet -bw - BalanceWith Wallet -bWallet -> Wallet -bWallet - let collateralWallet :: Wallet -collateralWallet = Wallet -balancingWallet - (TxSkel -skel, Fee -fee) <- +bw + BalanceWith Wallet +bWallet -> Wallet +bWallet + let collateralWallet :: Wallet +collateralWallet = Wallet +balancingWallet + (TxSkel +skel, Fee +fee) <- if TxOpts -> Bool txOptBalance (TxOpts -> Bool) -> (TxSkel -> TxOpts) -> TxSkel -> Bool forall b c a. (b -> c) -> (a -> b) -> a -> c @@ -85,7 +85,7 @@ txSkelOpts (TxSkel -> Bool) -> TxSkel -> Bool forall a b. (a -> b) -> a -> b $ TxSkel -skelUnbal +skelUnbal then Wallet -> TxSkel -> m (TxSkel, Fee) forall (m :: * -> *). @@ -93,39 +93,39 @@ Wallet -> TxSkel -> m (TxSkel, Fee) setFeeAndBalance Wallet -balancingWallet +balancingWallet TxSkel -skelUnbal +skelUnbal else (TxSkel, Fee) -> m (TxSkel, Fee) forall (m :: * -> *) a. Monad m => a -> m a return (TxSkel -skelUnbal, Integer -> Fee +skelUnbal, Integer -> Fee Fee Integer 0) - Set TxOutRef -collateralInputs <- Wallet -> m (Set TxOutRef) + Set TxOutRef +collateralInputs <- Wallet -> m (Set TxOutRef) forall (m :: * -> *). MonadBlockChainBalancing m => Wallet -> m (Set TxOutRef) calcCollateral Wallet -collateralWallet -- TODO: Why is it OK to balance first and then add collateral? +collateralWallet -- TODO: Why is it OK to balance first and then add collateral? (TxSkel, Fee, Set TxOutRef) -> m (TxSkel, Fee, Set TxOutRef) forall (m :: * -> *) a. Monad m => a -> m a return (TxSkel -skel, Fee -fee, Set TxOutRef -collateralInputs) +skel, Fee +fee, Set TxOutRef +collateralInputs) -- | Take the output of 'balancedTxSkel' and turn it into an actual Cardano -- transaction. -balancedTx :: MonadBlockChainBalancing m => (TxSkel, Fee, Set PV2.TxOutRef) -> m (C.Tx C.BabbageEra) +balancedTx :: MonadBlockChainBalancing m => (TxSkel, Fee, Set PV2.TxOutRef) -> m (C.Tx C.BabbageEra) balancedTx :: (TxSkel, Fee, Set TxOutRef) -> m (Tx BabbageEra) -balancedTx (TxSkel -skel, Fee -fee, Set TxOutRef -collateralInputs) = do - Params -params <- Maybe EmulatorParamsModification -> Params -> Params +balancedTx (TxSkel +skel, Fee +fee, Set TxOutRef +collateralInputs) = do + Params +params <- Maybe EmulatorParamsModification -> Params -> Params applyEmulatorParamsModification (TxOpts -> Maybe EmulatorParamsModification txOptEmulatorParamsModification (TxOpts -> Maybe EmulatorParamsModification) -> (TxSkel -> TxOpts) -> TxSkel -> Maybe EmulatorParamsModification @@ -135,36 +135,36 @@ -> TxSkel -> Maybe EmulatorParamsModification forall a b. (a -> b) -> a -> b $ TxSkel -skel) (Params -> Params) -> m Params -> m Params +skel) (Params -> Params) -> m Params -> m Params forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> m Params forall (m :: * -> *). MonadBlockChainBalancing m => m Params getParams - Map DatumHash Datum -consumedData <- TxSkel -> m (Map DatumHash Datum) + Map DatumHash Datum +consumedData <- TxSkel -> m (Map DatumHash Datum) forall (m :: * -> *). MonadBlockChainBalancing m => TxSkel -> m (Map DatumHash Datum) txSkelInputData TxSkel -skel - Map TxOutRef TxOut -consumedOrReferencedTxOuts <- do - Map TxOutRef TxOut -ins <- TxSkel -> m (Map TxOutRef TxOut) +skel + Map TxOutRef TxOut +consumedOrReferencedTxOuts <- do + Map TxOutRef TxOut +ins <- TxSkel -> m (Map TxOutRef TxOut) forall (m :: * -> *). MonadBlockChainBalancing m => TxSkel -> m (Map TxOutRef TxOut) txSkelInputUtxosPV2 TxSkel -skel - Map TxOutRef TxOut -insRef <- TxSkel -> m (Map TxOutRef TxOut) +skel + Map TxOutRef TxOut +insRef <- TxSkel -> m (Map TxOutRef TxOut) forall (m :: * -> *). MonadBlockChainBalancing m => TxSkel -> m (Map TxOutRef TxOut) txSkelReferenceInputUtxosPV2 TxSkel -skel - Map TxOutRef TxOut -insCollateral <- +skel + Map TxOutRef TxOut +insCollateral <- [(TxOutRef, TxOut)] -> Map TxOutRef TxOut forall k a. Ord k => [(k, a)] -> Map k a Map.fromList @@ -177,17 +177,17 @@ (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM - ( \TxOutRef -oref -> do - Maybe TxOut -mTxOut <- TxOutRef -> m (Maybe TxOut) + ( \TxOutRef +oref -> do + Maybe TxOut +mTxOut <- TxOutRef -> m (Maybe TxOut) forall (m :: * -> *). MonadBlockChainBalancing m => TxOutRef -> m (Maybe TxOut) txOutByRef TxOutRef -oref +oref case Maybe TxOut -mTxOut of +mTxOut of Maybe TxOut Nothing -> MockChainError -> m (TxOutRef, TxOut) forall e (m :: * -> *) a. MonadError e m => e -> m a @@ -198,37 +198,37 @@ forall err. (Show err, Eq err) => err -> MockChainError OtherMockChainError [Char] "unkown collateral input TxOutRef" - Just TxOut -txOut -> (TxOutRef, TxOut) -> m (TxOutRef, TxOut) + Just TxOut +txOut -> (TxOutRef, TxOut) -> m (TxOutRef, TxOut) forall (m :: * -> *) a. Monad m => a -> m a return (TxOutRef -oref, TxOut -txOut) +oref, TxOut +txOut) ) (Set TxOutRef -> [TxOutRef] forall a. Set a -> [a] Set.toList Set TxOutRef -collateralInputs) +collateralInputs) Map TxOutRef TxOut -> m (Map TxOutRef TxOut) forall (m :: * -> *) a. Monad m => a -> m a return (Map TxOutRef TxOut -> m (Map TxOutRef TxOut)) -> Map TxOutRef TxOut -> m (Map TxOutRef TxOut) forall a b. (a -> b) -> a -> b $ Map TxOutRef TxOut -ins Map TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut +ins Map TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut forall a. Semigroup a => a -> a -> a <> Map TxOutRef TxOut -insRef Map TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut +insRef Map TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut forall a. Semigroup a => a -> a -> a <> Map TxOutRef TxOut -insCollateral - Map ValidatorHash (Versioned Validator) -consumedValidators <- TxSkel -> m (Map ValidatorHash (Versioned Validator)) +insCollateral + Map ValidatorHash (Versioned Validator) +consumedValidators <- TxSkel -> m (Map ValidatorHash (Versioned Validator)) forall (m :: * -> *). MonadBlockChainBalancing m => TxSkel -> m (Map ValidatorHash (Versioned Validator)) txSkelInputValidators TxSkel -skel +skel case GenTxParams -> Params -> Map DatumHash Datum @@ -240,16 +240,16 @@ forall a. Default a => a def {gtpCollateralIns :: Set TxOutRef gtpCollateralIns = Set TxOutRef -collateralInputs, gtpFee :: Fee +collateralInputs, gtpFee :: Fee gtpFee = Fee -fee} Params -params Map DatumHash Datum -consumedData Map TxOutRef TxOut -consumedOrReferencedTxOuts Map ValidatorHash (Versioned Validator) -consumedValidators TxSkel -skel of - Left GenerateTxError -err -> MockChainError -> m (Tx BabbageEra) +fee} Params +params Map DatumHash Datum +consumedData Map TxOutRef TxOut +consumedOrReferencedTxOuts Map ValidatorHash (Versioned Validator) +consumedValidators TxSkel +skel of + Left GenerateTxError +err -> MockChainError -> m (Tx BabbageEra) forall e (m :: * -> *) a. MonadError e m => e -> m a throwError (MockChainError -> m (Tx BabbageEra)) -> (GenerateTxError -> MockChainError) @@ -261,22 +261,22 @@ -> GenerateTxError -> m (Tx BabbageEra) forall a b. (a -> b) -> a -> b $ GenerateTxError -err - Right Tx BabbageEra -tx -> Tx BabbageEra -> m (Tx BabbageEra) +err + Right Tx BabbageEra +tx -> Tx BabbageEra -> m (Tx BabbageEra) forall (m :: * -> *) a. Monad m => a -> m a return Tx BabbageEra -tx +tx -- | Ensure that the transaction outputs have the necessary minimum amount of -- Ada on them. This will only be applied if the 'txOptEnsureMinAda' is set to -- @True@. -ensureTxSkelOutsMinAda :: MonadBlockChainBalancing m => TxSkel -> m TxSkel +ensureTxSkelOutsMinAda :: MonadBlockChainBalancing m => TxSkel -> m TxSkel ensureTxSkelOutsMinAda :: TxSkel -> m TxSkel -ensureTxSkelOutsMinAda TxSkel -skel = do - Params -theParams <- Maybe EmulatorParamsModification -> Params -> Params +ensureTxSkelOutsMinAda TxSkel +skel = do + Params +theParams <- Maybe EmulatorParamsModification -> Params -> Params applyEmulatorParamsModification (TxOpts -> Maybe EmulatorParamsModification txOptEmulatorParamsModification (TxOpts -> Maybe EmulatorParamsModification) -> (TxSkel -> TxOpts) -> TxSkel -> Maybe EmulatorParamsModification @@ -286,7 +286,7 @@ -> TxSkel -> Maybe EmulatorParamsModification forall a b. (a -> b) -> a -> b $ TxSkel -skel) (Params -> Params) -> m Params -> m Params +skel) (Params -> Params) -> m Params -> m Params forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> m Params forall (m :: * -> *). MonadBlockChainBalancing m => m Params @@ -297,32 +297,32 @@ (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM (Params -> TxSkelOut -> Either GenerateTxError TxSkelOut -ensureTxSkelOutHasMinAda Params -theParams) ([TxSkelOut] -> Either GenerateTxError [TxSkelOut]) +ensureTxSkelOutHasMinAda Params +theParams) ([TxSkelOut] -> Either GenerateTxError [TxSkelOut]) -> [TxSkelOut] -> Either GenerateTxError [TxSkelOut] forall a b. (a -> b) -> a -> b $ TxSkel -skel TxSkel -> Optic' A_Lens NoIx TxSkel [TxSkelOut] -> [TxSkelOut] +skel TxSkel -> Optic' A_Lens NoIx TxSkel [TxSkelOut] -> [TxSkelOut] forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a ^. Optic' A_Lens NoIx TxSkel [TxSkelOut] txSkelOutsL of - Left GenerateTxError -err -> MockChainError -> m TxSkel + Left GenerateTxError +err -> MockChainError -> m TxSkel forall e (m :: * -> *) a. MonadError e m => e -> m a throwError (MockChainError -> m TxSkel) -> MockChainError -> m TxSkel forall a b. (a -> b) -> a -> b $ GenerateTxError -> MockChainError MCEGenerationError GenerateTxError -err - Right [TxSkelOut] -newTxSkelOuts -> TxSkel -> m TxSkel +err + Right [TxSkelOut] +newTxSkelOuts -> TxSkel -> m TxSkel forall (m :: * -> *) a. Monad m => a -> m a return (TxSkel -> m TxSkel) -> TxSkel -> m TxSkel forall a b. (a -> b) -> a -> b $ TxSkel -skel TxSkel -> (TxSkel -> TxSkel) -> TxSkel +skel TxSkel -> (TxSkel -> TxSkel) -> TxSkel forall a b. a -> (a -> b) -> b & Optic' A_Lens NoIx TxSkel [TxSkelOut] txSkelOutsL Optic' A_Lens NoIx TxSkel [TxSkelOut] @@ -331,23 +331,23 @@ Is k A_Setter => Optic k is s t a b -> b -> s -> t .~ [TxSkelOut] -newTxSkelOuts +newTxSkelOuts where - ensureTxSkelOutHasMinAda :: Emulator.Params -> TxSkelOut -> Either GenerateTxError TxSkelOut - ensureTxSkelOutHasMinAda :: Params -> TxSkelOut -> Either GenerateTxError TxSkelOut -ensureTxSkelOutHasMinAda Params -theParams txSkelOut :: TxSkelOut -txSkelOut@(Pays o -output) = do - TxOut CtxTx BabbageEra -cardanoTxOut <- Params + ensureTxSkelOutHasMinAda :: Emulator.Params -> TxSkelOut -> Either GenerateTxError TxSkelOut + ensureTxSkelOutHasMinAda :: Params -> TxSkelOut -> Either GenerateTxError TxSkelOut +ensureTxSkelOutHasMinAda Params +theParams txSkelOut :: TxSkelOut +txSkelOut@(Pays o +output) = do + TxOut CtxTx BabbageEra +cardanoTxOut <- Params -> TxSkelOut -> Either GenerateTxError (TxOut CtxTx BabbageEra) txSkelOutToCardanoTxOut Params -theParams TxSkelOut -txSkelOut - let Pl.Lovelace Integer -oldAda = o -output o -> Optic' A_Lens NoIx o Ada -> Ada +theParams TxSkelOut +txSkelOut + let Pl.Lovelace Integer +oldAda = o +output o -> Optic' A_Lens NoIx o Ada -> Ada forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -362,14 +362,14 @@ Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b % Optic A_Lens NoIx Value Value Ada Ada adaL - CardanoLedger.Coin Integer -requiredAda = + CardanoLedger.Coin Integer +requiredAda = PParams (BabbageEra StandardCrypto) -> TxOut (BabbageEra StandardCrypto) -> Coin forall era. CLI era => PParams era -> TxOut era -> Coin CardanoLedger.evaluateMinLovelaceOutput (Params -> PParams Emulator.emulatorPParams Params -theParams) +theParams) (TxOut (BabbageEra StandardCrypto) -> Coin) -> (TxOut CtxTx BabbageEra -> TxOut (BabbageEra StandardCrypto)) -> TxOut CtxTx BabbageEra @@ -393,9 +393,9 @@ (TxOut CtxTx BabbageEra -> Coin) -> TxOut CtxTx BabbageEra -> Coin forall a b. (a -> b) -> a -> b $ TxOut CtxTx BabbageEra -cardanoTxOut - updatedTxSkelOut :: TxSkelOut -updatedTxSkelOut = o -> TxSkelOut +cardanoTxOut + updatedTxSkelOut :: TxSkelOut +updatedTxSkelOut = o -> TxSkelOut forall o. (Show o, Typeable o, IsTxInfoOutput o, IsTxSkelOutAllowedOwner (OwnerType o), Typeable (OwnerType o), @@ -407,7 +407,7 @@ Pays (o -> TxSkelOut) -> o -> TxSkelOut forall a b. (a -> b) -> a -> b $ o -output o -> (o -> o) -> o +output o -> (o -> o) -> o forall a b. a -> (a -> b) -> b & Optic A_Lens NoIx o o Value Value forall o. IsAbstractOutput o => Lens' o (ValueType o) @@ -427,8 +427,8 @@ Pl.Lovelace (Integer -> Integer -> Integer forall a. Ord a => a -> a -> a max Integer -oldAda Integer -requiredAda) +oldAda Integer +requiredAda) -- The following iterative approach to calculate the minimum Ada amount -- of a TxOut is necessary, because the additional value might make the -- TxOut heavier. @@ -436,20 +436,20 @@ -- It is inspired by -- https://github.com/input-output-hk/plutus-apps/blob/8706e6c7c525b4973a7b6d2ed7c9d0ef9cd4ef46/plutus-ledger/src/Ledger/Index.hs#L124 if Integer -oldAda Integer -> Integer -> Bool +oldAda Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool < Integer -requiredAda +requiredAda then Params -> TxSkelOut -> Either GenerateTxError TxSkelOut -ensureTxSkelOutHasMinAda Params -theParams TxSkelOut -updatedTxSkelOut +ensureTxSkelOutHasMinAda Params +theParams TxSkelOut +updatedTxSkelOut else TxSkelOut -> Either GenerateTxError TxSkelOut forall (m :: * -> *) a. Monad m => a -> m a return TxSkelOut -txSkelOut +txSkelOut -txSkelInputUtxosPV2 :: MonadBlockChainBalancing m => TxSkel -> m (Map PV2.TxOutRef PV2.TxOut) +txSkelInputUtxosPV2 :: MonadBlockChainBalancing m => TxSkel -> m (Map PV2.TxOutRef PV2.TxOut) txSkelInputUtxosPV2 :: TxSkel -> m (Map TxOutRef TxOut) txSkelInputUtxosPV2 = [TxOutRef] -> m (Map TxOutRef TxOut) forall (m :: * -> *). @@ -466,7 +466,7 @@ . TxSkel -> Map TxOutRef TxSkelRedeemer txSkelIns -txSkelInputUtxos :: MonadBlockChainBalancing m => TxSkel -> m (Map PV2.TxOutRef Ledger.TxOut) +txSkelInputUtxos :: MonadBlockChainBalancing m => TxSkel -> m (Map PV2.TxOutRef Ledger.TxOut) txSkelInputUtxos :: TxSkel -> m (Map TxOutRef TxOut) txSkelInputUtxos = [TxOutRef] -> m (Map TxOutRef TxOut) forall (m :: * -> *). @@ -483,10 +483,10 @@ . TxSkel -> Map TxOutRef TxSkelRedeemer txSkelIns -txSkelReferenceInputUtxosPV2 :: MonadBlockChainBalancing m => TxSkel -> m (Map PV2.TxOutRef PV2.TxOut) +txSkelReferenceInputUtxosPV2 :: MonadBlockChainBalancing m => TxSkel -> m (Map PV2.TxOutRef PV2.TxOut) txSkelReferenceInputUtxosPV2 :: TxSkel -> m (Map TxOutRef TxOut) -txSkelReferenceInputUtxosPV2 TxSkel -skel = (TxOut -> TxOut) -> Map TxOutRef TxOut -> Map TxOutRef TxOut +txSkelReferenceInputUtxosPV2 TxSkel +skel = (TxOut -> TxOut) -> Map TxOutRef TxOut -> Map TxOutRef TxOut forall a b k. (a -> b) -> Map k a -> Map k b Map.map TxOut -> TxOut txOutV2FromLedger (Map TxOutRef TxOut -> Map TxOutRef TxOut) @@ -497,12 +497,12 @@ MonadBlockChainBalancing m => TxSkel -> m (Map TxOutRef TxOut) txSkelReferenceInputUtxos TxSkel -skel +skel -txSkelReferenceInputUtxos :: MonadBlockChainBalancing m => TxSkel -> m (Map PV2.TxOutRef Ledger.TxOut) +txSkelReferenceInputUtxos :: MonadBlockChainBalancing m => TxSkel -> m (Map PV2.TxOutRef Ledger.TxOut) txSkelReferenceInputUtxos :: TxSkel -> m (Map TxOutRef TxOut) -txSkelReferenceInputUtxos TxSkel -skel = +txSkelReferenceInputUtxos TxSkel +skel = [TxOutRef] -> m (Map TxOutRef TxOut) forall (m :: * -> *). MonadBlockChainBalancing m => @@ -516,12 +516,12 @@ forall a b. (a -> Maybe b) -> [a] -> [b] mapMaybe ( \case - TxSkelRedeemerForReferencedScript TxOutRef -oref redeemer + TxSkelRedeemerForReferencedScript TxOutRef +oref redeemer _ -> TxOutRef -> Maybe TxOutRef forall a. a -> Maybe a Just TxOutRef -oref +oref TxSkelRedeemer _ -> Maybe TxOutRef forall a. Maybe a @@ -534,7 +534,7 @@ forall a b. (a -> b) -> a -> b $ TxSkel -> Map TxOutRef TxSkelRedeemer txSkelIns TxSkel -skel) +skel) [TxOutRef] -> [TxOutRef] -> [TxOutRef] forall a. [a] -> [a] -> [a] ++ (Set TxOutRef -> [TxOutRef] @@ -546,15 +546,15 @@ txSkelInsReference (TxSkel -> [TxOutRef]) -> TxSkel -> [TxOutRef] forall a b. (a -> b) -> a -> b $ TxSkel -skel) +skel) -- | All validators which protect transaction inputs -txSkelInputValidators :: MonadBlockChainBalancing m => TxSkel -> m (Map PV2.ValidatorHash (Pl.Versioned PV2.Validator)) +txSkelInputValidators :: MonadBlockChainBalancing m => TxSkel -> m (Map PV2.ValidatorHash (Pl.Versioned PV2.Validator)) txSkelInputValidators :: TxSkel -> m (Map ValidatorHash (Versioned Validator)) -txSkelInputValidators TxSkel -skel = do - [(TxOutRef, TxOut)] -utxos <- Map TxOutRef TxOut -> [(TxOutRef, TxOut)] +txSkelInputValidators TxSkel +skel = do + [(TxOutRef, TxOut)] +utxos <- Map TxOutRef TxOut -> [(TxOutRef, TxOut)] forall k a. Map k a -> [(k, a)] Map.toList (Map TxOutRef TxOut -> [(TxOutRef, TxOut)]) -> m (Map TxOutRef TxOut) -> m [(TxOutRef, TxOut)] @@ -572,9 +572,9 @@ txSkelIns (TxSkel -> [TxOutRef]) -> TxSkel -> [TxOutRef] forall a b. (a -> b) -> a -> b $ TxSkel -skel) - [Maybe (ValidatorHash, Versioned Validator)] -mValidators <- +skel) + [Maybe (ValidatorHash, Versioned Validator)] +mValidators <- ((TxOutRef, TxOut) -> m (Maybe (ValidatorHash, Versioned Validator))) -> [(TxOutRef, TxOut)] @@ -583,26 +583,26 @@ (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM - ( \(TxOutRef -_oref, TxOut -out) -> case TxOut -> Address + ( \(TxOutRef +_oref, TxOut +out) -> case TxOut -> Address forall o. (IsAbstractOutput o, ToCredential (OwnerType o)) => o -> Address outputAddress TxOut -out of - PV2.Address (PV2.ScriptCredential ValidatorHash -valHash) Maybe StakingCredential +out of + PV2.Address (PV2.ScriptCredential ValidatorHash +valHash) Maybe StakingCredential _ -> do - Maybe (Versioned Validator) -mVal <- ValidatorHash -> m (Maybe (Versioned Validator)) + Maybe (Versioned Validator) +mVal <- ValidatorHash -> m (Maybe (Versioned Validator)) forall (m :: * -> *). MonadBlockChainBalancing m => ValidatorHash -> m (Maybe (Versioned Validator)) validatorFromHash ValidatorHash -valHash +valHash case Maybe (Versioned Validator) -mVal of +mVal of Maybe (Versioned Validator) Nothing -> MockChainError -> m (Maybe (ValidatorHash, Versioned Validator)) @@ -616,9 +616,9 @@ [Char] "txSkelInputValidators: unkown validator hash on transaction input" ValidatorHash -valHash - Just Versioned Validator -val -> Maybe (ValidatorHash, Versioned Validator) +valHash + Just Versioned Validator +val -> Maybe (ValidatorHash, Versioned Validator) -> m (Maybe (ValidatorHash, Versioned Validator)) forall (m :: * -> *) a. Monad m => a -> m a return (Maybe (ValidatorHash, Versioned Validator) @@ -630,8 +630,8 @@ -> Maybe (ValidatorHash, Versioned Validator) forall a. a -> Maybe a Just (ValidatorHash -valHash, Versioned Validator -val) +valHash, Versioned Validator +val) Address _ -> Maybe (ValidatorHash, Versioned Validator) -> m (Maybe (ValidatorHash, Versioned Validator)) @@ -641,7 +641,7 @@ Nothing ) [(TxOutRef, TxOut)] -utxos +utxos Map ValidatorHash (Versioned Validator) -> m (Map ValidatorHash (Versioned Validator)) forall (m :: * -> *) a. Monad m => a -> m a @@ -671,15 +671,15 @@ -> m (Map ValidatorHash (Versioned Validator)) forall a b. (a -> b) -> a -> b $ [Maybe (ValidatorHash, Versioned Validator)] -mValidators +mValidators -- Go through all of the 'PV2.TxOutRef's in the list and look them up in the -- state of the blockchain. If any 'PV2.TxOutRef' can't be resolved, throw an -- error. -lookupUtxosPV2 :: MonadBlockChainBalancing m => [PV2.TxOutRef] -> m (Map PV2.TxOutRef PV2.TxOut) +lookupUtxosPV2 :: MonadBlockChainBalancing m => [PV2.TxOutRef] -> m (Map PV2.TxOutRef PV2.TxOut) lookupUtxosPV2 :: [TxOutRef] -> m (Map TxOutRef TxOut) -lookupUtxosPV2 [TxOutRef] -outRefs = (TxOut -> TxOut) -> Map TxOutRef TxOut -> Map TxOutRef TxOut +lookupUtxosPV2 [TxOutRef] +outRefs = (TxOut -> TxOut) -> Map TxOutRef TxOut -> Map TxOutRef TxOut forall a b k. (a -> b) -> Map k a -> Map k b Map.map TxOut -> TxOut txOutV2FromLedger (Map TxOutRef TxOut -> Map TxOutRef TxOut) @@ -690,12 +690,12 @@ MonadBlockChainBalancing m => [TxOutRef] -> m (Map TxOutRef TxOut) lookupUtxos [TxOutRef] -outRefs +outRefs -lookupUtxos :: MonadBlockChainBalancing m => [PV2.TxOutRef] -> m (Map PV2.TxOutRef Ledger.TxOut) +lookupUtxos :: MonadBlockChainBalancing m => [PV2.TxOutRef] -> m (Map PV2.TxOutRef Ledger.TxOut) lookupUtxos :: [TxOutRef] -> m (Map TxOutRef TxOut) -lookupUtxos [TxOutRef] -outRefs = do +lookupUtxos [TxOutRef] +outRefs = do [(TxOutRef, TxOut)] -> Map TxOutRef TxOut forall k a. Ord k => [(k, a)] -> Map k a Map.fromList @@ -708,18 +708,18 @@ (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM - ( \TxOutRef -oRef -> do - Maybe TxOut -mOut <- TxOutRef -> m (Maybe TxOut) + ( \TxOutRef +oRef -> do + Maybe TxOut +mOut <- TxOutRef -> m (Maybe TxOut) forall (m :: * -> *). MonadBlockChainBalancing m => TxOutRef -> m (Maybe TxOut) txOutByRefLedger TxOutRef -oRef - TxOut -out <- case Maybe TxOut -mOut of +oRef + TxOut +out <- case Maybe TxOut +mOut of Maybe TxOut Nothing -> MockChainError -> m TxOut @@ -732,34 +732,34 @@ [Char] "lookupUtxos: unknown TxOutRef" TxOutRef -oRef - Just TxOut -out -> TxOut -> m TxOut +oRef + Just TxOut +out -> TxOut -> m TxOut forall (m :: * -> *) a. Monad m => a -> m a return TxOut -out +out (TxOutRef, TxOut) -> m (TxOutRef, TxOut) forall (m :: * -> *) a. Monad m => a -> m a return (TxOutRef -oRef, TxOut -out) +oRef, TxOut +out) ) [TxOutRef] -outRefs +outRefs -- | look up the UTxOs the transaction consumes, and sum the value contained in -- them. -txSkelInputValue :: MonadBlockChainBalancing m => TxSkel -> m PV2.Value +txSkelInputValue :: MonadBlockChainBalancing m => TxSkel -> m PV2.Value txSkelInputValue :: TxSkel -> m Value -txSkelInputValue TxSkel -skel = do - Map TxOutRef TxOut -txSkelInputs <- TxSkel -> m (Map TxOutRef TxOut) +txSkelInputValue TxSkel +skel = do + Map TxOutRef TxOut +txSkelInputs <- TxSkel -> m (Map TxOutRef TxOut) forall (m :: * -> *). MonadBlockChainBalancing m => TxSkel -> m (Map TxOutRef TxOut) txSkelInputUtxos TxSkel -skel +skel Value -> m Value forall (m :: * -> *) a. Monad m => a -> m a return (Value -> m Value) -> Value -> m Value @@ -773,15 +773,15 @@ forall b c a. (b -> c) -> (a -> b) -> a -> c . TxOut -> TxOut txOutV2FromLedger) Map TxOutRef TxOut -txSkelInputs +txSkelInputs -- | Look up the data on UTxOs the transaction consumes. -txSkelInputData :: MonadBlockChainBalancing m => TxSkel -> m (Map PV2.DatumHash PV2.Datum) +txSkelInputData :: MonadBlockChainBalancing m => TxSkel -> m (Map PV2.DatumHash PV2.Datum) txSkelInputData :: TxSkel -> m (Map DatumHash Datum) -txSkelInputData TxSkel -skel = do - [TxOut] -txSkelInputs <- Map TxOutRef TxOut -> [TxOut] +txSkelInputData TxSkel +skel = do + [TxOut] +txSkelInputs <- Map TxOutRef TxOut -> [TxOut] forall k a. Map k a -> [a] Map.elems (Map TxOutRef TxOut -> [TxOut]) -> m (Map TxOutRef TxOut) -> m [TxOut] @@ -791,19 +791,19 @@ MonadBlockChainBalancing m => TxSkel -> m (Map TxOutRef TxOut) txSkelInputUtxosPV2 TxSkel -skel - [Maybe (DatumHash, Datum)] -mDatums <- +skel + [Maybe (DatumHash, Datum)] +mDatums <- (TxOut -> m (Maybe (DatumHash, Datum))) -> [TxOut] -> m [Maybe (DatumHash, Datum)] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM - ( \TxOut -output -> + ( \TxOut +output -> case TxOut -output TxOut -> Optic' A_Lens NoIx TxOut OutputDatum -> OutputDatum +output TxOut -> Optic' A_Lens NoIx TxOut OutputDatum -> OutputDatum forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -816,12 +816,12 @@ return Maybe (DatumHash, Datum) forall a. Maybe a Nothing - PV2.OutputDatum Datum -datum -> - let dHash :: DatumHash -dHash = Datum -> DatumHash + PV2.OutputDatum Datum +datum -> + let dHash :: DatumHash +dHash = Datum -> DatumHash Pl.datumHash Datum -datum +datum in (DatumHash, Datum) -> Maybe (DatumHash, Datum) forall a. a -> Maybe a Just ((DatumHash, Datum) -> Maybe (DatumHash, Datum)) @@ -830,17 +830,17 @@ -> Maybe (DatumHash, Datum) forall b c a. (b -> c) -> (a -> b) -> a -> c . (DatumHash -dHash,) (Datum -> Maybe (DatumHash, Datum)) +dHash,) (Datum -> Maybe (DatumHash, Datum)) -> m Datum -> m (Maybe (DatumHash, Datum)) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> DatumHash -> m Datum forall (m :: * -> *). MonadBlockChainBalancing m => DatumHash -> m Datum -datumFromHashWithError DatumHash -dHash - PV2.OutputDatumHash DatumHash -dHash -> +datumFromHashWithError DatumHash +dHash + PV2.OutputDatumHash DatumHash +dHash -> (DatumHash, Datum) -> Maybe (DatumHash, Datum) forall a. a -> Maybe a Just ((DatumHash, Datum) -> Maybe (DatumHash, Datum)) @@ -849,18 +849,18 @@ -> Maybe (DatumHash, Datum) forall b c a. (b -> c) -> (a -> b) -> a -> c . (DatumHash -dHash,) (Datum -> Maybe (DatumHash, Datum)) +dHash,) (Datum -> Maybe (DatumHash, Datum)) -> m Datum -> m (Maybe (DatumHash, Datum)) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> DatumHash -> m Datum forall (m :: * -> *). MonadBlockChainBalancing m => DatumHash -> m Datum -datumFromHashWithError DatumHash -dHash +datumFromHashWithError DatumHash +dHash ) [TxOut] -txSkelInputs +txSkelInputs Map DatumHash Datum -> m (Map DatumHash Datum) forall (m :: * -> *) a. Monad m => a -> m a return (Map DatumHash Datum -> m (Map DatumHash Datum)) @@ -881,21 +881,21 @@ -> [Maybe (DatumHash, Datum)] -> m (Map DatumHash Datum) forall a b. (a -> b) -> a -> b $ [Maybe (DatumHash, Datum)] -mDatums +mDatums where - datumFromHashWithError :: MonadBlockChainBalancing m => Pl.DatumHash -> m PV2.Datum - datumFromHashWithError :: DatumHash -> m Datum -datumFromHashWithError DatumHash -dHash = do - Maybe Datum -mDatum <- DatumHash -> m (Maybe Datum) + datumFromHashWithError :: MonadBlockChainBalancing m => Pl.DatumHash -> m PV2.Datum + datumFromHashWithError :: DatumHash -> m Datum +datumFromHashWithError DatumHash +dHash = do + Maybe Datum +mDatum <- DatumHash -> m (Maybe Datum) forall (m :: * -> *). MonadBlockChainBalancing m => DatumHash -> m (Maybe Datum) datumFromHash DatumHash -dHash +dHash case Maybe Datum -mDatum of +mDatum of Maybe Datum Nothing -> MockChainError -> m Datum @@ -908,20 +908,20 @@ [Char] "txSkelInputData: Transaction input with un-resolvable datum hash" DatumHash -dHash - Just Datum -datum -> Datum -> m Datum +dHash + Just Datum +datum -> Datum -> m Datum forall (m :: * -> *) a. Monad m => a -> m a return Datum -datum +datum getEmulatorUTxO :: Map PV2.TxOutRef Ledger.TxOut -> Either Ledger.ToCardanoError (Emulator.UTxO Emulator.EmulatorEra) getEmulatorUTxO :: Map TxOutRef TxOut -> Either ToCardanoError (UTxO (BabbageEra StandardCrypto)) -getEmulatorUTxO Map TxOutRef TxOut -m = +getEmulatorUTxO Map TxOutRef TxOut +m = ([(TxIn, TxOut CtxUTxO BabbageEra)] -> UTxO (BabbageEra StandardCrypto)) -> Either ToCardanoError [(TxIn, TxOut CtxUTxO BabbageEra)] @@ -957,9 +957,9 @@ forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) -mapM (\(TxOutRef -k, TxOut -v) -> (,) (TxIn +mapM (\(TxOutRef +k, TxOut +v) -> (,) (TxIn -> TxOut CtxUTxO BabbageEra -> (TxIn, TxOut CtxUTxO BabbageEra)) -> Either ToCardanoError TxIn -> Either @@ -968,7 +968,7 @@ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> TxOutRef -> Either ToCardanoError TxIn Ledger.toCardanoTxIn TxOutRef -k Either +k Either ToCardanoError (TxOut CtxUTxO BabbageEra -> (TxIn, TxOut CtxUTxO BabbageEra)) -> Either ToCardanoError (TxOut CtxUTxO BabbageEra) @@ -979,7 +979,7 @@ forall (f :: * -> *) a. Applicative f => a -> f a pure (TxOut -> TxOut CtxUTxO BabbageEra Ledger.toCtxUTxOTxOut TxOut -v)) ([(TxOutRef, TxOut)] +v)) ([(TxOutRef, TxOut)] -> Either ToCardanoError [(TxIn, TxOut CtxUTxO BabbageEra)]) -> [(TxOutRef, TxOut)] -> Either ToCardanoError [(TxIn, TxOut CtxUTxO BabbageEra)] @@ -988,7 +988,7 @@ Map TxOutRef TxOut -> [(TxOutRef, TxOut)] forall k a. Map k a -> [(k, a)] Map.toList Map TxOutRef TxOut -m +m -- ensuring that the equation -- @@ -1003,14 +1003,14 @@ -- -- This function also adjusts the transaction outputs to contain at least the -- minimum Ada amount, if the 'txOptEnsureMinAda option is @True@. -setFeeAndBalance :: MonadBlockChainBalancing m => Wallet -> TxSkel -> m (TxSkel, Fee) +setFeeAndBalance :: MonadBlockChainBalancing m => Wallet -> TxSkel -> m (TxSkel, Fee) setFeeAndBalance :: Wallet -> TxSkel -> m (TxSkel, Fee) -setFeeAndBalance Wallet -balanceWallet TxSkel -skel0 = do +setFeeAndBalance Wallet +balanceWallet TxSkel +skel0 = do -- do the min Ada adjustment if it's requested - TxSkel -skel <- + TxSkel +skel <- if TxOpts -> Bool txOptEnsureMinAda (TxOpts -> Bool) -> (TxSkel -> TxOpts) -> TxSkel -> Bool forall b c a. (b -> c) -> (a -> b) -> a -> c @@ -1018,33 +1018,33 @@ txSkelOpts (TxSkel -> Bool) -> TxSkel -> Bool forall a b. (a -> b) -> a -> b $ TxSkel -skel0 +skel0 then TxSkel -> m TxSkel forall (m :: * -> *). MonadBlockChainBalancing m => TxSkel -> m TxSkel ensureTxSkelOutsMinAda TxSkel -skel0 +skel0 else TxSkel -> m TxSkel forall (m :: * -> *) a. Monad m => a -> m a return TxSkel -skel0 +skel0 -- Candidate UTxOs to spend for balancing - Map TxOutRef TxOut -balancePKUtxos <- + Map TxOutRef TxOut +balancePKUtxos <- [(TxOutRef, TxOut)] -> Map TxOutRef TxOut forall k a. Ord k => [(k, a)] -> Map k a Map.fromList ([(TxOutRef, TxOut)] -> Map TxOutRef TxOut) -> m [(TxOutRef, TxOut)] -> m (Map TxOutRef TxOut) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b -<$> let balanceWalletAddress :: Address -balanceWalletAddress = Wallet -> Address +<$> let balanceWalletAddress :: Address +balanceWalletAddress = Wallet -> Address walletAddress Wallet -balanceWallet - noDatumPredicate :: TxOut -> Bool -noDatumPredicate = (\case OutputDatum +balanceWallet + noDatumPredicate :: TxOut -> Bool +noDatumPredicate = (\case OutputDatum PV2.NoOutputDatum -> Bool True; OutputDatum _ -> Bool @@ -1066,14 +1066,14 @@ txSkelOpts (TxSkel -> BalancingUtxos) -> TxSkel -> BalancingUtxos forall a b. (a -> b) -> a -> b $ TxSkel -skel0 of +skel0 of BalancingUtxos BalancingUtxosAll -> Address -> m [(TxOutRef, TxOut)] forall (m :: * -> *). MonadBlockChainBalancing m => Address -> m [(TxOutRef, TxOut)] utxosAtLedger Address -balanceWalletAddress +balanceWalletAddress BalancingUtxos BalancingUtxosDatumless -> UtxoSearch m TxOut -> m [(TxOutRef, TxOut)] forall (m :: * -> *) a. @@ -1084,20 +1084,20 @@ MonadBlockChainBalancing m => Address -> UtxoSearch m TxOut utxosAtLedgerSearch Address -balanceWalletAddress UtxoSearch m TxOut -> (TxOut -> Bool) -> UtxoSearch m TxOut +balanceWalletAddress UtxoSearch m TxOut -> (TxOut -> Bool) -> UtxoSearch m TxOut forall (m :: * -> *) a. Monad m => UtxoSearch m a -> (a -> Bool) -> UtxoSearch m a `filterWithPred` TxOut -> Bool -noDatumPredicate) - BalancingUtxosAllowlist [TxOutRef] -txOutRefs -> ((TxOutRef, TxOut) -> Bool) +noDatumPredicate) + BalancingUtxosAllowlist [TxOutRef] +txOutRefs -> ((TxOutRef, TxOut) -> Bool) -> [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)] forall a. (a -> Bool) -> [a] -> [a] filter ((TxOutRef -> [TxOutRef] -> Bool forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool `elem` [TxOutRef] -txOutRefs) (TxOutRef -> Bool) +txOutRefs) (TxOutRef -> Bool) -> ((TxOutRef, TxOut) -> TxOutRef) -> (TxOutRef, TxOut) -> Bool forall b c a. (b -> c) -> (a -> b) -> a -> c . (TxOutRef, TxOut) -> TxOutRef @@ -1110,9 +1110,9 @@ MonadBlockChainBalancing m => Address -> m [(TxOutRef, TxOut)] utxosAtLedger Address -balanceWalletAddress - BalancingUtxosBlocklist [TxOutRef] -txOutRefs -> ((TxOutRef, TxOut) -> Bool) +balanceWalletAddress + BalancingUtxosBlocklist [TxOutRef] +txOutRefs -> ((TxOutRef, TxOut) -> Bool) -> [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)] forall a. (a -> Bool) -> [a] -> [a] filter (Bool -> Bool @@ -1122,7 +1122,7 @@ . (TxOutRef -> [TxOutRef] -> Bool forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool `elem` [TxOutRef] -txOutRefs) (TxOutRef -> Bool) +txOutRefs) (TxOutRef -> Bool) -> ((TxOutRef, TxOut) -> TxOutRef) -> (TxOutRef, TxOut) -> Bool forall b c a. (b -> c) -> (a -> b) -> a -> c . (TxOutRef, TxOut) -> TxOutRef @@ -1135,26 +1135,26 @@ MonadBlockChainBalancing m => Address -> m [(TxOutRef, TxOut)] utxosAtLedger Address -balanceWalletAddress +balanceWalletAddress -- all UTxOs that the txSkel consumes. - Map TxOutRef TxOut -txSkelUtxos <- TxSkel -> m (Map TxOutRef TxOut) + Map TxOutRef TxOut +txSkelUtxos <- TxSkel -> m (Map TxOutRef TxOut) forall (m :: * -> *). MonadBlockChainBalancing m => TxSkel -> m (Map TxOutRef TxOut) txSkelInputUtxos TxSkel -skel +skel -- all UTxOs that the txSkel references. - Map TxOutRef TxOut -txSkelReferencedUtxos <- TxSkel -> m (Map TxOutRef TxOut) + Map TxOutRef TxOut +txSkelReferencedUtxos <- TxSkel -> m (Map TxOutRef TxOut) forall (m :: * -> *). MonadBlockChainBalancing m => TxSkel -> m (Map TxOutRef TxOut) txSkelReferenceInputUtxos TxSkel -skel - let index :: Either ToCardanoError (UTxO (BabbageEra StandardCrypto)) -index = Map TxOutRef TxOut +skel + let index :: Either ToCardanoError (UTxO (BabbageEra StandardCrypto)) +index = Map TxOutRef TxOut -> Either ToCardanoError (UTxO (BabbageEra StandardCrypto)) getEmulatorUTxO (Map TxOutRef TxOut -> Either ToCardanoError (UTxO (BabbageEra StandardCrypto))) @@ -1162,17 +1162,17 @@ -> Either ToCardanoError (UTxO (BabbageEra StandardCrypto)) forall a b. (a -> b) -> a -> b $ Map TxOutRef TxOut -txSkelReferencedUtxos Map TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut +txSkelReferencedUtxos Map TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut forall a. Semigroup a => a -> a -> a <> Map TxOutRef TxOut -txSkelUtxos Map TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut +txSkelUtxos Map TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut forall a. Semigroup a => a -> a -> a <> Map TxOutRef TxOut -balancePKUtxos +balancePKUtxos case Either ToCardanoError (UTxO (BabbageEra StandardCrypto)) -index of - Left ToCardanoError -err -> MockChainError -> m (TxSkel, Fee) +index of + Left ToCardanoError +err -> MockChainError -> m (TxSkel, Fee) forall e (m :: * -> *) a. MonadError e m => e -> m a throwError (MockChainError -> m (TxSkel, Fee)) -> MockChainError -> m (TxSkel, Fee) @@ -1186,16 +1186,16 @@ ++ ToCardanoError -> [Char] forall a. Show a => a -> [Char] show ToCardanoError -err - Right UTxO (BabbageEra StandardCrypto) -cUtxoIndex -> do +err + Right UTxO (BabbageEra StandardCrypto) +cUtxoIndex -> do -- We start with a high startingFee, but theres a chance that 'w' doesn't have enough funds -- so we'll see an unbalanceable error; in that case, we switch to the minimum fee and try again. -- That feels very much like a hack, and it is. Maybe we should witch to starting with a small -- fee and then increasing, but that might require more iterations until its settled. -- For now, let's keep it just like the folks from plutus-apps did it. - let startingFee :: Fee -startingFee = Integer -> Fee + let startingFee :: Fee +startingFee = Integer -> Fee Fee Integer 3000000 Int @@ -1210,11 +1210,11 @@ -> UTxO (BabbageEra StandardCrypto) -> TxSkel -> m (TxSkel, Fee) -calcFee Int +calcFee Int 5 Fee -startingFee UTxO (BabbageEra StandardCrypto) -cUtxoIndex TxSkel -skel +startingFee UTxO (BabbageEra StandardCrypto) +cUtxoIndex TxSkel +skel m (TxSkel, Fee) -> (MockChainError -> m (TxSkel, Fee)) -> m (TxSkel, Fee) forall e (m :: * -> *) a. @@ -1230,8 +1230,8 @@ -- since we work on "TxSkel". However, for now, the -- implementation of "Pl.minFee" is a constant of 10 lovelace. -- https://github.com/input-output-hk/plutus-apps/blob/d4255f05477fd8477ee9673e850ebb9ebb8c9657/plutus-ledger/src/Ledger/Index.hs#L116 - let minFee :: Fee -minFee = Integer -> Fee + let minFee :: Fee +minFee = Integer -> Fee Fee Integer 10 -- forall tx. Pl.minFee tx = 10 lovelace in Int @@ -1246,88 +1246,88 @@ -> UTxO (BabbageEra StandardCrypto) -> TxSkel -> m (TxSkel, Fee) -calcFee Int +calcFee Int 5 Fee -minFee UTxO (BabbageEra StandardCrypto) -cUtxoIndex TxSkel -skel +minFee UTxO (BabbageEra StandardCrypto) +cUtxoIndex TxSkel +skel -- Impossible to generate the Cardano transaction at all - MockChainError -e -> MockChainError -> m (TxSkel, Fee) + MockChainError +e -> MockChainError -> m (TxSkel, Fee) forall e (m :: * -> *) a. MonadError e m => e -> m a throwError MockChainError -e +e where -- Inspired by https://github.com/input-output-hk/plutus-apps/blob/d4255f05477fd8477ee9673e850ebb9ebb8c9657/plutus-contract/src/Wallet/Emulator/Wallet.hs#L329 - calcFee :: - MonadBlockChainBalancing m => + calcFee :: + MonadBlockChainBalancing m => Int -> Fee -> Emulator.UTxO Emulator.EmulatorEra -> TxSkel -> - m (TxSkel, Fee) - calcFee :: Int + m (TxSkel, Fee) + calcFee :: Int -> Fee -> UTxO (BabbageEra StandardCrypto) -> TxSkel -> m (TxSkel, Fee) -calcFee Int -n Fee -fee UTxO (BabbageEra StandardCrypto) -cUtxoIndex TxSkel -skel = do - TxSkel -attemptedSkel <- Wallet -> TxSkel -> Fee -> m TxSkel +calcFee Int +n Fee +fee UTxO (BabbageEra StandardCrypto) +cUtxoIndex TxSkel +skel = do + TxSkel +attemptedSkel <- Wallet -> TxSkel -> Fee -> m TxSkel forall (m :: * -> *). MonadBlockChainBalancing m => Wallet -> TxSkel -> Fee -> m TxSkel balanceTxFromAux Wallet -balanceWallet TxSkel -skel Fee -fee - Map DatumHash Datum -managedData <- TxSkel -> m (Map DatumHash Datum) +balanceWallet TxSkel +skel Fee +fee + Map DatumHash Datum +managedData <- TxSkel -> m (Map DatumHash Datum) forall (m :: * -> *). MonadBlockChainBalancing m => TxSkel -> m (Map DatumHash Datum) txSkelInputData TxSkel -skel - Map TxOutRef TxOut -managedTxOuts <- do - Map TxOutRef TxOut -ins <- TxSkel -> m (Map TxOutRef TxOut) +skel + Map TxOutRef TxOut +managedTxOuts <- do + Map TxOutRef TxOut +ins <- TxSkel -> m (Map TxOutRef TxOut) forall (m :: * -> *). MonadBlockChainBalancing m => TxSkel -> m (Map TxOutRef TxOut) txSkelInputUtxosPV2 TxSkel -skel - Map TxOutRef TxOut -insRef <- TxSkel -> m (Map TxOutRef TxOut) +skel + Map TxOutRef TxOut +insRef <- TxSkel -> m (Map TxOutRef TxOut) forall (m :: * -> *). MonadBlockChainBalancing m => TxSkel -> m (Map TxOutRef TxOut) txSkelReferenceInputUtxosPV2 TxSkel -skel +skel Map TxOutRef TxOut -> m (Map TxOutRef TxOut) forall (m :: * -> *) a. Monad m => a -> m a return (Map TxOutRef TxOut -> m (Map TxOutRef TxOut)) -> Map TxOutRef TxOut -> m (Map TxOutRef TxOut) forall a b. (a -> b) -> a -> b $ Map TxOutRef TxOut -ins Map TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut +ins Map TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut forall a. Semigroup a => a -> a -> a <> Map TxOutRef TxOut -insRef - Map ValidatorHash (Versioned Validator) -managedValidators <- TxSkel -> m (Map ValidatorHash (Versioned Validator)) +insRef + Map ValidatorHash (Versioned Validator) +managedValidators <- TxSkel -> m (Map ValidatorHash (Versioned Validator)) forall (m :: * -> *). MonadBlockChainBalancing m => TxSkel -> m (Map ValidatorHash (Versioned Validator)) txSkelInputValidators TxSkel -skel - Params -theParams <- Maybe EmulatorParamsModification -> Params -> Params +skel + Params +theParams <- Maybe EmulatorParamsModification -> Params -> Params applyEmulatorParamsModification (TxOpts -> Maybe EmulatorParamsModification txOptEmulatorParamsModification (TxOpts -> Maybe EmulatorParamsModification) -> (TxSkel -> TxOpts) -> TxSkel -> Maybe EmulatorParamsModification @@ -1337,7 +1337,7 @@ -> TxSkel -> Maybe EmulatorParamsModification forall a b. (a -> b) -> a -> b $ TxSkel -skel) (Params -> Params) -> m Params -> m Params +skel) (Params -> Params) -> m Params -> m Params forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> m Params forall (m :: * -> *). MonadBlockChainBalancing m => m Params @@ -1351,45 +1351,45 @@ -> Fee -> Either MockChainError Fee estimateTxSkelFee Params -theParams UTxO (BabbageEra StandardCrypto) -cUtxoIndex Map DatumHash Datum -managedData Map TxOutRef TxOut -managedTxOuts Map ValidatorHash (Versioned Validator) -managedValidators TxSkel -attemptedSkel Fee -fee of +theParams UTxO (BabbageEra StandardCrypto) +cUtxoIndex Map DatumHash Datum +managedData Map TxOutRef TxOut +managedTxOuts Map ValidatorHash (Versioned Validator) +managedValidators TxSkel +attemptedSkel Fee +fee of -- necessary to capture script failure for failed cases - Left err :: MockChainError -err@MCEValidationError {} -> MockChainError -> m (TxSkel, Fee) + Left err :: MockChainError +err@MCEValidationError {} -> MockChainError -> m (TxSkel, Fee) forall e (m :: * -> *) a. MonadError e m => e -> m a throwError MockChainError -err - Left MockChainError -err -> MockChainError -> m (TxSkel, Fee) +err + Left MockChainError +err -> MockChainError -> m (TxSkel, Fee) forall e (m :: * -> *) a. MonadError e m => e -> m a throwError (MockChainError -> m (TxSkel, Fee)) -> MockChainError -> m (TxSkel, Fee) forall a b. (a -> b) -> a -> b $ MockChainError -> MockChainError MCECalcFee MockChainError -err - Right Fee -newFee +err + Right Fee +newFee | Fee -newFee Fee -> Fee -> Bool +newFee Fee -> Fee -> Bool forall a. Eq a => a -> a -> Bool == Fee -fee -> do +fee -> do -- Debug.Trace.traceM "Reached fixpoint:" -- Debug.Trace.traceM $ "- fee = " <> show fee -- Debug.Trace.traceM $ "- skeleton = " <> show (attemptedSkel {_txSkelFee = fee}) (TxSkel, Fee) -> m (TxSkel, Fee) forall (f :: * -> *) a. Applicative f => a -> f a pure (TxSkel -attemptedSkel, Fee -fee) -- reached fixpoint +attemptedSkel, Fee +fee) -- reached fixpoint | Int -n Int -> Int -> Bool +n Int -> Int -> Bool forall a. Eq a => a -> a -> Bool == Int 0 -> do @@ -1397,11 +1397,11 @@ (TxSkel, Fee) -> m (TxSkel, Fee) forall (f :: * -> *) a. Applicative f => a -> f a pure (TxSkel -attemptedSkel, Fee -> Fee -> Fee +attemptedSkel, Fee -> Fee -> Fee forall a. Ord a => a -> a -> a max Fee -newFee Fee -fee) -- maximum number of iterations +newFee Fee +fee) -- maximum number of iterations | Bool otherwise -> do -- Debug.Trace.traceM $ "New iteration: newfee = " <> show newFee @@ -1417,14 +1417,14 @@ -> UTxO (BabbageEra StandardCrypto) -> TxSkel -> m (TxSkel, Fee) -calcFee (Int -n Int -> Int -> Int +calcFee (Int +n Int -> Int -> Int forall a. Num a => a -> a -> a - Int 1) Fee -newFee UTxO (BabbageEra StandardCrypto) -cUtxoIndex TxSkel -skel +newFee UTxO (BabbageEra StandardCrypto) +cUtxoIndex TxSkel +skel -- | This funcion is essentially a copy of -- https://github.com/input-output-hk/plutus-apps/blob/d4255f05477fd8477ee9673e850ebb9ebb8c9657/plutus-ledger/src/Ledger/Fee.hs#L19 @@ -1445,16 +1445,16 @@ -> TxSkel -> Fee -> Either MockChainError Fee -estimateTxSkelFee Params -params UTxO (BabbageEra StandardCrypto) -cUtxoIndex Map DatumHash Datum -managedData Map TxOutRef TxOut -managedTxOuts Map ValidatorHash (Versioned Validator) -managedValidators TxSkel -skel Fee -fee = do - TxBodyContent BuildTx BabbageEra -txBodyContent <- +estimateTxSkelFee Params +params UTxO (BabbageEra StandardCrypto) +cUtxoIndex Map DatumHash Datum +managedData Map TxOutRef TxOut +managedTxOuts Map ValidatorHash (Versioned Validator) +managedValidators TxSkel +skel Fee +fee = do + TxBodyContent BuildTx BabbageEra +txBodyContent <- (GenerateTxError -> MockChainError) -> Either GenerateTxError (TxBodyContent BuildTx BabbageEra) -> Either MockChainError (TxBodyContent BuildTx BabbageEra) @@ -1479,19 +1479,19 @@ forall a. Default a => a def {gtpFee :: Fee gtpFee = Fee -fee} Params -params Map DatumHash Datum -managedData Map TxOutRef TxOut -managedTxOuts Map ValidatorHash (Versioned Validator) -managedValidators TxSkel -skel - let nkeys :: Word -nkeys = TxBodyContent BuildTx BabbageEra -> Word +fee} Params +params Map DatumHash Datum +managedData Map TxOutRef TxOut +managedTxOuts Map ValidatorHash (Versioned Validator) +managedValidators TxSkel +skel + let nkeys :: Word +nkeys = TxBodyContent BuildTx BabbageEra -> Word forall era. TxBodyContent BuildTx era -> Word C.estimateTransactionKeyWitnessCount TxBodyContent BuildTx BabbageEra -txBodyContent - TxBody BabbageEra -txBody <- +txBodyContent + TxBody BabbageEra +txBody <- (Either ValidationErrorInPhase ToCardanoError -> MockChainError) -> Either (Either ValidationErrorInPhase ToCardanoError) (TxBody BabbageEra) @@ -1501,16 +1501,16 @@ a b c -> a (Either b d) (Either c d) left ( \case - Left ValidationErrorInPhase -err -> ValidationErrorInPhase -> MockChainError + Left ValidationErrorInPhase +err -> ValidationErrorInPhase -> MockChainError MCEValidationError ValidationErrorInPhase -err - Right ToCardanoError -err -> GenerateTxError -> MockChainError +err + Right ToCardanoError +err -> GenerateTxError -> MockChainError MCEGenerationError ([Char] -> ToCardanoError -> GenerateTxError ToCardanoError [Char] "makeTransactionBody" ToCardanoError -err) +err) ) (Either (Either ValidationErrorInPhase ToCardanoError) (TxBody BabbageEra) @@ -1525,37 +1525,37 @@ -> Either (Either ValidationErrorInPhase ToCardanoError) (TxBody BabbageEra) Emulator.makeTransactionBody Params -params UTxO (BabbageEra StandardCrypto) -cUtxoIndex (TxBodyContent BuildTx BabbageEra -> CardanoBuildTx +params UTxO (BabbageEra StandardCrypto) +cUtxoIndex (TxBodyContent BuildTx BabbageEra -> CardanoBuildTx Ledger.CardanoBuildTx TxBodyContent BuildTx BabbageEra -txBodyContent) +txBodyContent) case ProtocolParameters -> TxBody BabbageEra -> Word -> Word -> Lovelace forall era. IsShelleyBasedEra era => ProtocolParameters -> TxBody era -> Word -> Word -> Lovelace C.evaluateTransactionFee (Params -> ProtocolParameters Emulator.pProtocolParams Params -params) TxBody BabbageEra -txBody Word -nkeys Word +params) TxBody BabbageEra +txBody Word +nkeys Word 0 of - C.Lovelace Integer -fee -> Fee -> Either MockChainError Fee + C.Lovelace Integer +fee -> Fee -> Either MockChainError Fee forall (f :: * -> *) a. Applicative f => a -> f a pure (Fee -> Either MockChainError Fee) -> Fee -> Either MockChainError Fee forall a b. (a -> b) -> a -> b $ Integer -> Fee Fee Integer -fee +fee -- | Calculates the collateral for a transaction -calcCollateral :: MonadBlockChainBalancing m => Wallet -> m (Set PV2.TxOutRef) +calcCollateral :: MonadBlockChainBalancing m => Wallet -> m (Set PV2.TxOutRef) calcCollateral :: Wallet -> m (Set TxOutRef) -calcCollateral Wallet -w = do - [(TxOutRef, ConcreteOutput Credential () Ada ScriptHash)] -souts <- +calcCollateral Wallet +w = do + [(TxOutRef, ConcreteOutput Credential () Ada ScriptHash)] +souts <- UtxoSearch m (ConcreteOutput Credential () Ada ScriptHash) -> m [(TxOutRef, ConcreteOutput Credential () Ada ScriptHash)] forall (m :: * -> *) a. @@ -1573,7 +1573,7 @@ Address -> UtxoSearch m TxOut utxosAtSearch (Wallet -> Address walletAddress Wallet -w) +w) UtxoSearch m TxOut -> (TxOut -> Maybe (ConcreteOutput Credential () Value ScriptHash)) -> UtxoSearch m (ConcreteOutput Credential () Value ScriptHash) @@ -1615,7 +1615,7 @@ when ([(TxOutRef, ConcreteOutput Credential () Ada ScriptHash)] -> Bool forall (t :: * -> *) a. Foldable t => t a -> Bool null [(TxOutRef, ConcreteOutput Credential () Ada ScriptHash)] -souts) (m () -> m ()) -> m () -> m () +souts) (m () -> m ()) -> m () -> m () forall a b. (a -> b) -> a -> b $ MockChainError -> m () @@ -1645,22 +1645,22 @@ -> [TxOutRef] forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> [(TxOutRef, ConcreteOutput Credential () Ada ScriptHash)] -souts) +souts) -balanceTxFromAux :: MonadBlockChainBalancing m => Wallet -> TxSkel -> Fee -> m TxSkel +balanceTxFromAux :: MonadBlockChainBalancing m => Wallet -> TxSkel -> Fee -> m TxSkel balanceTxFromAux :: Wallet -> TxSkel -> Fee -> m TxSkel -balanceTxFromAux Wallet -balanceWallet TxSkel -txskel Fee -fee = do - bres :: BalanceTxRes -bres@(BalanceTxRes {[(TxOutRef, TxOut)] +balanceTxFromAux Wallet +balanceWallet TxSkel +txskel Fee +fee = do + bres :: BalanceTxRes +bres@(BalanceTxRes {[(TxOutRef, TxOut)] newInputs :: BalanceTxRes -> [(TxOutRef, TxOut)] newInputs :: [(TxOutRef, TxOut)] -newInputs, Value +newInputs, Value returnValue :: BalanceTxRes -> Value returnValue :: Value -returnValue, [(TxOutRef, TxOut)] +returnValue, [(TxOutRef, TxOut)] availableUtxos :: BalanceTxRes -> [(TxOutRef, TxOut)] availableUtxos :: [(TxOutRef, TxOut)] availableUtxos}) <- Wallet -> TxSkel -> Fee -> m BalanceTxRes @@ -1668,20 +1668,20 @@ MonadBlockChainBalancing m => Wallet -> TxSkel -> Fee -> m BalanceTxRes calcBalanceTx Wallet -balanceWallet TxSkel -txskel Fee -fee +balanceWallet TxSkel +txskel Fee +fee case PubKeyHash -> BalanceTxRes -> TxSkel -> Maybe TxSkel applyBalanceTx (Wallet -> PubKeyHash walletPKHash Wallet -balanceWallet) BalanceTxRes -bres TxSkel -txskel of - Just TxSkel -txskel' -> TxSkel -> m TxSkel +balanceWallet) BalanceTxRes +bres TxSkel +txskel of + Just TxSkel +txskel' -> TxSkel -> m TxSkel forall (m :: * -> *) a. Monad m => a -> m a return TxSkel -txskel' +txskel' Maybe TxSkel Nothing -> MockChainError -> m TxSkel @@ -1695,21 +1695,21 @@ -> (Value, [TxOutRef]) -> Value -> MCEUnbalanceableError MCEUnbalNotEnoughReturning ([(TxOutRef, TxOut)] -> (Value, [TxOutRef]) -valueAndRefs [(TxOutRef, TxOut)] -newInputs) +valueAndRefs [(TxOutRef, TxOut)] +newInputs) ([(TxOutRef, TxOut)] -> (Value, [TxOutRef]) -valueAndRefs [(TxOutRef, TxOut)] -availableUtxos) +valueAndRefs [(TxOutRef, TxOut)] +availableUtxos) Value -returnValue +returnValue ) TxSkel -txskel +txskel where - valueAndRefs :: [(PV2.TxOutRef, PV2.TxOut)] -> (PV2.Value, [PV2.TxOutRef]) - valueAndRefs :: [(TxOutRef, TxOut)] -> (Value, [TxOutRef]) -valueAndRefs [(TxOutRef, TxOut)] -x = ([Value] -> Value + valueAndRefs :: [(PV2.TxOutRef, PV2.TxOut)] -> (PV2.Value, [PV2.TxOutRef]) + valueAndRefs :: [(TxOutRef, TxOut)] -> (Value, [TxOutRef]) +valueAndRefs [(TxOutRef, TxOut)] +x = ([Value] -> Value forall a. Monoid a => [a] -> a mconcat (TxOut -> Value forall o. (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value @@ -1721,13 +1721,13 @@ snd ((TxOutRef, TxOut) -> Value) -> [(TxOutRef, TxOut)] -> [Value] forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> [(TxOutRef, TxOut)] -x), (TxOutRef, TxOut) -> TxOutRef +x), (TxOutRef, TxOut) -> TxOutRef forall a b. (a, b) -> a fst ((TxOutRef, TxOut) -> TxOutRef) -> [(TxOutRef, TxOut)] -> [TxOutRef] forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> [(TxOutRef, TxOut)] -x) +x) data BalanceTxRes = BalanceTxRes { -- | Inputs that need to be added in order to cover the value in the @@ -1746,7 +1746,7 @@ BalanceTxRes -> [(TxOutRef, TxOut)] availableUtxos :: [(PV2.TxOutRef, PV2.TxOut)] } - deriving (Int -> BalanceTxRes -> [Char] -> [Char] + deriving (Int -> BalanceTxRes -> [Char] -> [Char] [BalanceTxRes] -> [Char] -> [Char] BalanceTxRes -> [Char] (Int -> BalanceTxRes -> [Char] -> [Char]) @@ -1767,14 +1767,14 @@ -- | Calculate the changes needed to balance a transaction with money from a -- given wallet. Every transaction that is sent to the chain must be balanced, -- that is: @inputs + mints == outputs + fee + burns@. -calcBalanceTx :: MonadBlockChainBalancing m => Wallet -> TxSkel -> Fee -> m BalanceTxRes +calcBalanceTx :: MonadBlockChainBalancing m => Wallet -> TxSkel -> Fee -> m BalanceTxRes calcBalanceTx :: Wallet -> TxSkel -> Fee -> m BalanceTxRes -calcBalanceTx Wallet -balanceWallet TxSkel -skel Fee -fee = do - Value -inValue <- (Value -> Value -> Value +calcBalanceTx Wallet +balanceWallet TxSkel +skel Fee +fee = do + Value +inValue <- (Value -> Value -> Value forall a. Semigroup a => a -> a -> a <> Value -> Value positivePart (TxSkelMints -> Value @@ -1782,50 +1782,50 @@ forall a b. (a -> b) -> a -> b $ TxSkel -> TxSkelMints txSkelMints TxSkel -skel)) (Value -> Value) -> m Value -> m Value +skel)) (Value -> Value) -> m Value -> m Value forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> TxSkel -> m Value forall (m :: * -> *). MonadBlockChainBalancing m => TxSkel -> m Value txSkelInputValue TxSkel -skel -- transaction inputs + minted value - let outValue :: Value -outValue = TxSkel -> Fee -> Value +skel -- transaction inputs + minted value + let outValue :: Value +outValue = TxSkel -> Fee -> Value txSkelOutputValue TxSkel -skel Fee -fee -- transaction outputs + fee + burned value - difference :: Value -difference = Value -outValue Value -> Value -> Value +skel Fee +fee -- transaction outputs + fee + burned value + difference :: Value +difference = Value +outValue Value -> Value -> Value forall a. Semigroup a => a -> a -> a <> Value -> Value forall a. AdditiveGroup a => a -> a Pl.negate Value -inValue +inValue -- This is the value that must still be paid by 'balancePK' in order to -- balance the transaction: - missingValue :: Value -missingValue = Value -> Value + missingValue :: Value +missingValue = Value -> Value positivePart Value -difference +difference -- This will be paid to 'balancePK' in any case: - initialExcess :: Value -initialExcess = Value -> Value + initialExcess :: Value +initialExcess = Value -> Value negativePart Value -difference +difference -- All TxOutRefs that the transaction consumes. We'll need them to make sure -- that no additional UTxOs are chosen that are in fact already present on the -- transaction. - inputOrefs :: [TxOutRef] -inputOrefs = Map TxOutRef TxSkelRedeemer -> [TxOutRef] + inputOrefs :: [TxOutRef] +inputOrefs = Map TxOutRef TxSkelRedeemer -> [TxOutRef] forall k a. Map k a -> [k] Map.keys (Map TxOutRef TxSkelRedeemer -> [TxOutRef]) -> Map TxOutRef TxSkelRedeemer -> [TxOutRef] forall a b. (a -> b) -> a -> b $ TxSkel -> Map TxOutRef TxSkelRedeemer txSkelIns TxSkel -skel +skel -- Get all UTxOs that belong to the given wallet, and that are not yet being -- consumed on the transaction. -- @@ -1835,8 +1835,8 @@ -- therefore become less likely for the 'returnValue' to be less than the -- minimum Ada amount required for each output. See this comment for context: -- https://github.com/tweag/cooked-validators/issues/71#issuecomment-1016406041 - [(TxOutRef, TxOut)] -candidateUtxos <- + [(TxOutRef, TxOut)] +candidateUtxos <- ((TxOutRef, TxOut) -> (TxOutRef, TxOut) -> Ordering) -> [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)] forall a. (a -> a -> Ordering) -> [a] -> [a] @@ -1873,7 +1873,7 @@ filter ((TxOutRef -> [TxOutRef] -> Bool forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool `notElem` [TxOutRef] -inputOrefs) (TxOutRef -> Bool) +inputOrefs) (TxOutRef -> Bool) -> ((TxOutRef, TxOut) -> TxOutRef) -> (TxOutRef, TxOut) -> Bool forall b c a. (b -> c) -> (a -> b) -> a -> c . (TxOutRef, TxOut) -> TxOutRef @@ -1888,13 +1888,13 @@ Address -> m [(TxOutRef, TxOut)] utxosAt (Wallet -> Address walletAddress Wallet -balanceWallet) +balanceWallet) case [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)] -> Value -> Value -> Maybe BalanceTxRes -selectNewInputs [(TxOutRef, TxOut)] -candidateUtxos [] Value -initialExcess Value -missingValue of +selectNewInputs [(TxOutRef, TxOut)] +candidateUtxos [] Value +initialExcess Value +missingValue of Maybe BalanceTxRes Nothing -> MockChainError -> m BalanceTxRes @@ -1907,29 +1907,29 @@ MCEUnbalanceable (Wallet -> Value -> MCEUnbalanceableError MCEUnbalNotEnoughFunds Wallet -balanceWallet Value -missingValue) +balanceWallet Value +missingValue) TxSkel -skel - Just BalanceTxRes -bTxRes -> BalanceTxRes -> m BalanceTxRes +skel + Just BalanceTxRes +bTxRes -> BalanceTxRes -> m BalanceTxRes forall (m :: * -> *) a. Monad m => a -> m a return BalanceTxRes -bTxRes +bTxRes where - selectNewInputs :: + selectNewInputs :: [(PV2.TxOutRef, PV2.TxOut)] -> [(PV2.TxOutRef, PV2.TxOut)] -> PV2.Value -> PV2.Value -> Maybe BalanceTxRes - selectNewInputs :: [(TxOutRef, TxOut)] + selectNewInputs :: [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)] -> Value -> Value -> Maybe BalanceTxRes -selectNewInputs [(TxOutRef, TxOut)] -available [(TxOutRef, TxOut)] -chosen Value -excess Value -missing = +selectNewInputs [(TxOutRef, TxOut)] +available [(TxOutRef, TxOut)] +chosen Value +excess Value +missing = case Optic' An_Iso NoIx Value [(AssetClass, Integer)] -> Value -> [(AssetClass, Integer)] forall k (is :: IxList) s a. @@ -1937,7 +1937,7 @@ Optic' k is s a -> s -> a view Optic' An_Iso NoIx Value [(AssetClass, Integer)] flattenValueI Value -missing of +missing of [] -> BalanceTxRes -> Maybe BalanceTxRes forall a. a -> Maybe a Just (BalanceTxRes -> Maybe BalanceTxRes) @@ -1945,11 +1945,11 @@ forall a b. (a -> b) -> a -> b $ [(TxOutRef, TxOut)] -> Value -> [(TxOutRef, TxOut)] -> BalanceTxRes BalanceTxRes [(TxOutRef, TxOut)] -chosen Value -excess [(TxOutRef, TxOut)] -available - (AssetClass -ac, Integer +chosen Value +excess [(TxOutRef, TxOut)] +available + (AssetClass +ac, Integer _) : [(AssetClass, Integer)] _ -> -- Find the first UTxO belonging to the wallet that contains at least @@ -1961,7 +1961,7 @@ findIndex ((Value -> Value -> Bool `Pl.geq` AssetClass -> Integer -> Value Pl.assetClassValue AssetClass -ac Integer +ac Integer 1) (Value -> Bool) -> ((TxOutRef, TxOut) -> Value) -> (TxOutRef, TxOut) -> Bool forall b c a. (b -> c) -> (a -> b) -> a -> c @@ -1973,63 +1973,63 @@ . (TxOutRef, TxOut) -> TxOut forall a b. (a, b) -> b snd) [(TxOutRef, TxOut)] -available of +available of Maybe Int Nothing -> Maybe BalanceTxRes forall a. Maybe a Nothing -- The wallet owns nothing of the required asset class. We can't balance with this wallet. - Just Int -i -> - let ([(TxOutRef, TxOut)] -left, (TxOutRef, TxOut) -theChosenUtxo : [(TxOutRef, TxOut)] -right) = Int + Just Int +i -> + let ([(TxOutRef, TxOut)] +left, (TxOutRef, TxOut) +theChosenUtxo : [(TxOutRef, TxOut)] +right) = Int -> [(TxOutRef, TxOut)] -> ([(TxOutRef, TxOut)], [(TxOutRef, TxOut)]) forall a. Int -> [a] -> ([a], [a]) splitAt Int -i [(TxOutRef, TxOut)] -available - available' :: [(TxOutRef, TxOut)] -available' = [(TxOutRef, TxOut)] -left [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)] +i [(TxOutRef, TxOut)] +available + available' :: [(TxOutRef, TxOut)] +available' = [(TxOutRef, TxOut)] +left [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)] forall a. [a] -> [a] -> [a] ++ [(TxOutRef, TxOut)] -right - chosen' :: [(TxOutRef, TxOut)] -chosen' = (TxOutRef, TxOut) -theChosenUtxo (TxOutRef, TxOut) -> [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)] +right + chosen' :: [(TxOutRef, TxOut)] +chosen' = (TxOutRef, TxOut) +theChosenUtxo (TxOutRef, TxOut) -> [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)] forall a. a -> [a] -> [a] : [(TxOutRef, TxOut)] -chosen - theChosenValue :: Value -theChosenValue = TxOut -> Value +chosen + theChosenValue :: Value +theChosenValue = TxOut -> Value forall o. (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value outputValue (TxOut -> Value) -> TxOut -> Value forall a b. (a -> b) -> a -> b $ (TxOutRef, TxOut) -> TxOut forall a b. (a, b) -> b snd (TxOutRef, TxOut) -theChosenUtxo - theChosenDifference :: Value -theChosenDifference = Value -missing Value -> Value -> Value +theChosenUtxo + theChosenDifference :: Value +theChosenDifference = Value +missing Value -> Value -> Value forall a. Semigroup a => a -> a -> a <> Value -> Value forall a. AdditiveGroup a => a -> a Pl.negate Value -theChosenValue - excess' :: Value -excess' = Value -excess Value -> Value -> Value +theChosenValue + excess' :: Value +excess' = Value +excess Value -> Value -> Value forall a. Semigroup a => a -> a -> a <> Value -> Value negativePart Value -theChosenDifference - missing' :: Value -missing' = Value -> Value +theChosenDifference + missing' :: Value +missing' = Value -> Value positivePart Value -theChosenDifference +theChosenDifference in -- A remark on why the following line should not lead to an -- infinite recursion: The value described by @missing'@ is -- strictly smaller than the value described by @missing@, @@ -2037,11 +2037,11 @@ -- in @theChosenValue@. [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)] -> Value -> Value -> Maybe BalanceTxRes -selectNewInputs [(TxOutRef, TxOut)] -available' [(TxOutRef, TxOut)] -chosen' Value -excess' Value -missing' +selectNewInputs [(TxOutRef, TxOut)] +available' [(TxOutRef, TxOut)] +chosen' Value +excess' Value +missing' -- | Once we calculated what is needed to balance a transaction @skel@, we still -- need to apply those changes to @skel@. Because of the 'Pl.minAdaTxOut' @@ -2055,12 +2055,12 @@ -- transaction. applyBalanceTx :: PV2.PubKeyHash -> BalanceTxRes -> TxSkel -> Maybe TxSkel applyBalanceTx :: PubKeyHash -> BalanceTxRes -> TxSkel -> Maybe TxSkel -applyBalanceTx PubKeyHash -balancePK (BalanceTxRes [(TxOutRef, TxOut)] -newInputs Value -returnValue [(TxOutRef, TxOut)] -availableUtxos) TxSkel -skel = do +applyBalanceTx PubKeyHash +balancePK (BalanceTxRes [(TxOutRef, TxOut)] +newInputs Value +returnValue [(TxOutRef, TxOut)] +availableUtxos) TxSkel +skel = do -- Here we'll try a few things, in order, until one of them succeeds: -- -- 1. If allowed by the balanceOutputPolicy, pick out the best possible output @@ -2082,27 +2082,27 @@ -- In that case, we could forget about adding several additional inputs. If -- one isn't enough, there's nothing we can do, no? let -- All transaction outputs - outs :: [TxSkelOut] - outs :: [TxSkelOut] -outs = TxSkel -> [TxSkelOut] + outs :: [TxSkelOut] + outs :: [TxSkelOut] +outs = TxSkel -> [TxSkelOut] txSkelOuts TxSkel -skel +skel -- All transaction outputs that are ada-only, datum-free, and belong to -- 'balancePK', together with the index of the corresponding 'TxSkelOut' -- in 'outs'. - candidateOutputsWithIndices :: [(Int, ConcreteOutput PV2.PubKeyHash () Pl.Ada PV2.ScriptHash)] - candidateOutputsWithIndices :: [(Int, ConcreteOutput PubKeyHash () Ada ScriptHash)] -candidateOutputsWithIndices = + candidateOutputsWithIndices :: [(Int, ConcreteOutput PV2.PubKeyHash () Pl.Ada PV2.ScriptHash)] + candidateOutputsWithIndices :: [(Int, ConcreteOutput PubKeyHash () Ada ScriptHash)] +candidateOutputsWithIndices = ((Int, TxSkelOut) -> Maybe (Int, ConcreteOutput PubKeyHash () Ada ScriptHash)) -> [(Int, TxSkelOut)] -> [(Int, ConcreteOutput PubKeyHash () Ada ScriptHash)] forall a b. (a -> Maybe b) -> [a] -> [b] mapMaybe - ( \(Int -i, Pays o -output) -> + ( \(Int +i, Pays o +output) -> case ( PubKeyHash -> o -> Maybe @@ -2119,7 +2119,7 @@ (ValueType output) (ReferenceScriptType output)) isPKOutputFrom PubKeyHash -balancePK +balancePK (o -> Maybe (ConcreteOutput @@ -2207,20 +2207,20 @@ toOutputWithReferenceScriptHash ) o -output of +output of Maybe (ConcreteOutput PubKeyHash () Ada ScriptHash) Nothing -> Maybe (Int, ConcreteOutput PubKeyHash () Ada ScriptHash) forall a. Maybe a Nothing - Just ConcreteOutput PubKeyHash () Ada ScriptHash -output' -> (Int, ConcreteOutput PubKeyHash () Ada ScriptHash) + Just ConcreteOutput PubKeyHash () Ada ScriptHash +output' -> (Int, ConcreteOutput PubKeyHash () Ada ScriptHash) -> Maybe (Int, ConcreteOutput PubKeyHash () Ada ScriptHash) forall a. a -> Maybe a Just (Int -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral Int -i, ConcreteOutput PubKeyHash () Ada ScriptHash -output') +i, ConcreteOutput PubKeyHash () Ada ScriptHash +output') ) ([(Int, TxSkelOut)] -> [(Int, ConcreteOutput PubKeyHash () Ada ScriptHash)]) @@ -2231,13 +2231,13 @@ forall a b. [a] -> [b] -> [(a, b)] zip [Int 0 :: Int ..] [TxSkelOut] -outs +outs -- The index of the "best possible transaction output", as described -- above. - mBestOutputIndex :: Maybe Int - mBestOutputIndex :: Maybe Int -mBestOutputIndex = case ((Int, ConcreteOutput PubKeyHash () Ada ScriptHash) + mBestOutputIndex :: Maybe Int + mBestOutputIndex :: Maybe Int +mBestOutputIndex = case ((Int, ConcreteOutput PubKeyHash () Ada ScriptHash) -> (Int, ConcreteOutput PubKeyHash () Ada ScriptHash) -> Ordering) -> [(Int, ConcreteOutput PubKeyHash () Ada ScriptHash)] -> [(Int, ConcreteOutput PubKeyHash () Ada ScriptHash)] @@ -2277,57 +2277,57 @@ snd ) [(Int, ConcreteOutput PubKeyHash () Ada ScriptHash)] -candidateOutputsWithIndices of +candidateOutputsWithIndices of [] -> Maybe Int forall a. Maybe a Nothing - (Int -best, ConcreteOutput PubKeyHash () Ada ScriptHash + (Int +best, ConcreteOutput PubKeyHash () Ada ScriptHash _) : [(Int, ConcreteOutput PubKeyHash () Ada ScriptHash)] _ -> Int -> Maybe Int forall a. a -> Maybe a Just Int -best +best - ins :: Map TxOutRef TxSkelRedeemer -ins = TxSkel -> Map TxOutRef TxSkelRedeemer + ins :: Map TxOutRef TxSkelRedeemer +ins = TxSkel -> Map TxOutRef TxSkelRedeemer txSkelIns TxSkel -skel - (Map TxOutRef TxSkelRedeemer -newIns, [TxSkelOut] -newOuts) <- +skel + (Map TxOutRef TxSkelRedeemer +newIns, [TxSkelOut] +newOuts) <- case Maybe Int -mBestOutputIndex of - Just Int -i -> - let ([TxSkelOut] -left, TxSkelOut -bestTxOut : [TxSkelOut] -right) = Int -> [TxSkelOut] -> ([TxSkelOut], [TxSkelOut]) +mBestOutputIndex of + Just Int +i -> + let ([TxSkelOut] +left, TxSkelOut +bestTxOut : [TxSkelOut] +right) = Int -> [TxSkelOut] -> ([TxSkelOut], [TxSkelOut]) forall a. Int -> [a] -> ([a], [a]) splitAt Int -i [TxSkelOut] -outs +i [TxSkelOut] +outs in case TxOpts -> BalanceOutputPolicy txOptBalanceOutputPolicy (TxOpts -> BalanceOutputPolicy) -> TxOpts -> BalanceOutputPolicy forall a b. (a -> b) -> a -> b $ TxSkel -> TxOpts txSkelOpts TxSkel -skel of +skel of BalanceOutputPolicy AdjustExistingOutput -> - let bestTxOutValue :: Value -bestTxOutValue = TxSkelOut -> Value + let bestTxOutValue :: Value +bestTxOutValue = TxSkelOut -> Value txSkelOutValue TxSkelOut -bestTxOut - adjustedValue :: Value -adjustedValue = Value -bestTxOutValue Value -> Value -> Value +bestTxOut + adjustedValue :: Value +adjustedValue = Value +bestTxOutValue Value -> Value -> Value forall a. Semigroup a => a -> a -> a <> Value -returnValue +returnValue in if Value -adjustedValue Value -> Value -> Bool +adjustedValue Value -> Value -> Bool `Pl.geq` Ada -> Value Pl.toValue Ada Ledger.minAdaTxOutEstimated -- TODO make thid dependen on the atual TxOut @@ -2337,7 +2337,7 @@ forall a. a -> Maybe a Just -- (1) ( Map TxOutRef TxSkelRedeemer -ins Map TxOutRef TxSkelRedeemer +ins Map TxOutRef TxSkelRedeemer -> Map TxOutRef TxSkelRedeemer -> Map TxOutRef TxSkelRedeemer forall a. Semigroup a => a -> a -> a <> (TxOutRef -> TxSkelRedeemer) @@ -2356,12 +2356,12 @@ map (TxOutRef, TxOut) -> TxOutRef forall a b. (a, b) -> a fst [(TxOutRef, TxOut)] -newInputs), +newInputs), [TxSkelOut] -left [TxSkelOut] -> [TxSkelOut] -> [TxSkelOut] +left [TxSkelOut] -> [TxSkelOut] -> [TxSkelOut] forall a. [a] -> [a] -> [a] ++ (TxSkelOut -bestTxOut TxSkelOut -> (TxSkelOut -> TxSkelOut) -> TxSkelOut +bestTxOut TxSkelOut -> (TxSkelOut -> TxSkelOut) -> TxSkelOut forall a b. a -> (a -> b) -> b & Lens' TxSkelOut Value txSkelOutValueL Lens' TxSkelOut Value -> Value -> TxSkelOut -> TxSkelOut @@ -2369,57 +2369,57 @@ Is k A_Setter => Optic k is s t a b -> b -> s -> t .~ Value -adjustedValue) TxSkelOut -> [TxSkelOut] -> [TxSkelOut] +adjustedValue) TxSkelOut -> [TxSkelOut] -> [TxSkelOut] forall a. a -> [a] -> [a] : [TxSkelOut] -right +right ) else Map TxOutRef TxSkelRedeemer -> [TxSkelOut] -> [(TxOutRef, TxOut)] -> Value -> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut]) -tryAdditionalInputs Map TxOutRef TxSkelRedeemer -ins [TxSkelOut] -outs [(TxOutRef, TxOut)] -availableUtxos Value -returnValue +tryAdditionalInputs Map TxOutRef TxSkelRedeemer +ins [TxSkelOut] +outs [(TxOutRef, TxOut)] +availableUtxos Value +returnValue BalanceOutputPolicy DontAdjustExistingOutput -> Map TxOutRef TxSkelRedeemer -> [TxSkelOut] -> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut]) -tryAdditionalOutput Map TxOutRef TxSkelRedeemer -ins [TxSkelOut] -outs +tryAdditionalOutput Map TxOutRef TxSkelRedeemer +ins [TxSkelOut] +outs Maybe Int Nothing -> -- There's no "best possible transaction output" in the sense described -- above. Map TxOutRef TxSkelRedeemer -> [TxSkelOut] -> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut]) -tryAdditionalOutput Map TxOutRef TxSkelRedeemer -ins [TxSkelOut] -outs +tryAdditionalOutput Map TxOutRef TxSkelRedeemer +ins [TxSkelOut] +outs TxSkel -> Maybe TxSkel forall (m :: * -> *) a. Monad m => a -> m a return TxSkel -skel {txSkelIns :: Map TxOutRef TxSkelRedeemer +skel {txSkelIns :: Map TxOutRef TxSkelRedeemer txSkelIns = Map TxOutRef TxSkelRedeemer -newIns, txSkelOuts :: [TxSkelOut] +newIns, txSkelOuts :: [TxSkelOut] txSkelOuts = [TxSkelOut] -newOuts} +newOuts} where - tryAdditionalOutput :: + tryAdditionalOutput :: Map PV2.TxOutRef TxSkelRedeemer -> [TxSkelOut] -> Maybe (Map PV2.TxOutRef TxSkelRedeemer, [TxSkelOut]) - tryAdditionalOutput :: Map TxOutRef TxSkelRedeemer + tryAdditionalOutput :: Map TxOutRef TxSkelRedeemer -> [TxSkelOut] -> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut]) -tryAdditionalOutput Map TxOutRef TxSkelRedeemer -ins [TxSkelOut] -outs = +tryAdditionalOutput Map TxOutRef TxSkelRedeemer +ins [TxSkelOut] +outs = if Value -> Ada Pl.fromValue Value -returnValue Ada -> Ada -> Bool +returnValue Ada -> Ada -> Bool forall a. Ord a => a -> a -> Bool >= Ada Ledger.minAdaTxOutEstimated -- TODO make thid dependen on the atual TxOut @@ -2429,7 +2429,7 @@ forall a. a -> Maybe a Just -- (2) ( Map TxOutRef TxSkelRedeemer -ins Map TxOutRef TxSkelRedeemer +ins Map TxOutRef TxSkelRedeemer -> Map TxOutRef TxSkelRedeemer -> Map TxOutRef TxSkelRedeemer forall a. Semigroup a => a -> a -> a <> (TxOutRef -> TxSkelRedeemer) @@ -2448,66 +2448,66 @@ map (TxOutRef, TxOut) -> TxOutRef forall a b. (a, b) -> a fst [(TxOutRef, TxOut)] -newInputs), +newInputs), [TxSkelOut] -outs [TxSkelOut] -> [TxSkelOut] -> [TxSkelOut] +outs [TxSkelOut] -> [TxSkelOut] -> [TxSkelOut] forall a. [a] -> [a] -> [a] ++ [PubKeyHash -> Value -> TxSkelOut paysPK PubKeyHash -balancePK Value -returnValue] +balancePK Value +returnValue] ) else Map TxOutRef TxSkelRedeemer -> [TxSkelOut] -> [(TxOutRef, TxOut)] -> Value -> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut]) -tryAdditionalInputs Map TxOutRef TxSkelRedeemer -ins [TxSkelOut] -outs [(TxOutRef, TxOut)] -availableUtxos Value -returnValue +tryAdditionalInputs Map TxOutRef TxSkelRedeemer +ins [TxSkelOut] +outs [(TxOutRef, TxOut)] +availableUtxos Value +returnValue - tryAdditionalInputs :: + tryAdditionalInputs :: Map PV2.TxOutRef TxSkelRedeemer -> [TxSkelOut] -> [(PV2.TxOutRef, PV2.TxOut)] -> Pl.Value -> Maybe (Map PV2.TxOutRef TxSkelRedeemer, [TxSkelOut]) - tryAdditionalInputs :: Map TxOutRef TxSkelRedeemer + tryAdditionalInputs :: Map TxOutRef TxSkelRedeemer -> [TxSkelOut] -> [(TxOutRef, TxOut)] -> Value -> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut]) -tryAdditionalInputs Map TxOutRef TxSkelRedeemer -ins [TxSkelOut] -outs [(TxOutRef, TxOut)] -available Value -return = +tryAdditionalInputs Map TxOutRef TxSkelRedeemer +ins [TxSkelOut] +outs [(TxOutRef, TxOut)] +available Value +return = case [(TxOutRef, TxOut)] -available of +available of [] -> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut]) forall a. Maybe a Nothing - (TxOutRef -newTxOutRef, TxOut -newTxOut) : [(TxOutRef, TxOut)] -newAvailable -> - let additionalValue :: Value -additionalValue = TxOut -> Value + (TxOutRef +newTxOutRef, TxOut +newTxOut) : [(TxOutRef, TxOut)] +newAvailable -> + let additionalValue :: Value +additionalValue = TxOut -> Value forall o. (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value outputValue TxOut -newTxOut - newReturn :: Value -newReturn = Value -additionalValue Value -> Value -> Value +newTxOut + newReturn :: Value +newReturn = Value +additionalValue Value -> Value -> Value forall a. Semigroup a => a -> a -> a <> Value -return - newIns :: Map TxOutRef TxSkelRedeemer -newIns = +return + newIns :: Map TxOutRef TxSkelRedeemer +newIns = ( Map TxOutRef TxSkelRedeemer -ins +ins Map TxOutRef TxSkelRedeemer -> Map TxOutRef TxSkelRedeemer -> Map TxOutRef TxSkelRedeemer forall a. Semigroup a => a -> a -> a @@ -2527,26 +2527,26 @@ map (TxOutRef, TxOut) -> TxOutRef forall a b. (a, b) -> a fst [(TxOutRef, TxOut)] -newInputs) +newInputs) Map TxOutRef TxSkelRedeemer -> Map TxOutRef TxSkelRedeemer -> Map TxOutRef TxSkelRedeemer forall a. Semigroup a => a -> a -> a <> TxOutRef -> TxSkelRedeemer -> Map TxOutRef TxSkelRedeemer forall k a. k -> a -> Map k a Map.singleton TxOutRef -newTxOutRef TxSkelRedeemer +newTxOutRef TxSkelRedeemer TxSkelNoRedeemerForPK ) - newOuts :: [TxSkelOut] -newOuts = [TxSkelOut] -outs [TxSkelOut] -> [TxSkelOut] -> [TxSkelOut] + newOuts :: [TxSkelOut] +newOuts = [TxSkelOut] +outs [TxSkelOut] -> [TxSkelOut] -> [TxSkelOut] forall a. [a] -> [a] -> [a] ++ [PubKeyHash -> Value -> TxSkelOut paysPK PubKeyHash -balancePK Value -newReturn] +balancePK Value +newReturn] in if Value -newReturn Value -> Value -> Bool +newReturn Value -> Value -> Bool `Pl.geq` Ada -> Value Pl.toValue Ada Ledger.minAdaTxOutEstimated -- TODO make thid dependen on the atual TxOut @@ -2554,16 +2554,16 @@ -> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut]) forall a. a -> Maybe a Just (Map TxOutRef TxSkelRedeemer -newIns, [TxSkelOut] -newOuts) -- (3) +newIns, [TxSkelOut] +newOuts) -- (3) else Map TxOutRef TxSkelRedeemer -> [TxSkelOut] -> [(TxOutRef, TxOut)] -> Value -> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut]) -tryAdditionalInputs Map TxOutRef TxSkelRedeemer -newIns [TxSkelOut] -newOuts [(TxOutRef, TxOut)] -newAvailable Value -newReturn +tryAdditionalInputs Map TxOutRef TxSkelRedeemer +newIns [TxSkelOut] +newOuts [(TxOutRef, TxOut)] +newAvailable Value +newReturn \ No newline at end of file diff --git a/src/Cooked.MockChain.BlockChain.html b/src/Cooked.MockChain.BlockChain.html index 6bea82b38..8762f6427 100644 --- a/src/Cooked.MockChain.BlockChain.html +++ b/src/Cooked.MockChain.BlockChain.html @@ -84,7 +84,7 @@ MCEUnknownDatum :: String -> PV2.DatumHash -> MockChainError -- | Used to provide 'MonadFail' instances. FailWith :: String -> MockChainError - OtherMockChainError :: (Show err, Eq err) => err -> MockChainError + OtherMockChainError :: (Show err, Eq err) => err -> MockChainError data MCEUnbalanceableError = -- | The balancing wallet misses some value to pay what is needed to balance @@ -97,7 +97,7 @@ (PV2.Value, [PV2.TxOutRef]) -- What was spent (PV2.Value, [PV2.TxOutRef]) -- What is left to spend PV2.Value -- What cannot be given back - deriving (Int -> MCEUnbalanceableError -> ShowS + deriving (Int -> MCEUnbalanceableError -> ShowS [MCEUnbalanceableError] -> ShowS MCEUnbalanceableError -> String (Int -> MCEUnbalanceableError -> ShowS) @@ -114,48 +114,48 @@ $cshowsPrec :: Int -> MCEUnbalanceableError -> ShowS Show) -deriving instance Show MockChainError +deriving instance Show MockChainError -instance Eq MockChainError where - == :: MockChainError -> MockChainError -> Bool +instance Eq MockChainError where + == :: MockChainError -> MockChainError -> Bool (==) = MockChainError -> MockChainError -> Bool forall a. HasCallStack => a undefined -- | Contains methods needed for balancing. -class (MonadFail m, MonadError MockChainError m) => MonadBlockChainBalancing m where +class (MonadFail m, MonadError MockChainError m) => MonadBlockChainBalancing m where -- | Returns the parameters of the chain. - getParams :: m Emulator.Params + getParams :: m Emulator.Params -- | Returns a list of all UTxOs at a certain address. - utxosAtLedger :: PV2.Address -> m [(PV2.TxOutRef, Ledger.TxOut)] + utxosAtLedger :: PV2.Address -> m [(PV2.TxOutRef, Ledger.TxOut)] -- | Returns the datum with the given hash or 'Nothing' if there is none - datumFromHash :: PV2.DatumHash -> m (Maybe PV2.Datum) + datumFromHash :: PV2.DatumHash -> m (Maybe PV2.Datum) -- | Returns the full validator corresponding to hash, if that validator owns -- something or if it is stored in the reference script field of some UTxO. - validatorFromHash :: PV2.ValidatorHash -> m (Maybe (Pl.Versioned PV2.Validator)) + validatorFromHash :: PV2.ValidatorHash -> m (Maybe (Pl.Versioned PV2.Validator)) -- | Returns an output given a reference to it - txOutByRefLedger :: PV2.TxOutRef -> m (Maybe Ledger.TxOut) + txOutByRefLedger :: PV2.TxOutRef -> m (Maybe Ledger.TxOut) -class MonadBlockChainBalancing m => MonadBlockChainWithoutValidation m where +class MonadBlockChainBalancing m => MonadBlockChainWithoutValidation m where -- | Returns a list of all currently known outputs. - allUtxosLedger :: m [(PV2.TxOutRef, Ledger.TxOut)] + allUtxosLedger :: m [(PV2.TxOutRef, Ledger.TxOut)] -- | Returns the current slot number - currentSlot :: m Ledger.Slot + currentSlot :: m Ledger.Slot -- | Waits until the current slot becomes greater or equal to the given slot, -- and returns the current slot after waiting. -- -- Note that it might not wait for anything if the current slot is large -- enough. - awaitSlot :: Ledger.Slot -> m Ledger.Slot + awaitSlot :: Ledger.Slot -> m Ledger.Slot -- | The main abstraction of the blockchain. -class MonadBlockChainWithoutValidation m => MonadBlockChain m where +class MonadBlockChainWithoutValidation m => MonadBlockChain m where -- | Generates, balances and validates a transaction from a skeleton. -- It returns the validated transaction and updates the state of the -- blockchain. In 'MockChainT', this means: @@ -164,9 +164,9 @@ -- - deletes the consumed datums from 'mcstDatums' -- - adds the produced datums to 'mcstDatums' -- - adds the validators on outputs to the 'mcstValidators'. - validateTxSkel :: TxSkel -> m Ledger.CardanoTx + validateTxSkel :: TxSkel -> m Ledger.CardanoTx -allUtxos :: MonadBlockChainWithoutValidation m => m [(PV2.TxOutRef, PV2.TxOut)] +allUtxos :: MonadBlockChainWithoutValidation m => m [(PV2.TxOutRef, PV2.TxOut)] allUtxos :: m [(TxOutRef, TxOut)] allUtxos = ((TxOutRef, TxOut) -> (TxOutRef, TxOut)) -> [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)] @@ -185,10 +185,10 @@ m [(TxOutRef, TxOut)] allUtxosLedger -utxosAt :: MonadBlockChainBalancing m => PV2.Address -> m [(PV2.TxOutRef, PV2.TxOut)] +utxosAt :: MonadBlockChainBalancing m => PV2.Address -> m [(PV2.TxOutRef, PV2.TxOut)] utxosAt :: Address -> m [(TxOutRef, TxOut)] -utxosAt Address -address = ((TxOutRef, TxOut) -> (TxOutRef, TxOut)) +utxosAt Address +address = ((TxOutRef, TxOut) -> (TxOutRef, TxOut)) -> [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)] forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap ((TxOut -> TxOut) -> (TxOutRef, TxOut) -> (TxOutRef, TxOut) @@ -204,12 +204,12 @@ MonadBlockChainBalancing m => Address -> m [(TxOutRef, TxOut)] utxosAtLedger Address -address +address -txOutByRef :: MonadBlockChainBalancing m => PV2.TxOutRef -> m (Maybe PV2.TxOut) +txOutByRef :: MonadBlockChainBalancing m => PV2.TxOutRef -> m (Maybe PV2.TxOut) txOutByRef :: TxOutRef -> m (Maybe TxOut) -txOutByRef TxOutRef -oref = (TxOut -> TxOut) -> Maybe TxOut -> Maybe TxOut +txOutByRef TxOutRef +oref = (TxOut -> TxOut) -> Maybe TxOut -> Maybe TxOut forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap TxOut -> TxOut txOutV2FromLedger (Maybe TxOut -> Maybe TxOut) -> m (Maybe TxOut) -> m (Maybe TxOut) @@ -219,7 +219,7 @@ MonadBlockChainBalancing m => TxOutRef -> m (Maybe TxOut) txOutByRefLedger TxOutRef -oref +oref -- | Retrieve the ordered list of outputs of the given "CardanoTx". -- @@ -232,13 +232,13 @@ ((TxOut, TxIn) -> (TxOutRef, TxOut)) -> [(TxOut, TxIn)] -> [(TxOutRef, TxOut)] forall a b. (a -> b) -> [a] -> [b] -map (\(TxOut -txOut, TxIn -txOutRef) -> (TxIn -> TxOutRef +map (\(TxOut +txOut, TxIn +txOutRef) -> (TxIn -> TxOutRef Ledger.fromCardanoTxIn TxIn -txOutRef, TxOut -> TxOut +txOutRef, TxOut -> TxOut txOutV2FromLedger TxOut -txOut)) ([(TxOut, TxIn)] -> [(TxOutRef, TxOut)]) +txOut)) ([(TxOut, TxIn)] -> [(TxOutRef, TxOut)]) -> (CardanoTx -> [(TxOut, TxIn)]) -> CardanoTx -> [(TxOutRef, TxOut)] @@ -260,36 +260,36 @@ -- that; if there's a datum hash, look the corresponding datum up (with -- 'datumFromHash'), returning @Nothing@ if it can't be found; if there's no -- datum or hash at all, return @Nothing@. -resolveDatum :: - ( IsAbstractOutput out, - ToOutputDatum (DatumType out), - MonadBlockChainBalancing m +resolveDatum :: + ( IsAbstractOutput out, + ToOutputDatum (DatumType out), + MonadBlockChainBalancing m ) => - out -> - m (Maybe (ConcreteOutput (OwnerType out) PV2.Datum (ValueType out) (ReferenceScriptType out))) + out -> + m (Maybe (ConcreteOutput (OwnerType out) PV2.Datum (ValueType out) (ReferenceScriptType out))) resolveDatum :: out -> m (Maybe (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out))) -resolveDatum out -out = +resolveDatum out +out = case out -> OutputDatum forall o. (IsAbstractOutput o, ToOutputDatum (DatumType o)) => o -> OutputDatum outputOutputDatum out -out of - PV2.OutputDatumHash DatumHash -datumHash -> do - Maybe Datum -mDatum <- DatumHash -> m (Maybe Datum) +out of + PV2.OutputDatumHash DatumHash +datumHash -> do + Maybe Datum +mDatum <- DatumHash -> m (Maybe Datum) forall (m :: * -> *). MonadBlockChainBalancing m => DatumHash -> m (Maybe Datum) datumFromHash DatumHash -datumHash +datumHash case Maybe Datum -mDatum of +mDatum of Maybe Datum Nothing -> Maybe (ConcreteOutput @@ -303,8 +303,8 @@ (OwnerType out) Datum (ValueType out) (ReferenceScriptType out)) forall a. Maybe a Nothing - Just Datum -datum -> + Just Datum +datum -> Maybe (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out)) @@ -363,7 +363,7 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput (out -out out -> Optic' A_Lens NoIx out (OwnerType out) -> OwnerType out +out out -> Optic' A_Lens NoIx out (OwnerType out) -> OwnerType out forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -371,7 +371,7 @@ forall o. IsAbstractOutput o => Lens' o (OwnerType o) outputOwnerL) (out -out out +out out -> Optic' A_Lens NoIx out (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -381,7 +381,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) (out -out out -> Optic' A_Lens NoIx out (ValueType out) -> ValueType out +out out -> Optic' A_Lens NoIx out (ValueType out) -> ValueType out forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -389,9 +389,9 @@ forall o. IsAbstractOutput o => Lens' o (ValueType o) outputValueL) Datum -datum +datum (out -out out +out out -> Optic' A_Lens NoIx out (Maybe (ReferenceScriptType out)) -> Maybe (ReferenceScriptType out) forall k s (is :: IxList) a. @@ -402,8 +402,8 @@ IsAbstractOutput o => Lens' o (Maybe (ReferenceScriptType o)) outputReferenceScriptL) - PV2.OutputDatum Datum -datum -> + PV2.OutputDatum Datum +datum -> Maybe (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out)) @@ -462,7 +462,7 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput (out -out out -> Optic' A_Lens NoIx out (OwnerType out) -> OwnerType out +out out -> Optic' A_Lens NoIx out (OwnerType out) -> OwnerType out forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -470,7 +470,7 @@ forall o. IsAbstractOutput o => Lens' o (OwnerType o) outputOwnerL) (out -out out +out out -> Optic' A_Lens NoIx out (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -480,7 +480,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) (out -out out -> Optic' A_Lens NoIx out (ValueType out) -> ValueType out +out out -> Optic' A_Lens NoIx out (ValueType out) -> ValueType out forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -488,9 +488,9 @@ forall o. IsAbstractOutput o => Lens' o (ValueType o) outputValueL) Datum -datum +datum (out -out out +out out -> Optic' A_Lens NoIx out (Maybe (ReferenceScriptType out)) -> Maybe (ReferenceScriptType out) forall k s (is :: IxList) a. @@ -517,24 +517,24 @@ -- | Like 'resolveDatum', but also tries to use 'fromBuiltinData' to extract a -- datum of the suitable type. -resolveTypedDatum :: - ( IsAbstractOutput out, - ToOutputDatum (DatumType out), - MonadBlockChainBalancing m, - PV2.FromData a +resolveTypedDatum :: + ( IsAbstractOutput out, + ToOutputDatum (DatumType out), + MonadBlockChainBalancing m, + PV2.FromData a ) => - out -> - m (Maybe (ConcreteOutput (OwnerType out) a (ValueType out) (ReferenceScriptType out))) + out -> + m (Maybe (ConcreteOutput (OwnerType out) a (ValueType out) (ReferenceScriptType out))) resolveTypedDatum :: out -> m (Maybe (ConcreteOutput (OwnerType out) a (ValueType out) (ReferenceScriptType out))) -resolveTypedDatum out -out = do - Maybe +resolveTypedDatum out +out = do + Maybe (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out)) -mOut <- out +mOut <- out -> m (Maybe (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out))) @@ -546,11 +546,11 @@ (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out))) resolveDatum out -out +out case Maybe (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out)) -mOut of +mOut of Maybe (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out)) @@ -566,9 +566,9 @@ (OwnerType out) a (ValueType out) (ReferenceScriptType out)) forall a. Maybe a Nothing - Just ConcreteOutput + Just ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out) -out' -> +out' -> Maybe (ConcreteOutput (OwnerType out) a (ValueType out) (ReferenceScriptType out)) @@ -625,7 +625,7 @@ forall a. a -> Maybe a Just (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out) -out' ConcreteOutput +out' ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out) -> Optic' A_Lens @@ -664,7 +664,7 @@ forall a. a -> Maybe a Just (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out) -out' ConcreteOutput +out' ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out) -> Optic' A_Lens @@ -701,7 +701,7 @@ forall a. a -> Maybe a Just (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out) -out' ConcreteOutput +out' ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out) -> Optic' A_Lens @@ -732,10 +732,10 @@ -> ConcreteOutput (OwnerType out) a (ValueType out) (ReferenceScriptType out)) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b -<*> (let PV2.Datum BuiltinData -datum = ConcreteOutput +<*> (let PV2.Datum BuiltinData +datum = ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out) -out' ConcreteOutput +out' ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out) -> Optic' A_Lens @@ -757,7 +757,7 @@ outputDatumL in BuiltinData -> Maybe a forall a. FromData a => BuiltinData -> Maybe a PV2.fromBuiltinData BuiltinData -datum) +datum) Maybe (Maybe (ReferenceScriptType out) -> ConcreteOutput @@ -772,7 +772,7 @@ forall a. a -> Maybe a Just (ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out) -out' ConcreteOutput +out' ConcreteOutput (OwnerType out) Datum (ValueType out) (ReferenceScriptType out) -> Optic' A_Lens @@ -798,13 +798,13 @@ -- | Try to resolve the validator that owns an output: If the output is owned by -- a public key, or if the validator's hash is not known (i.e. if -- 'validatorFromHash' returns @Nothing@) return @Nothing@. -resolveValidator :: - ( IsAbstractOutput out, - ToCredential (OwnerType out), - MonadBlockChainBalancing m +resolveValidator :: + ( IsAbstractOutput out, + ToCredential (OwnerType out), + MonadBlockChainBalancing m ) => - out -> - m (Maybe (ConcreteOutput (Pl.Versioned PV2.Validator) (DatumType out) (ValueType out) (ReferenceScriptType out))) + out -> + m (Maybe (ConcreteOutput (Pl.Versioned PV2.Validator) (DatumType out) (ValueType out) (ReferenceScriptType out))) resolveValidator :: out -> m (Maybe (ConcreteOutput @@ -812,12 +812,12 @@ (DatumType out) (ValueType out) (ReferenceScriptType out))) -resolveValidator out -out = +resolveValidator out +out = case OwnerType out -> Credential forall a. ToCredential a => a -> Credential toCredential (out -out out -> Optic' A_Lens NoIx out (OwnerType out) -> OwnerType out +out out -> Optic' A_Lens NoIx out (OwnerType out) -> OwnerType out forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -846,17 +846,17 @@ (ReferenceScriptType out)) forall a. Maybe a Nothing - PV2.ScriptCredential ValidatorHash -valHash -> do - Maybe (Versioned Validator) -mVal <- ValidatorHash -> m (Maybe (Versioned Validator)) + PV2.ScriptCredential ValidatorHash +valHash -> do + Maybe (Versioned Validator) +mVal <- ValidatorHash -> m (Maybe (Versioned Validator)) forall (m :: * -> *). MonadBlockChainBalancing m => ValidatorHash -> m (Maybe (Versioned Validator)) validatorFromHash ValidatorHash -valHash +valHash case Maybe (Versioned Validator) -mVal of +mVal of Maybe (Versioned Validator) Nothing -> Maybe (ConcreteOutput @@ -879,8 +879,8 @@ (ReferenceScriptType out)) forall a. Maybe a Nothing - Just Versioned Validator -val -> + Just Versioned Validator +val -> Maybe (ConcreteOutput (Versioned Validator) @@ -984,9 +984,9 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput Versioned Validator -val +val (out -out out +out out -> Optic' A_Lens NoIx out (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -996,7 +996,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) (out -out out -> Optic' A_Lens NoIx out (ValueType out) -> ValueType out +out out -> Optic' A_Lens NoIx out (ValueType out) -> ValueType out forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -1004,7 +1004,7 @@ forall o. IsAbstractOutput o => Lens' o (ValueType o) outputValueL) (out -out out -> Optic' A_Lens NoIx out (DatumType out) -> DatumType out +out out -> Optic' A_Lens NoIx out (DatumType out) -> DatumType out forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -1012,7 +1012,7 @@ forall o. IsAbstractOutput o => Lens' o (DatumType o) outputDatumL) (out -out out +out out -> Optic' A_Lens NoIx out (Maybe (ReferenceScriptType out)) -> Maybe (ReferenceScriptType out) forall k s (is :: IxList) a. @@ -1027,13 +1027,13 @@ -- | Try to resolve the reference script on an output: If the output has no -- reference script, or if the reference script's hash is not known (i.e. if -- 'validatorFromHash' returns @Nothing@), this function will return @Nothing@. -resolveReferenceScript :: - ( IsAbstractOutput out, - ToScriptHash (ReferenceScriptType out), - MonadBlockChainBalancing m +resolveReferenceScript :: + ( IsAbstractOutput out, + ToScriptHash (ReferenceScriptType out), + MonadBlockChainBalancing m ) => - out -> - m (Maybe (ConcreteOutput (OwnerType out) (DatumType out) (ValueType out) (Pl.Versioned PV2.Validator))) + out -> + m (Maybe (ConcreteOutput (OwnerType out) (DatumType out) (ValueType out) (Pl.Versioned PV2.Validator))) resolveReferenceScript :: out -> m (Maybe (ConcreteOutput @@ -1041,14 +1041,14 @@ (DatumType out) (ValueType out) (Versioned Validator))) -resolveReferenceScript out -out = +resolveReferenceScript out +out = case out -> Maybe ScriptHash forall o. (IsAbstractOutput o, ToScriptHash (ReferenceScriptType o)) => o -> Maybe ScriptHash outputReferenceScriptHash out -out of +out of Maybe ScriptHash Nothing -> Maybe (ConcreteOutput @@ -1071,18 +1071,18 @@ (Versioned Validator)) forall a. Maybe a Nothing - Just (PV2.ScriptHash BuiltinByteString -hash) -> do - Maybe (Versioned Validator) -mVal <- ValidatorHash -> m (Maybe (Versioned Validator)) + Just (PV2.ScriptHash BuiltinByteString +hash) -> do + Maybe (Versioned Validator) +mVal <- ValidatorHash -> m (Maybe (Versioned Validator)) forall (m :: * -> *). MonadBlockChainBalancing m => ValidatorHash -> m (Maybe (Versioned Validator)) validatorFromHash (BuiltinByteString -> ValidatorHash PV2.ValidatorHash BuiltinByteString -hash) +hash) case Maybe (Versioned Validator) -mVal of +mVal of Maybe (Versioned Validator) Nothing -> Maybe (ConcreteOutput @@ -1105,8 +1105,8 @@ (Versioned Validator)) forall a. Maybe a Nothing - Just Versioned Validator -val -> + Just Versioned Validator +val -> Maybe (ConcreteOutput (OwnerType out) @@ -1210,7 +1210,7 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput (out -out out -> Optic' A_Lens NoIx out (OwnerType out) -> OwnerType out +out out -> Optic' A_Lens NoIx out (OwnerType out) -> OwnerType out forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -1218,7 +1218,7 @@ forall o. IsAbstractOutput o => Lens' o (OwnerType o) outputOwnerL) (out -out out +out out -> Optic' A_Lens NoIx out (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -1228,7 +1228,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) (out -out out -> Optic' A_Lens NoIx out (ValueType out) -> ValueType out +out out -> Optic' A_Lens NoIx out (ValueType out) -> ValueType out forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -1236,7 +1236,7 @@ forall o. IsAbstractOutput o => Lens' o (ValueType o) outputValueL) (out -out out -> Optic' A_Lens NoIx out (DatumType out) -> DatumType out +out out -> Optic' A_Lens NoIx out (DatumType out) -> DatumType out forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -1246,29 +1246,29 @@ (Versioned Validator -> Maybe (Versioned Validator) forall a. a -> Maybe a Just Versioned Validator -val) +val) -outputDatumFromTxOutRef :: MonadBlockChainWithoutValidation m => PV2.TxOutRef -> m (Maybe PV2.OutputDatum) +outputDatumFromTxOutRef :: MonadBlockChainWithoutValidation m => PV2.TxOutRef -> m (Maybe PV2.OutputDatum) outputDatumFromTxOutRef :: TxOutRef -> m (Maybe OutputDatum) -outputDatumFromTxOutRef TxOutRef -oref = do - Maybe TxOut -mOut <- TxOutRef -> m (Maybe TxOut) +outputDatumFromTxOutRef TxOutRef +oref = do + Maybe TxOut +mOut <- TxOutRef -> m (Maybe TxOut) forall (m :: * -> *). MonadBlockChainBalancing m => TxOutRef -> m (Maybe TxOut) txOutByRef TxOutRef -oref +oref case Maybe TxOut -mOut of +mOut of Maybe TxOut Nothing -> Maybe OutputDatum -> m (Maybe OutputDatum) forall (m :: * -> *) a. Monad m => a -> m a return Maybe OutputDatum forall a. Maybe a Nothing - Just TxOut -out -> Maybe OutputDatum -> m (Maybe OutputDatum) + Just TxOut +out -> Maybe OutputDatum -> m (Maybe OutputDatum) forall (m :: * -> *) a. Monad m => a -> m a return (Maybe OutputDatum -> m (Maybe OutputDatum)) -> (OutputDatum -> Maybe OutputDatum) @@ -1285,21 +1285,21 @@ (IsAbstractOutput o, ToOutputDatum (DatumType o)) => o -> OutputDatum outputOutputDatum TxOut -out +out -datumFromTxOutRef :: MonadBlockChainWithoutValidation m => PV2.TxOutRef -> m (Maybe PV2.Datum) +datumFromTxOutRef :: MonadBlockChainWithoutValidation m => PV2.TxOutRef -> m (Maybe PV2.Datum) datumFromTxOutRef :: TxOutRef -> m (Maybe Datum) -datumFromTxOutRef TxOutRef -oref = do - Maybe OutputDatum -mOutputDatum <- TxOutRef -> m (Maybe OutputDatum) +datumFromTxOutRef TxOutRef +oref = do + Maybe OutputDatum +mOutputDatum <- TxOutRef -> m (Maybe OutputDatum) forall (m :: * -> *). MonadBlockChainWithoutValidation m => TxOutRef -> m (Maybe OutputDatum) outputDatumFromTxOutRef TxOutRef -oref +oref case Maybe OutputDatum -mOutputDatum of +mOutputDatum of Maybe OutputDatum Nothing -> Maybe Datum -> m (Maybe Datum) forall (m :: * -> *) a. Monad m => a -> m a @@ -1312,35 +1312,35 @@ return Maybe Datum forall a. Maybe a Nothing - Just (PV2.OutputDatum Datum -datum) -> Maybe Datum -> m (Maybe Datum) + Just (PV2.OutputDatum Datum +datum) -> Maybe Datum -> m (Maybe Datum) forall (m :: * -> *) a. Monad m => a -> m a return (Maybe Datum -> m (Maybe Datum)) -> Maybe Datum -> m (Maybe Datum) forall a b. (a -> b) -> a -> b $ Datum -> Maybe Datum forall a. a -> Maybe a Just Datum -datum - Just (PV2.OutputDatumHash DatumHash -datumHash) -> do - Maybe Datum -mDatum <- DatumHash -> m (Maybe Datum) +datum + Just (PV2.OutputDatumHash DatumHash +datumHash) -> do + Maybe Datum +mDatum <- DatumHash -> m (Maybe Datum) forall (m :: * -> *). MonadBlockChainBalancing m => DatumHash -> m (Maybe Datum) datumFromHash DatumHash -datumHash +datumHash case Maybe Datum -mDatum of - Just Datum -datum -> Maybe Datum -> m (Maybe Datum) +mDatum of + Just Datum +datum -> Maybe Datum -> m (Maybe Datum) forall (m :: * -> *) a. Monad m => a -> m a return (Maybe Datum -> m (Maybe Datum)) -> Maybe Datum -> m (Maybe Datum) forall a b. (a -> b) -> a -> b $ Datum -> Maybe Datum forall a. a -> Maybe a Just Datum -datum +datum Maybe Datum Nothing -> Maybe Datum -> m (Maybe Datum) forall (m :: * -> *) a. Monad m => a -> m a @@ -1348,56 +1348,56 @@ forall a. Maybe a Nothing -typedDatumFromTxOutRef :: (PV2.FromData a, MonadBlockChainWithoutValidation m) => PV2.TxOutRef -> m (Maybe a) +typedDatumFromTxOutRef :: (PV2.FromData a, MonadBlockChainWithoutValidation m) => PV2.TxOutRef -> m (Maybe a) typedDatumFromTxOutRef :: TxOutRef -> m (Maybe a) -typedDatumFromTxOutRef TxOutRef -oref = do - Maybe Datum -mDatum <- TxOutRef -> m (Maybe Datum) +typedDatumFromTxOutRef TxOutRef +oref = do + Maybe Datum +mDatum <- TxOutRef -> m (Maybe Datum) forall (m :: * -> *). MonadBlockChainWithoutValidation m => TxOutRef -> m (Maybe Datum) datumFromTxOutRef TxOutRef -oref +oref case Maybe Datum -mDatum of +mDatum of Maybe Datum Nothing -> Maybe a -> m (Maybe a) forall (m :: * -> *) a. Monad m => a -> m a return Maybe a forall a. Maybe a Nothing - Just (PV2.Datum BuiltinData -datum) -> Maybe a -> m (Maybe a) + Just (PV2.Datum BuiltinData +datum) -> Maybe a -> m (Maybe a) forall (m :: * -> *) a. Monad m => a -> m a return (Maybe a -> m (Maybe a)) -> Maybe a -> m (Maybe a) forall a b. (a -> b) -> a -> b $ BuiltinData -> Maybe a forall a. FromData a => BuiltinData -> Maybe a PV2.fromBuiltinData BuiltinData -datum +datum -valueFromTxOutRef :: MonadBlockChainWithoutValidation m => PV2.TxOutRef -> m (Maybe PV2.Value) +valueFromTxOutRef :: MonadBlockChainWithoutValidation m => PV2.TxOutRef -> m (Maybe PV2.Value) valueFromTxOutRef :: TxOutRef -> m (Maybe Value) -valueFromTxOutRef TxOutRef -oref = do - Maybe TxOut -mOut <- TxOutRef -> m (Maybe TxOut) +valueFromTxOutRef TxOutRef +oref = do + Maybe TxOut +mOut <- TxOutRef -> m (Maybe TxOut) forall (m :: * -> *). MonadBlockChainBalancing m => TxOutRef -> m (Maybe TxOut) txOutByRef TxOutRef -oref +oref case Maybe TxOut -mOut of +mOut of Maybe TxOut Nothing -> Maybe Value -> m (Maybe Value) forall (m :: * -> *) a. Monad m => a -> m a return Maybe Value forall a. Maybe a Nothing - Just TxOut -out -> Maybe Value -> m (Maybe Value) + Just TxOut +out -> Maybe Value -> m (Maybe Value) forall (m :: * -> *) a. Monad m => a -> m a return (Maybe Value -> m (Maybe Value)) -> (Value -> Maybe Value) -> Value -> m (Maybe Value) @@ -1409,7 +1409,7 @@ $ TxOut -> Value forall o. (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value outputValue TxOut -out +out -- ** Slot and Time Management @@ -1423,12 +1423,12 @@ -- the docs on 'autoSlotIncrease' to be able to simulate sending transactions in parallel. -- | Moves n slots fowards -waitNSlots :: (MonadBlockChainWithoutValidation m) => Integer -> m Ledger.Slot +waitNSlots :: (MonadBlockChainWithoutValidation m) => Integer -> m Ledger.Slot waitNSlots :: Integer -> m Slot -waitNSlots Integer -n = +waitNSlots Integer +n = if Integer -n Integer -> Integer -> Bool +n Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool < Integer 0 @@ -1451,10 +1451,10 @@ + Integer -> Slot forall a b. (Integral a, Num b) => a -> b fromIntegral Integer -n) +n) -- | Returns the closed ms interval corresponding to the current slot -currentTime :: (MonadBlockChainWithoutValidation m) => m (PV2.POSIXTime, PV2.POSIXTime) +currentTime :: (MonadBlockChainWithoutValidation m) => m (PV2.POSIXTime, PV2.POSIXTime) currentTime :: m (POSIXTime, POSIXTime) currentTime = Slot -> m (POSIXTime, POSIXTime) forall (m :: * -> *). @@ -1479,12 +1479,12 @@ -- and -- -- > slotToTimeInterval n == (a, b) ==> getEnclosingSlot (a-1) == n-1 && getEnclosingSlot (b+1) == n+1 -slotToTimeInterval :: (MonadBlockChainWithoutValidation m) => Ledger.Slot -> m (PV2.POSIXTime, PV2.POSIXTime) +slotToTimeInterval :: (MonadBlockChainWithoutValidation m) => Ledger.Slot -> m (PV2.POSIXTime, PV2.POSIXTime) slotToTimeInterval :: Slot -> m (POSIXTime, POSIXTime) -slotToTimeInterval Slot -slot = do - SlotConfig -slotConfig <- Params -> SlotConfig +slotToTimeInterval Slot +slot = do + SlotConfig +slotConfig <- Params -> SlotConfig Emulator.pSlotConfig (Params -> SlotConfig) -> m Params -> m SlotConfig forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> m Params @@ -1492,29 +1492,29 @@ getParams case SlotConfig -> Slot -> POSIXTimeRange Emulator.slotToPOSIXTimeRange SlotConfig -slotConfig Slot -slot of +slotConfig Slot +slot of PV2.Interval - (PV2.LowerBound (PV2.Finite POSIXTime -l) Bool -leftclosed) - (PV2.UpperBound (PV2.Finite POSIXTime -r) Bool -rightclosed) -> + (PV2.LowerBound (PV2.Finite POSIXTime +l) Bool +leftclosed) + (PV2.UpperBound (PV2.Finite POSIXTime +r) Bool +rightclosed) -> (POSIXTime, POSIXTime) -> m (POSIXTime, POSIXTime) forall (m :: * -> *) a. Monad m => a -> m a return ( if Bool -leftclosed then POSIXTime -l else POSIXTime -l POSIXTime -> POSIXTime -> POSIXTime +leftclosed then POSIXTime +l else POSIXTime +l POSIXTime -> POSIXTime -> POSIXTime forall a. Num a => a -> a -> a + POSIXTime 1, if Bool -rightclosed then POSIXTime -r else POSIXTime -r POSIXTime -> POSIXTime -> POSIXTime +rightclosed then POSIXTime +r else POSIXTime +r POSIXTime -> POSIXTime -> POSIXTime forall a. Num a => a -> a -> a - POSIXTime 1 @@ -1527,12 +1527,12 @@ -- | Return the slot that contains the given time. See 'slotToTimeInterval' for -- some equational properties this function satisfies. -getEnclosingSlot :: (MonadBlockChainWithoutValidation m) => PV2.POSIXTime -> m Ledger.Slot +getEnclosingSlot :: (MonadBlockChainWithoutValidation m) => PV2.POSIXTime -> m Ledger.Slot getEnclosingSlot :: POSIXTime -> m Slot -getEnclosingSlot POSIXTime -t = do - SlotConfig -slotConfig <- Params -> SlotConfig +getEnclosingSlot POSIXTime +t = do + SlotConfig +slotConfig <- Params -> SlotConfig Emulator.pSlotConfig (Params -> SlotConfig) -> m Params -> m SlotConfig forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> m Params @@ -1544,12 +1544,12 @@ forall a b. (a -> b) -> a -> b $ SlotConfig -> POSIXTime -> Slot Emulator.posixTimeToEnclosingSlot SlotConfig -slotConfig POSIXTime -t +slotConfig POSIXTime +t -- | Waits until the current slot becomes greater or equal to the slot containing the given POSIX time. -- Note that that it might not wait for anything if the current slot is large enough. -awaitEnclosingSlot :: (MonadBlockChainWithoutValidation m) => PV2.POSIXTime -> m Ledger.Slot +awaitEnclosingSlot :: (MonadBlockChainWithoutValidation m) => PV2.POSIXTime -> m Ledger.Slot awaitEnclosingSlot :: POSIXTime -> m Slot awaitEnclosingSlot = Slot -> m Slot forall (m :: * -> *). @@ -1566,34 +1566,34 @@ getEnclosingSlot -- | The infinite range of slots ending before or at the given POSIX time -slotRangeBefore :: MonadBlockChainWithoutValidation m => PV2.POSIXTime -> m Ledger.SlotRange +slotRangeBefore :: MonadBlockChainWithoutValidation m => PV2.POSIXTime -> m Ledger.SlotRange slotRangeBefore :: POSIXTime -> m SlotRange -slotRangeBefore POSIXTime -t = do - Slot -n <- POSIXTime -> m Slot +slotRangeBefore POSIXTime +t = do + Slot +n <- POSIXTime -> m Slot forall (m :: * -> *). MonadBlockChainWithoutValidation m => POSIXTime -> m Slot getEnclosingSlot POSIXTime -t +t (POSIXTime -_, POSIXTime -b) <- Slot -> m (POSIXTime, POSIXTime) +_, POSIXTime +b) <- Slot -> m (POSIXTime, POSIXTime) forall (m :: * -> *). MonadBlockChainWithoutValidation m => Slot -> m (POSIXTime, POSIXTime) slotToTimeInterval Slot -n +n -- If the given time @t@ happens to be the last millisecond of its slot, we -- can include the whole slot. Otherwise, the only way to be sure that the -- returned slot range contains no time after @t@ is to go to the preceding -- slot. if POSIXTime -t POSIXTime -> POSIXTime -> Bool +t POSIXTime -> POSIXTime -> Bool forall a. Eq a => a -> a -> Bool == POSIXTime -b +b then SlotRange -> m SlotRange forall (m :: * -> *) a. Monad m => a -> m a return (SlotRange -> m SlotRange) -> SlotRange -> m SlotRange @@ -1601,7 +1601,7 @@ $ Slot -> SlotRange forall a. a -> Interval a PV2.to Slot -n +n else SlotRange -> m SlotRange forall (m :: * -> *) a. Monad m => a -> m a return (SlotRange -> m SlotRange) -> SlotRange -> m SlotRange @@ -1609,36 +1609,36 @@ $ Slot -> SlotRange forall a. a -> Interval a PV2.to (Slot -n Slot -> Slot -> Slot +n Slot -> Slot -> Slot forall a. Num a => a -> a -> a - Slot 1) -- | The infinite range of slots starting after or at the given POSIX time -slotRangeAfter :: MonadBlockChainWithoutValidation m => PV2.POSIXTime -> m Ledger.SlotRange +slotRangeAfter :: MonadBlockChainWithoutValidation m => PV2.POSIXTime -> m Ledger.SlotRange slotRangeAfter :: POSIXTime -> m SlotRange -slotRangeAfter POSIXTime -t = do - Slot -n <- POSIXTime -> m Slot +slotRangeAfter POSIXTime +t = do + Slot +n <- POSIXTime -> m Slot forall (m :: * -> *). MonadBlockChainWithoutValidation m => POSIXTime -> m Slot getEnclosingSlot POSIXTime -t - (POSIXTime -a, POSIXTime +t + (POSIXTime +a, POSIXTime _) <- Slot -> m (POSIXTime, POSIXTime) forall (m :: * -> *). MonadBlockChainWithoutValidation m => Slot -> m (POSIXTime, POSIXTime) slotToTimeInterval Slot -n +n if POSIXTime -t POSIXTime -> POSIXTime -> Bool +t POSIXTime -> POSIXTime -> Bool forall a. Eq a => a -> a -> Bool == POSIXTime -a +a then SlotRange -> m SlotRange forall (m :: * -> *) a. Monad m => a -> m a return (SlotRange -> m SlotRange) -> SlotRange -> m SlotRange @@ -1646,7 +1646,7 @@ $ Slot -> SlotRange forall a. a -> Interval a PV2.from Slot -n +n else SlotRange -> m SlotRange forall (m :: * -> *) a. Monad m => a -> m a return (SlotRange -> m SlotRange) -> SlotRange -> m SlotRange @@ -1654,7 +1654,7 @@ $ Slot -> SlotRange forall a. a -> Interval a PV2.from (Slot -n Slot -> Slot -> Slot +n Slot -> Slot -> Slot forall a. Num a => a -> a -> a + Slot 1) @@ -1669,9 +1669,9 @@ -- > deriving via (AsTrans (ReaderT r) m) instance MonadBlockChain m => MonadBlockChain (ReaderT r m) -- -- and avoid the boilerplate of defining all the methods of the class yourself. -newtype AsTrans t (m :: Type -> Type) a = AsTrans {AsTrans t m a -> t m a -getTrans :: t m a} - deriving newtype (a -> AsTrans t m b -> AsTrans t m a +newtype AsTrans t (m :: Type -> Type) a = AsTrans {AsTrans t m a -> t m a +getTrans :: t m a} + deriving newtype (a -> AsTrans t m b -> AsTrans t m a (a -> b) -> AsTrans t m a -> AsTrans t m b (forall a b. (a -> b) -> AsTrans t m a -> AsTrans t m b) -> (forall a b. a -> AsTrans t m b -> AsTrans t m a) @@ -1695,7 +1695,7 @@ $cfmap :: forall (t :: (* -> *) -> * -> *) (m :: * -> *) a b. Functor (t m) => (a -> b) -> AsTrans t m a -> AsTrans t m b -Functor, Functor (AsTrans t m) +Functor, Functor (AsTrans t m) a -> AsTrans t m a Functor (AsTrans t m) -> (forall a. a -> AsTrans t m a) @@ -1765,7 +1765,7 @@ $cp1Applicative :: forall (t :: (* -> *) -> * -> *) (m :: * -> *). Applicative (t m) => Functor (AsTrans t m) -Applicative, Applicative (AsTrans t m) +Applicative, Applicative (AsTrans t m) a -> AsTrans t m a Applicative (AsTrans t m) -> (forall a b. @@ -1811,7 +1811,7 @@ $cp1Monad :: forall (t :: (* -> *) -> * -> *) (m :: * -> *). Monad (t m) => Applicative (AsTrans t m) -Monad, m a -> AsTrans t m a +Monad, m a -> AsTrans t m a (forall (m :: * -> *) a. Monad m => m a -> AsTrans t m a) -> MonadTrans (AsTrans t) forall (m :: * -> *) a. Monad m => m a -> AsTrans t m a @@ -1824,7 +1824,7 @@ $clift :: forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> AsTrans t m a -MonadTrans, MonadTrans (AsTrans t) +MonadTrans, MonadTrans (AsTrans t) m (StT (AsTrans t) a) -> AsTrans t m a MonadTrans (AsTrans t) -> (forall (m :: * -> *) a. @@ -1868,8 +1868,8 @@ MonadTrans (AsTrans t) MonadTransControl) -instance (MonadTrans t, MonadFail m, Monad (t m)) => MonadFail (AsTrans t m) where - fail :: String -> AsTrans t m a +instance (MonadTrans t, MonadFail m, Monad (t m)) => MonadFail (AsTrans t m) where + fail :: String -> AsTrans t m a fail = m a -> AsTrans t m a forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => @@ -1881,8 +1881,8 @@ forall (m :: * -> *) a. MonadFail m => String -> m a fail -instance (MonadTransControl t, MonadError MockChainError m, Monad (t m)) => MonadError MockChainError (AsTrans t m) where - throwError :: MockChainError -> AsTrans t m a +instance (MonadTransControl t, MonadError MockChainError m, Monad (t m)) => MonadError MockChainError (AsTrans t m) where + throwError :: MockChainError -> AsTrans t m a throwError = m a -> AsTrans t m a forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => @@ -1893,30 +1893,30 @@ . MockChainError -> m a forall e (m :: * -> *) a. MonadError e m => e -> m a throwError - catchError :: AsTrans t m a -> (MockChainError -> AsTrans t m a) -> AsTrans t m a -catchError AsTrans t m a -act MockChainError -> AsTrans t m a -f = (Run (AsTrans t) -> m (StT t a)) -> AsTrans t m (StT t a) + catchError :: AsTrans t m a -> (MockChainError -> AsTrans t m a) -> AsTrans t m a +catchError AsTrans t m a +act MockChainError -> AsTrans t m a +f = (Run (AsTrans t) -> m (StT t a)) -> AsTrans t m (StT t a) forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTransControl t, Monad m) => (Run t -> m a) -> t m a -liftWith (\Run (AsTrans t) -run -> m (StT t a) -> (MockChainError -> m (StT t a)) -> m (StT t a) +liftWith (\Run (AsTrans t) +run -> m (StT t a) -> (MockChainError -> m (StT t a)) -> m (StT t a) forall e (m :: * -> *) a. MonadError e m => m a -> (e -> m a) -> m a catchError (AsTrans t m a -> m (StT (AsTrans t) a) Run (AsTrans t) -run AsTrans t m a -act) (AsTrans t m a -> m (StT t a) +run AsTrans t m a +act) (AsTrans t m a -> m (StT t a) Run (AsTrans t) -run (AsTrans t m a -> m (StT t a)) +run (AsTrans t m a -> m (StT t a)) -> (MockChainError -> AsTrans t m a) -> MockChainError -> m (StT t a) forall b c a. (b -> c) -> (a -> b) -> a -> c . MockChainError -> AsTrans t m a -f)) AsTrans t m (StT t a) +f)) AsTrans t m (StT t a) -> (StT t a -> AsTrans t m a) -> AsTrans t m a forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= m (StT t a) -> AsTrans t m a @@ -1930,17 +1930,17 @@ forall (m :: * -> *) a. Monad m => a -> m a return -instance (MonadTrans t, MonadBlockChainBalancing m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainBalancing (AsTrans t m) where - getParams :: AsTrans t m Params -getParams = m Params -> AsTrans t m Params +instance (MonadTrans t, MonadBlockChainBalancing m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainBalancing (AsTrans t m) where + getParams :: AsTrans t m Params +getParams = m Params -> AsTrans t m Params forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a lift m Params forall (m :: * -> *). MonadBlockChainBalancing m => m Params getParams - validatorFromHash :: ValidatorHash -> AsTrans t m (Maybe (Versioned Validator)) -validatorFromHash = m (Maybe (Versioned Validator)) + validatorFromHash :: ValidatorHash -> AsTrans t m (Maybe (Versioned Validator)) +validatorFromHash = m (Maybe (Versioned Validator)) -> AsTrans t m (Maybe (Versioned Validator)) forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => @@ -1956,8 +1956,8 @@ MonadBlockChainBalancing m => ValidatorHash -> m (Maybe (Versioned Validator)) validatorFromHash - utxosAtLedger :: Address -> AsTrans t m [(TxOutRef, TxOut)] -utxosAtLedger = m [(TxOutRef, TxOut)] -> AsTrans t m [(TxOutRef, TxOut)] + utxosAtLedger :: Address -> AsTrans t m [(TxOutRef, TxOut)] +utxosAtLedger = m [(TxOutRef, TxOut)] -> AsTrans t m [(TxOutRef, TxOut)] forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a @@ -1971,8 +1971,8 @@ MonadBlockChainBalancing m => Address -> m [(TxOutRef, TxOut)] utxosAtLedger - txOutByRefLedger :: TxOutRef -> AsTrans t m (Maybe TxOut) -txOutByRefLedger = m (Maybe TxOut) -> AsTrans t m (Maybe TxOut) + txOutByRefLedger :: TxOutRef -> AsTrans t m (Maybe TxOut) +txOutByRefLedger = m (Maybe TxOut) -> AsTrans t m (Maybe TxOut) forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a @@ -1986,8 +1986,8 @@ MonadBlockChainBalancing m => TxOutRef -> m (Maybe TxOut) txOutByRefLedger - datumFromHash :: DatumHash -> AsTrans t m (Maybe Datum) -datumFromHash = m (Maybe Datum) -> AsTrans t m (Maybe Datum) + datumFromHash :: DatumHash -> AsTrans t m (Maybe Datum) +datumFromHash = m (Maybe Datum) -> AsTrans t m (Maybe Datum) forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a @@ -2002,9 +2002,9 @@ DatumHash -> m (Maybe Datum) datumFromHash -instance (MonadTrans t, MonadBlockChainWithoutValidation m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainWithoutValidation (AsTrans t m) where - allUtxosLedger :: AsTrans t m [(TxOutRef, TxOut)] -allUtxosLedger = m [(TxOutRef, TxOut)] -> AsTrans t m [(TxOutRef, TxOut)] +instance (MonadTrans t, MonadBlockChainWithoutValidation m, Monad (t m), MonadError MockChainError (AsTrans t m)) => MonadBlockChainWithoutValidation (AsTrans t m) where + allUtxosLedger :: AsTrans t m [(TxOutRef, TxOut)] +allUtxosLedger = m [(TxOutRef, TxOut)] -> AsTrans t m [(TxOutRef, TxOut)] forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a @@ -2013,16 +2013,16 @@ MonadBlockChainWithoutValidation m => m [(TxOutRef, TxOut)] allUtxosLedger - currentSlot :: AsTrans t m Slot -currentSlot = m Slot -> AsTrans t m Slot + currentSlot :: AsTrans t m Slot +currentSlot = m Slot -> AsTrans t m Slot forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a lift m Slot forall (m :: * -> *). MonadBlockChainWithoutValidation m => m Slot currentSlot - awaitSlot :: Slot -> AsTrans t m Slot -awaitSlot = m Slot -> AsTrans t m Slot + awaitSlot :: Slot -> AsTrans t m Slot +awaitSlot = m Slot -> AsTrans t m Slot forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a @@ -2035,9 +2035,9 @@ Slot -> m Slot awaitSlot -instance (MonadTrans t, MonadBlockChain m, MonadBlockChainWithoutValidation (AsTrans t m)) => MonadBlockChain (AsTrans t m) where - validateTxSkel :: TxSkel -> AsTrans t m CardanoTx -validateTxSkel = m CardanoTx -> AsTrans t m CardanoTx +instance (MonadTrans t, MonadBlockChain m, MonadBlockChainWithoutValidation (AsTrans t m)) => MonadBlockChain (AsTrans t m) where + validateTxSkel :: TxSkel -> AsTrans t m CardanoTx +validateTxSkel = m CardanoTx -> AsTrans t m CardanoTx forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a @@ -2048,23 +2048,23 @@ forall (m :: * -> *). MonadBlockChain m => TxSkel -> m CardanoTx validateTxSkel -deriving via (AsTrans (WriterT w) m) instance (Monoid w, MonadBlockChainBalancing m) => MonadBlockChainBalancing (WriterT w m) +deriving via (AsTrans (WriterT w) m) instance (Monoid w, MonadBlockChainBalancing m) => MonadBlockChainBalancing (WriterT w m) -deriving via (AsTrans (WriterT w) m) instance (Monoid w, MonadBlockChainWithoutValidation m) => MonadBlockChainWithoutValidation (WriterT w m) +deriving via (AsTrans (WriterT w) m) instance (Monoid w, MonadBlockChainWithoutValidation m) => MonadBlockChainWithoutValidation (WriterT w m) -deriving via (AsTrans (WriterT w) m) instance (Monoid w, MonadBlockChain m) => MonadBlockChain (WriterT w m) +deriving via (AsTrans (WriterT w) m) instance (Monoid w, MonadBlockChain m) => MonadBlockChain (WriterT w m) -deriving via (AsTrans (ReaderT r) m) instance MonadBlockChainBalancing m => MonadBlockChainBalancing (ReaderT r m) +deriving via (AsTrans (ReaderT r) m) instance MonadBlockChainBalancing m => MonadBlockChainBalancing (ReaderT r m) -deriving via (AsTrans (ReaderT r) m) instance MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (ReaderT r m) +deriving via (AsTrans (ReaderT r) m) instance MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (ReaderT r m) -deriving via (AsTrans (ReaderT r) m) instance MonadBlockChain m => MonadBlockChain (ReaderT r m) +deriving via (AsTrans (ReaderT r) m) instance MonadBlockChain m => MonadBlockChain (ReaderT r m) -deriving via (AsTrans (StateT s) m) instance MonadBlockChainBalancing m => MonadBlockChainBalancing (StateT s m) +deriving via (AsTrans (StateT s) m) instance MonadBlockChainBalancing m => MonadBlockChainBalancing (StateT s m) -deriving via (AsTrans (StateT s) m) instance MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (StateT s m) +deriving via (AsTrans (StateT s) m) instance MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (StateT s m) -deriving via (AsTrans (StateT s) m) instance MonadBlockChain m => MonadBlockChain (StateT s m) +deriving via (AsTrans (StateT s) m) instance MonadBlockChain m => MonadBlockChain (StateT s m) -- 'ListT' has no 'MonadTransControl' instance, so the @deriving via ...@ -- machinery is unusable here. However, there is @@ -2075,17 +2075,17 @@ -- 'MonadBlockChainWithoutValidation' and 'MonadBlockChain' instances for -- 'ListT', instead of more black magic... -instance MonadBlockChainBalancing m => MonadBlockChainBalancing (ListT m) where - getParams :: ListT m Params -getParams = m Params -> ListT m Params +instance MonadBlockChainBalancing m => MonadBlockChainBalancing (ListT m) where + getParams :: ListT m Params +getParams = m Params -> ListT m Params forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a lift m Params forall (m :: * -> *). MonadBlockChainBalancing m => m Params getParams - validatorFromHash :: ValidatorHash -> ListT m (Maybe (Versioned Validator)) -validatorFromHash = m (Maybe (Versioned Validator)) + validatorFromHash :: ValidatorHash -> ListT m (Maybe (Versioned Validator)) +validatorFromHash = m (Maybe (Versioned Validator)) -> ListT m (Maybe (Versioned Validator)) forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => @@ -2101,8 +2101,8 @@ MonadBlockChainBalancing m => ValidatorHash -> m (Maybe (Versioned Validator)) validatorFromHash - utxosAtLedger :: Address -> ListT m [(TxOutRef, TxOut)] -utxosAtLedger = m [(TxOutRef, TxOut)] -> ListT m [(TxOutRef, TxOut)] + utxosAtLedger :: Address -> ListT m [(TxOutRef, TxOut)] +utxosAtLedger = m [(TxOutRef, TxOut)] -> ListT m [(TxOutRef, TxOut)] forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a @@ -2116,8 +2116,8 @@ MonadBlockChainBalancing m => Address -> m [(TxOutRef, TxOut)] utxosAtLedger - txOutByRefLedger :: TxOutRef -> ListT m (Maybe TxOut) -txOutByRefLedger = m (Maybe TxOut) -> ListT m (Maybe TxOut) + txOutByRefLedger :: TxOutRef -> ListT m (Maybe TxOut) +txOutByRefLedger = m (Maybe TxOut) -> ListT m (Maybe TxOut) forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a @@ -2131,8 +2131,8 @@ MonadBlockChainBalancing m => TxOutRef -> m (Maybe TxOut) txOutByRefLedger - datumFromHash :: DatumHash -> ListT m (Maybe Datum) -datumFromHash = m (Maybe Datum) -> ListT m (Maybe Datum) + datumFromHash :: DatumHash -> ListT m (Maybe Datum) +datumFromHash = m (Maybe Datum) -> ListT m (Maybe Datum) forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a @@ -2147,9 +2147,9 @@ DatumHash -> m (Maybe Datum) datumFromHash -instance MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (ListT m) where - allUtxosLedger :: ListT m [(TxOutRef, TxOut)] -allUtxosLedger = m [(TxOutRef, TxOut)] -> ListT m [(TxOutRef, TxOut)] +instance MonadBlockChainWithoutValidation m => MonadBlockChainWithoutValidation (ListT m) where + allUtxosLedger :: ListT m [(TxOutRef, TxOut)] +allUtxosLedger = m [(TxOutRef, TxOut)] -> ListT m [(TxOutRef, TxOut)] forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a @@ -2158,16 +2158,16 @@ MonadBlockChainWithoutValidation m => m [(TxOutRef, TxOut)] allUtxosLedger - currentSlot :: ListT m Slot -currentSlot = m Slot -> ListT m Slot + currentSlot :: ListT m Slot +currentSlot = m Slot -> ListT m Slot forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a lift m Slot forall (m :: * -> *). MonadBlockChainWithoutValidation m => m Slot currentSlot - awaitSlot :: Slot -> ListT m Slot -awaitSlot = m Slot -> ListT m Slot + awaitSlot :: Slot -> ListT m Slot +awaitSlot = m Slot -> ListT m Slot forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a @@ -2180,9 +2180,9 @@ Slot -> m Slot awaitSlot -instance MonadBlockChain m => MonadBlockChain (ListT m) where - validateTxSkel :: TxSkel -> ListT m CardanoTx -validateTxSkel = m CardanoTx -> ListT m CardanoTx +instance MonadBlockChain m => MonadBlockChain (ListT m) where + validateTxSkel :: TxSkel -> ListT m CardanoTx +validateTxSkel = m CardanoTx -> ListT m CardanoTx forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a diff --git a/src/Cooked.MockChain.Direct.html b/src/Cooked.MockChain.Direct.html index 50c2d84c0..41ab3ae5f 100644 --- a/src/Cooked.MockChain.Direct.html +++ b/src/Cooked.MockChain.Direct.html @@ -60,10 +60,10 @@ mcstToUtxoState :: MockChainSt -> UtxoState mcstToUtxoState :: MockChainSt -> UtxoState -mcstToUtxoState MockChainSt {UtxoIndex +mcstToUtxoState MockChainSt {UtxoIndex mcstIndex :: MockChainSt -> UtxoIndex mcstIndex :: UtxoIndex -mcstIndex, Map DatumHash (TxSkelOutDatum, Integer) +mcstIndex, Map DatumHash (TxSkelOutDatum, Integer) mcstDatums :: MockChainSt -> Map DatumHash (TxSkelOutDatum, Integer) mcstDatums :: Map DatumHash (TxSkelOutDatum, Integer) mcstDatums} = @@ -82,10 +82,10 @@ forall (t :: * -> *) a b. Foldable t => (a -> b -> b) -> b -> t a -> b -foldr (\(Address -address, UtxoPayloadSet -utxoValueSet) Map Address UtxoPayloadSet -acc -> (UtxoPayloadSet -> UtxoPayloadSet -> UtxoPayloadSet) +foldr (\(Address +address, UtxoPayloadSet +utxoValueSet) Map Address UtxoPayloadSet +acc -> (UtxoPayloadSet -> UtxoPayloadSet -> UtxoPayloadSet) -> Address -> UtxoPayloadSet -> Map Address UtxoPayloadSet @@ -94,9 +94,9 @@ Map.insertWith UtxoPayloadSet -> UtxoPayloadSet -> UtxoPayloadSet forall a. Semigroup a => a -> a -> a (<>) Address -address UtxoPayloadSet -utxoValueSet Map Address UtxoPayloadSet -acc) Map Address UtxoPayloadSet +address UtxoPayloadSet +utxoValueSet Map Address UtxoPayloadSet +acc) Map Address UtxoPayloadSet forall k a. Map k a Map.empty ([(Address, UtxoPayloadSet)] -> Map Address UtxoPayloadSet) @@ -108,7 +108,7 @@ -> [(TxOutRef, TxOut)] -> [(Address, UtxoPayloadSet)] forall a b. (a -> Maybe b) -> [a] -> [b] mapMaybe (TxOutRef, TxOut) -> Maybe (Address, UtxoPayloadSet) -extractPayload +extractPayload ([(TxOutRef, TxOut)] -> [(Address, UtxoPayloadSet)]) -> (UtxoIndex -> [(TxOutRef, TxOut)]) -> UtxoIndex @@ -117,14 +117,14 @@ . ((TxIn, TxOut CtxUTxO BabbageEra) -> (TxOutRef, TxOut)) -> [(TxIn, TxOut CtxUTxO BabbageEra)] -> [(TxOutRef, TxOut)] forall a b. (a -> b) -> [a] -> [b] -map (\(TxIn -k, TxOut CtxUTxO BabbageEra -v) -> (TxIn -> TxOutRef +map (\(TxIn +k, TxOut CtxUTxO BabbageEra +v) -> (TxIn -> TxOutRef Ledger.fromCardanoTxIn TxIn -k, TxOut CtxUTxO BabbageEra -> TxOut +k, TxOut CtxUTxO BabbageEra -> TxOut forall era. TxOut CtxUTxO era -> TxOut Ledger.fromCardanoTxOutToPV2TxInfoTxOut' TxOut CtxUTxO BabbageEra -v)) +v)) ([(TxIn, TxOut CtxUTxO BabbageEra)] -> [(TxOutRef, TxOut)]) -> (UtxoIndex -> [(TxIn, TxOut CtxUTxO BabbageEra)]) -> UtxoIndex @@ -146,41 +146,41 @@ (UtxoIndex -> UtxoState) -> UtxoIndex -> UtxoState forall a b. (a -> b) -> a -> b $ UtxoIndex -mcstIndex +mcstIndex where - extractPayload :: (Pl.TxOutRef, PV2.TxOut) -> Maybe (Pl.Address, UtxoPayloadSet) - extractPayload :: (TxOutRef, TxOut) -> Maybe (Address, UtxoPayloadSet) -extractPayload (TxOutRef -txOutRef, out :: TxOut -out@PV2.TxOut {Address + extractPayload :: (Pl.TxOutRef, PV2.TxOut) -> Maybe (Pl.Address, UtxoPayloadSet) + extractPayload :: (TxOutRef, TxOut) -> Maybe (Address, UtxoPayloadSet) +extractPayload (TxOutRef +txOutRef, out :: TxOut +out@PV2.TxOut {Address txOutAddress :: TxOut -> Address txOutAddress :: Address -PV2.txOutAddress, Value +PV2.txOutAddress, Value txOutValue :: TxOut -> Value txOutValue :: Value -PV2.txOutValue, OutputDatum +PV2.txOutValue, OutputDatum txOutDatum :: TxOut -> OutputDatum txOutDatum :: OutputDatum PV2.txOutDatum}) = do - let mRefScript :: Maybe ScriptHash -mRefScript = TxOut -> Maybe ScriptHash + let mRefScript :: Maybe ScriptHash +mRefScript = TxOut -> Maybe ScriptHash forall o. (IsAbstractOutput o, ToScriptHash (ReferenceScriptType o)) => o -> Maybe ScriptHash outputReferenceScriptHash TxOut -out - TxSkelOutDatum -txSkelOutDatum <- +out + TxSkelOutDatum +txSkelOutDatum <- case OutputDatum -txOutDatum of +txOutDatum of OutputDatum Pl.NoOutputDatum -> TxSkelOutDatum -> Maybe TxSkelOutDatum forall a. a -> Maybe a Just TxSkelOutDatum TxSkelOutNoDatum - Pl.OutputDatum Datum -datum -> (TxSkelOutDatum, Integer) -> TxSkelOutDatum + Pl.OutputDatum Datum +datum -> (TxSkelOutDatum, Integer) -> TxSkelOutDatum forall a b. (a, b) -> a fst ((TxSkelOutDatum, Integer) -> TxSkelOutDatum) -> Maybe (TxSkelOutDatum, Integer) -> Maybe TxSkelOutDatum @@ -191,10 +191,10 @@ forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup (Datum -> DatumHash Pl.datumHash Datum -datum) Map DatumHash (TxSkelOutDatum, Integer) -mcstDatums - Pl.OutputDatumHash DatumHash -hash -> (TxSkelOutDatum, Integer) -> TxSkelOutDatum +datum) Map DatumHash (TxSkelOutDatum, Integer) +mcstDatums + Pl.OutputDatumHash DatumHash +hash -> (TxSkelOutDatum, Integer) -> TxSkelOutDatum forall a b. (a, b) -> a fst ((TxSkelOutDatum, Integer) -> TxSkelOutDatum) -> Maybe (TxSkelOutDatum, Integer) -> Maybe TxSkelOutDatum @@ -204,21 +204,21 @@ -> Maybe (TxSkelOutDatum, Integer) forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup DatumHash -hash Map DatumHash (TxSkelOutDatum, Integer) -mcstDatums +hash Map DatumHash (TxSkelOutDatum, Integer) +mcstDatums (Address, UtxoPayloadSet) -> Maybe (Address, UtxoPayloadSet) forall (m :: * -> *) a. Monad m => a -> m a return ( Address -txOutAddress, +txOutAddress, [UtxoPayload] -> UtxoPayloadSet UtxoPayloadSet [TxOutRef -> Value -> TxSkelOutDatum -> Maybe ScriptHash -> UtxoPayload UtxoPayload TxOutRef -txOutRef Value -txOutValue TxSkelOutDatum -txSkelOutDatum Maybe ScriptHash -mRefScript] +txOutRef Value +txOutValue TxSkelOutDatum +txSkelOutDatum Maybe ScriptHash +mRefScript] ) -- | Slightly more concrete version of 'UtxoState', used to actually run the @@ -237,7 +237,7 @@ MockChainSt -> Slot mcstCurrentSlot :: Ledger.Slot } - deriving (Int -> MockChainSt -> ShowS + deriving (Int -> MockChainSt -> ShowS [MockChainSt] -> ShowS MockChainSt -> String (Int -> MockChainSt -> ShowS) @@ -254,54 +254,54 @@ $cshowsPrec :: Int -> MockChainSt -> ShowS Show) -instance Eq MockChainSt where - (MockChainSt UtxoIndex -index1 Map DatumHash (TxSkelOutDatum, Integer) -datums1 Map ValidatorHash (Versioned Validator) -validators1 Slot -currentSlot1) - == :: MockChainSt -> MockChainSt -> Bool -== (MockChainSt UtxoIndex -index2 Map DatumHash (TxSkelOutDatum, Integer) -datums2 Map ValidatorHash (Versioned Validator) -validators2 Slot -currentSlot2) = +instance Eq MockChainSt where + (MockChainSt UtxoIndex +index1 Map DatumHash (TxSkelOutDatum, Integer) +datums1 Map ValidatorHash (Versioned Validator) +validators1 Slot +currentSlot1) + == :: MockChainSt -> MockChainSt -> Bool +== (MockChainSt UtxoIndex +index2 Map DatumHash (TxSkelOutDatum, Integer) +datums2 Map ValidatorHash (Versioned Validator) +validators2 Slot +currentSlot2) = [Bool] -> Bool forall (t :: * -> *). Foldable t => t Bool -> Bool and [ UtxoIndex -index1 UtxoIndex -> UtxoIndex -> Bool +index1 UtxoIndex -> UtxoIndex -> Bool forall a. Eq a => a -> a -> Bool == UtxoIndex -index2, +index2, Map DatumHash (TxSkelOutDatum, Integer) -datums1 Map DatumHash (TxSkelOutDatum, Integer) +datums1 Map DatumHash (TxSkelOutDatum, Integer) -> Map DatumHash (TxSkelOutDatum, Integer) -> Bool forall a. Eq a => a -> a -> Bool == Map DatumHash (TxSkelOutDatum, Integer) -datums2, +datums2, Map ValidatorHash (Versioned Validator) -validators1 Map ValidatorHash (Versioned Validator) +validators1 Map ValidatorHash (Versioned Validator) -> Map ValidatorHash (Versioned Validator) -> Bool forall a. Eq a => a -> a -> Bool == Map ValidatorHash (Versioned Validator) -validators2, +validators2, Slot -currentSlot1 Slot -> Slot -> Bool +currentSlot1 Slot -> Slot -> Bool forall a. Eq a => a -> a -> Bool == Slot -currentSlot2 +currentSlot2 ] instance Default Ledger.Slot where - def :: Slot + def :: Slot def = Integer -> Slot Ledger.Slot Integer 0 newtype MockChainEnv = MockChainEnv {MockChainEnv -> Params mceParams :: Emulator.Params} - deriving (Int -> MockChainEnv -> ShowS + deriving (Int -> MockChainEnv -> ShowS [MockChainEnv] -> ShowS MockChainEnv -> String (Int -> MockChainEnv -> ShowS) @@ -319,18 +319,18 @@ Show) instance Default MockChainEnv where - def :: MockChainEnv -def = Params -> MockChainEnv + def :: MockChainEnv +def = Params -> MockChainEnv MockChainEnv Params forall a. Default a => a def -newtype MockChainT m a = MockChainT +newtype MockChainT m a = MockChainT {MockChainT m a -> ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) a -unMockChain :: ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) a} - deriving newtype (a -> MockChainT m b -> MockChainT m a +unMockChain :: ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) a} + deriving newtype (a -> MockChainT m b -> MockChainT m a (a -> b) -> MockChainT m a -> MockChainT m b (forall a b. (a -> b) -> MockChainT m a -> MockChainT m b) -> (forall a b. a -> MockChainT m b -> MockChainT m a) @@ -354,7 +354,7 @@ $cfmap :: forall (m :: * -> *) a b. Functor m => (a -> b) -> MockChainT m a -> MockChainT m b -Functor, Functor (MockChainT m) +Functor, Functor (MockChainT m) a -> MockChainT m a Functor (MockChainT m) -> (forall a. a -> MockChainT m a) @@ -418,21 +418,21 @@ pure :: a -> MockChainT m a $cpure :: forall (m :: * -> *) a. Monad m => a -> MockChainT m a $cp1Applicative :: forall (m :: * -> *). Monad m => Functor (MockChainT m) -Applicative, MonadState MockChainSt, MonadError MockChainError, MonadReader MockChainEnv) +Applicative, MonadState MockChainSt, MonadError MockChainError, MonadReader MockChainEnv) type MockChain = MockChainT Identity -- | Custom monad instance made to increase the slot count automatically -instance (Monad m) => Monad (MockChainT m) where - return :: a -> MockChainT m a +instance (Monad m) => Monad (MockChainT m) where + return :: a -> MockChainT m a return = a -> MockChainT m a forall (f :: * -> *) a. Applicative f => a -> f a pure - MockChainT ReaderT + MockChainT ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) a -x >>= :: MockChainT m a -> (a -> MockChainT m b) -> MockChainT m b ->>= a -> MockChainT m b -f = ReaderT +x >>= :: MockChainT m a -> (a -> MockChainT m b) -> MockChainT m b +>>= a -> MockChainT m b +f = ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) b -> MockChainT m b forall (m :: * -> *) a. @@ -448,7 +448,7 @@ forall a b. (a -> b) -> a -> b $ ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) a -x ReaderT +x ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) a -> (a -> ReaderT @@ -472,10 +472,10 @@ MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) b forall b c a. (b -> c) -> (a -> b) -> a -> c . a -> MockChainT m b -f +f -instance (Monad m) => MonadFail (MockChainT m) where - fail :: String -> MockChainT m a +instance (Monad m) => MonadFail (MockChainT m) where + fail :: String -> MockChainT m a fail = MockChainError -> MockChainT m a forall e (m :: * -> *) a. MonadError e m => e -> m a throwError (MockChainError -> MockChainT m a) @@ -485,7 +485,7 @@ FailWith instance MonadTrans MockChainT where - lift :: m a -> MockChainT m a + lift :: m a -> MockChainT m a lift = ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) a -> MockChainT m a @@ -533,8 +533,8 @@ m a -> t m a lift -instance (Monad m, Alternative m) => Alternative (MockChainT m) where - empty :: MockChainT m a +instance (Monad m, Alternative m) => Alternative (MockChainT m) where + empty :: MockChainT m a empty = ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) a -> MockChainT m a @@ -593,7 +593,7 @@ ExceptT m (Either MockChainError (a, MockChainSt)) forall (f :: * -> *) a. Alternative f => f a empty - <|> :: MockChainT m a -> MockChainT m a -> MockChainT m a + <|> :: MockChainT m a -> MockChainT m a -> MockChainT m a (<|>) = (forall a. m a -> m a -> m a) -> MockChainT m a -> MockChainT m a -> MockChainT m a forall (m :: * -> *) x. @@ -604,18 +604,18 @@ forall (f :: * -> *) a. Alternative f => f a -> f a -> f a (<|>) -combineMockChainT :: - (Monad m) => - (forall a. m a -> m a -> m a) -> - MockChainT m x -> - MockChainT m x -> - MockChainT m x +combineMockChainT :: + (Monad m) => + (forall a. m a -> m a -> m a) -> + MockChainT m x -> + MockChainT m x -> + MockChainT m x combineMockChainT :: (forall a. m a -> m a -> m a) -> MockChainT m x -> MockChainT m x -> MockChainT m x -combineMockChainT forall a. m a -> m a -> m a -f MockChainT m x -ma MockChainT m x -mb = ReaderT +combineMockChainT forall a. m a -> m a -> m a +f MockChainT m x +ma MockChainT m x +mb = ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) x -> MockChainT m x forall (m :: * -> *) a. @@ -642,8 +642,8 @@ -> ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) x forall a b. (a -> b) -> a -> b -$ \MockChainEnv -r -> +$ \MockChainEnv +r -> (MockChainSt -> ExceptT MockChainError m (x, MockChainSt)) -> StateT MockChainSt (ExceptT MockChainError m) x forall s (m :: * -> *) a. (s -> m (a, s)) -> StateT s m a @@ -652,10 +652,10 @@ -> (MockChainSt -> ExceptT MockChainError m (x, MockChainSt)) -> StateT MockChainSt (ExceptT MockChainError m) x forall a b. (a -> b) -> a -> b -$ \MockChainSt -s -> - let resA :: m (Either MockChainError (x, MockChainSt)) -resA = ExceptT MockChainError m (x, MockChainSt) +$ \MockChainSt +s -> + let resA :: m (Either MockChainError (x, MockChainSt)) +resA = ExceptT MockChainError m (x, MockChainSt) -> m (Either MockChainError (x, MockChainSt)) forall e (m :: * -> *) a. ExceptT e m a -> m (Either e a) runExceptT (ExceptT MockChainError m (x, MockChainSt) @@ -678,11 +678,11 @@ -> ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) a unMockChain MockChainT m x -ma) MockChainEnv -r) MockChainSt -s - resB :: m (Either MockChainError (x, MockChainSt)) -resB = ExceptT MockChainError m (x, MockChainSt) +ma) MockChainEnv +r) MockChainSt +s + resB :: m (Either MockChainError (x, MockChainSt)) +resB = ExceptT MockChainError m (x, MockChainSt) -> m (Either MockChainError (x, MockChainSt)) forall e (m :: * -> *) a. ExceptT e m a -> m (Either e a) runExceptT (ExceptT MockChainError m (x, MockChainSt) @@ -705,9 +705,9 @@ -> ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) a unMockChain MockChainT m x -mb) MockChainEnv -r) MockChainSt -s +mb) MockChainEnv +r) MockChainSt +s in m (Either MockChainError (x, MockChainSt)) -> ExceptT MockChainError m (x, MockChainSt) forall e (m :: * -> *) a. m (Either e a) -> ExceptT e m a @@ -720,20 +720,20 @@ -> m (Either MockChainError (x, MockChainSt)) -> m (Either MockChainError (x, MockChainSt)) forall a. m a -> m a -> m a -f m (Either MockChainError (x, MockChainSt)) -resA m (Either MockChainError (x, MockChainSt)) -resB +f m (Either MockChainError (x, MockChainSt)) +resA m (Either MockChainError (x, MockChainSt)) +resB -mapMockChainT :: - (m (Either MockChainError (a, MockChainSt)) -> n (Either MockChainError (b, MockChainSt))) -> - MockChainT m a -> - MockChainT n b +mapMockChainT :: + (m (Either MockChainError (a, MockChainSt)) -> n (Either MockChainError (b, MockChainSt))) -> + MockChainT m a -> + MockChainT n b mapMockChainT :: (m (Either MockChainError (a, MockChainSt)) -> n (Either MockChainError (b, MockChainSt))) -> MockChainT m a -> MockChainT n b -mapMockChainT m (Either MockChainError (a, MockChainSt)) +mapMockChainT m (Either MockChainError (a, MockChainSt)) -> n (Either MockChainError (b, MockChainSt)) -f = ReaderT +f = ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError n)) b -> MockChainT n b forall (m :: * -> *) a. @@ -772,7 +772,7 @@ -> ExceptT e m a -> ExceptT e' n b mapExceptT m (Either MockChainError (a, MockChainSt)) -> n (Either MockChainError (b, MockChainSt)) -f)) (ReaderT +f)) (ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) a -> ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError n)) b) @@ -794,19 +794,19 @@ -- | Executes a 'MockChainT' from some initial state and environment; does /not/ -- convert the 'MockChainSt' into a 'UtxoState'. -runMockChainTRaw :: - (Monad m) => +runMockChainTRaw :: + (Monad m) => MockChainEnv -> MockChainSt -> - MockChainT m a -> - m (Either MockChainError (a, MockChainSt)) + MockChainT m a -> + m (Either MockChainError (a, MockChainSt)) runMockChainTRaw :: MockChainEnv -> MockChainSt -> MockChainT m a -> m (Either MockChainError (a, MockChainSt)) -runMockChainTRaw MockChainEnv -e0 MockChainSt -i0 = +runMockChainTRaw MockChainEnv +e0 MockChainSt +i0 = ExceptT MockChainError m (a, MockChainSt) -> m (Either MockChainError (a, MockChainSt)) forall e (m :: * -> *) a. ExceptT e m a -> m (Either e a) @@ -827,7 +827,7 @@ -> MockChainSt -> ExceptT MockChainError m (a, MockChainSt) forall s (m :: * -> *) a. StateT s m a -> s -> m (a, s) runStateT MockChainSt -i0 +i0 (StateT MockChainSt (ExceptT MockChainError m) a -> ExceptT MockChainError m (a, MockChainSt)) -> (MockChainT m a @@ -848,7 +848,7 @@ -> MockChainEnv -> StateT MockChainSt (ExceptT MockChainError m) a forall r (m :: * -> *) a. ReaderT r m a -> r -> m a runReaderT MockChainEnv -e0 +e0 (ReaderT MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) a -> StateT MockChainSt (ExceptT MockChainError m) a) @@ -871,15 +871,15 @@ -- initial value distribution. Similar to 'runMockChainT', uses the default -- environment. Returns a 'UtxoState' instead of a 'MockChainSt'. If you need -- the later, use 'runMockChainTRaw' -runMockChainTFrom :: - (Monad m) => +runMockChainTFrom :: + (Monad m) => InitialDistribution -> - MockChainT m a -> - m (Either MockChainError (a, UtxoState)) + MockChainT m a -> + m (Either MockChainError (a, UtxoState)) runMockChainTFrom :: InitialDistribution -> MockChainT m a -> m (Either MockChainError (a, UtxoState)) -runMockChainTFrom InitialDistribution -i0 = +runMockChainTFrom InitialDistribution +i0 = (Either MockChainError (a, MockChainSt) -> Either MockChainError (a, UtxoState)) -> m (Either MockChainError (a, MockChainSt)) @@ -921,12 +921,12 @@ forall a. Default a => a def (InitialDistribution -> MockChainSt mockChainSt0From InitialDistribution -i0) +i0) -- | Executes a 'MockChainT' from the canonical initial state and environment. -- The canonical environment uses the default 'SlotConfig' and -- @Cooked.Wallet.wallet 1@ as the sole wallet signing transactions. -runMockChainT :: (Monad m) => MockChainT m a -> m (Either MockChainError (a, UtxoState)) +runMockChainT :: (Monad m) => MockChainT m a -> m (Either MockChainError (a, UtxoState)) runMockChainT :: MockChainT m a -> m (Either MockChainError (a, UtxoState)) runMockChainT = InitialDistribution -> MockChainT m a -> m (Either MockChainError (a, UtxoState)) @@ -939,14 +939,14 @@ def -- | See 'runMockChainTRaw' -runMockChainRaw :: MockChainEnv -> MockChainSt -> MockChain a -> Either MockChainError (a, MockChainSt) +runMockChainRaw :: MockChainEnv -> MockChainSt -> MockChain a -> Either MockChainError (a, MockChainSt) runMockChainRaw :: MockChainEnv -> MockChainSt -> MockChain a -> Either MockChainError (a, MockChainSt) -runMockChainRaw MockChainEnv -e0 MockChainSt -i0 = Identity (Either MockChainError (a, MockChainSt)) +runMockChainRaw MockChainEnv +e0 MockChainSt +i0 = Identity (Either MockChainError (a, MockChainSt)) -> Either MockChainError (a, MockChainSt) forall a. Identity a -> a runIdentity (Identity (Either MockChainError (a, MockChainSt)) @@ -967,16 +967,16 @@ -> MockChainT m a -> m (Either MockChainError (a, MockChainSt)) runMockChainTRaw MockChainEnv -e0 MockChainSt -i0 +e0 MockChainSt +i0 -- | See 'runMockChainTFrom' -runMockChainFrom :: - InitialDistribution -> MockChain a -> Either MockChainError (a, UtxoState) +runMockChainFrom :: + InitialDistribution -> MockChain a -> Either MockChainError (a, UtxoState) runMockChainFrom :: InitialDistribution -> MockChain a -> Either MockChainError (a, UtxoState) -runMockChainFrom InitialDistribution -i0 = Identity (Either MockChainError (a, UtxoState)) +runMockChainFrom InitialDistribution +i0 = Identity (Either MockChainError (a, UtxoState)) -> Either MockChainError (a, UtxoState) forall a. Identity a -> a runIdentity (Identity (Either MockChainError (a, UtxoState)) @@ -992,10 +992,10 @@ InitialDistribution -> MockChainT m a -> m (Either MockChainError (a, UtxoState)) runMockChainTFrom InitialDistribution -i0 +i0 -- | See 'runMockChainT' -runMockChain :: MockChain a -> Either MockChainError (a, UtxoState) +runMockChain :: MockChain a -> Either MockChainError (a, UtxoState) runMockChain :: MockChain a -> Either MockChainError (a, UtxoState) runMockChain = Identity (Either MockChainError (a, UtxoState)) -> Either MockChainError (a, UtxoState) @@ -1038,15 +1038,15 @@ mockChainSt0From :: InitialDistribution -> MockChainSt mockChainSt0From :: InitialDistribution -> MockChainSt -mockChainSt0From InitialDistribution -i0 = UtxoIndex +mockChainSt0From InitialDistribution +i0 = UtxoIndex -> Map DatumHash (TxSkelOutDatum, Integer) -> Map ValidatorHash (Versioned Validator) -> Slot -> MockChainSt MockChainSt (InitialDistribution -> UtxoIndex utxoIndex0From InitialDistribution -i0) Map DatumHash (TxSkelOutDatum, Integer) +i0) Map DatumHash (TxSkelOutDatum, Integer) forall k a. Map k a Map.empty Map ValidatorHash (Versioned Validator) forall k a. Map k a @@ -1055,40 +1055,40 @@ def instance Default MockChainSt where - def :: MockChainSt -def = MockChainSt + def :: MockChainSt +def = MockChainSt mockChainSt0 utxoIndex0From :: InitialDistribution -> Ledger.UtxoIndex utxoIndex0From :: InitialDistribution -> UtxoIndex -utxoIndex0From InitialDistribution -i0 = Blockchain -> UtxoIndex +utxoIndex0From InitialDistribution +i0 = Blockchain -> UtxoIndex Ledger.initialise [[CardanoTx -> OnChainTx Ledger.Valid (CardanoTx -> OnChainTx) -> CardanoTx -> OnChainTx forall a b. (a -> b) -> a -> b $ InitialDistribution -> CardanoTx -initialTxFor InitialDistribution -i0]] +initialTxFor InitialDistribution +i0]] where -- Bootstraps an initial transaction resulting in a state where wallets -- possess UTxOs fitting a given 'InitialDistribution' - initialTxFor :: InitialDistribution -> Ledger.CardanoTx - initialTxFor :: InitialDistribution -> CardanoTx -initialTxFor InitialDistribution -initDist = Tx BabbageEra -> CardanoTx + initialTxFor :: InitialDistribution -> Ledger.CardanoTx + initialTxFor :: InitialDistribution -> CardanoTx +initialTxFor InitialDistribution +initDist = Tx BabbageEra -> CardanoTx Ledger.CardanoEmulatorEraTx (Tx BabbageEra -> CardanoTx) -> Tx BabbageEra -> CardanoTx forall a b. (a -> b) -> a -> b $ TxBody BabbageEra -> [KeyWitness BabbageEra] -> Tx BabbageEra forall era. TxBody era -> [KeyWitness era] -> Tx era C.Tx TxBody BabbageEra -body [] +body [] where - body :: C.TxBody C.BabbageEra - body :: TxBody BabbageEra -body = + body :: C.TxBody C.BabbageEra + body :: TxBody BabbageEra +body = Either TxBodyError (TxBody BabbageEra) -> TxBody BabbageEra forall e a. Show e => Either e a -> a -fromRight' (Either TxBodyError (TxBody BabbageEra) -> TxBody BabbageEra) +fromRight' (Either TxBodyError (TxBody BabbageEra) -> TxBody BabbageEra) -> Either TxBodyError (TxBody BabbageEra) -> TxBody BabbageEra forall a b. (a -> b) -> a -> b $ @@ -1146,7 +1146,7 @@ forall b c a. (b -> c) -> (a -> b) -> a -> c . Either ToCardanoError Value -> Value forall e a. Show e => Either e a -> a -fromRight' +fromRight' (Either ToCardanoError Value -> Value) -> (Value -> Either ToCardanoError Value) -> Value -> Value forall b c a. (b -> c) -> (a -> b) -> a -> c @@ -1167,44 +1167,44 @@ . (Wallet, [Value]) -> [Value] forall a b. (a, b) -> b snd) [(Wallet, [Value])] -initDist'), +initDist'), txOuts :: [TxOut CtxTx BabbageEra] C.txOuts = ((Wallet, [Value]) -> [TxOut CtxTx BabbageEra]) -> [(Wallet, [Value])] -> [TxOut CtxTx BabbageEra] forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b] -concatMap (\(Wallet -w, [Value] -vs) -> (Value -> TxOut CtxTx BabbageEra) +concatMap (\(Wallet +w, [Value] +vs) -> (Value -> TxOut CtxTx BabbageEra) -> [Value] -> [TxOut CtxTx BabbageEra] forall a b. (a -> b) -> [a] -> [b] map (Wallet -> Value -> TxOut CtxTx BabbageEra -initUtxosFor Wallet -w) [Value] -vs) [(Wallet, [Value])] -initDist', +initUtxosFor Wallet +w) [Value] +vs) [(Wallet, [Value])] +initDist', txIns :: TxIns BuildTx BabbageEra C.txIns = [(NetworkId -> Hash GenesisUTxOKey -> TxIn C.genesisUTxOPseudoTxIn NetworkId -theNetworkId Hash GenesisUTxOKey -genesisKeyHash, Witness WitCtxTxIn BabbageEra +theNetworkId Hash GenesisUTxOKey +genesisKeyHash, Witness WitCtxTxIn BabbageEra -> BuildTxWith BuildTx (Witness WitCtxTxIn BabbageEra) forall a. a -> BuildTxWith BuildTx a C.BuildTxWith Witness WitCtxTxIn BabbageEra forall era. Witness WitCtxTxIn era -spendWit)] +spendWit)] } - spendWit :: Witness WitCtxTxIn era -spendWit = KeyWitnessInCtx WitCtxTxIn -> Witness WitCtxTxIn era + spendWit :: Witness WitCtxTxIn era +spendWit = KeyWitnessInCtx WitCtxTxIn -> Witness WitCtxTxIn era forall witctx era. KeyWitnessInCtx witctx -> Witness witctx era C.KeyWitness KeyWitnessInCtx WitCtxTxIn C.KeyWitnessForSpending -- This has been taken from the Test.Cardano.Api.Genesis example transaction here: -- https://github.com/input-output-hk/cardano-node/blob/543b267d75d3d448e1940f9ec04b42bd01bbb16b/cardano-api/test/Test/Cardano/Api/Genesis.hs#L60 - genesisKeyHash :: C.Hash C.GenesisUTxOKey - genesisKeyHash :: Hash GenesisUTxOKey -genesisKeyHash = + genesisKeyHash :: C.Hash C.GenesisUTxOKey + genesisKeyHash :: Hash GenesisUTxOKey +genesisKeyHash = KeyHash 'Payment StandardCrypto -> Hash GenesisUTxOKey C.GenesisUTxOKeyHash (KeyHash 'Payment StandardCrypto -> Hash GenesisUTxOKey) -> KeyHash 'Payment StandardCrypto -> Hash GenesisUTxOKey @@ -1226,60 +1226,60 @@ Hash (ADDRHASH StandardCrypto) (VerKeyDSIGN (DSIGN StandardCrypto)) "23d51e91ae5adc7ae801e9de4cd54175fb7464ec2680b25686bbb194" - initDist' :: [(Wallet, [Value])] -initDist' = Map Wallet [Value] -> [(Wallet, [Value])] + initDist' :: [(Wallet, [Value])] +initDist' = Map Wallet [Value] -> [(Wallet, [Value])] forall k a. Map k a -> [(k, a)] Map.toList (Map Wallet [Value] -> [(Wallet, [Value])]) -> Map Wallet [Value] -> [(Wallet, [Value])] forall a b. (a -> b) -> a -> b $ InitialDistribution -> Map Wallet [Value] unInitialDistribution InitialDistribution -initDist +initDist - initUtxosFor :: Wallet -> Value -> TxOut CtxTx BabbageEra -initUtxosFor Wallet -w Value -v = Address -> Value -> Maybe () -> TxOut CtxTx BabbageEra + initUtxosFor :: Wallet -> Value -> TxOut CtxTx BabbageEra +initUtxosFor Wallet +w Value +v = Address -> Value -> Maybe () -> TxOut CtxTx BabbageEra forall a. ToData a => Address -> Value -> Maybe a -> TxOut CtxTx BabbageEra -txOut (Wallet -> Address +txOut (Wallet -> Address walletAddress Wallet -w) Value -v (Maybe () +w) Value +v (Maybe () forall a. Maybe a Nothing @()) - fromRight' :: Show e => Either e a -> a - fromRight' :: Either e a -> a -fromRight' Either e a -x = case Either e a -x of - Left e -err -> String -> a + fromRight' :: Show e => Either e a -> a + fromRight' :: Either e a -> a +fromRight' Either e a +x = case Either e a +x of + Left e +err -> String -> a forall a. HasCallStack => String -> a error (String -> a) -> String -> a forall a b. (a -> b) -> a -> b $ e -> String forall a. Show a => a -> String show e -err - Right a -res -> a -res +err + Right a +res -> a +res - txOut :: Address -> Value -> Maybe a -> TxOut CtxTx BabbageEra -txOut Address -addr Value -value Maybe a -datum = Address -> Value -> OutputDatum -> TxOut CtxTx BabbageEra -toCardanoTxOut' Address -addr Value -value OutputDatum -datum' + txOut :: Address -> Value -> Maybe a -> TxOut CtxTx BabbageEra +txOut Address +addr Value +value Maybe a +datum = Address -> Value -> OutputDatum -> TxOut CtxTx BabbageEra +toCardanoTxOut' Address +addr Value +value OutputDatum +datum' where - datum' :: OutputDatum -datum' = + datum' :: OutputDatum +datum' = OutputDatum -> (a -> OutputDatum) -> Maybe a -> OutputDatum forall b a. b -> (a -> b) -> Maybe a -> b maybe @@ -1302,22 +1302,22 @@ Pl.toBuiltinData ) Maybe a -datum +datum - toCardanoTxOut' :: + toCardanoTxOut' :: Pl.Address -> Pl.Value -> PV2.OutputDatum -> C.TxOut C.CtxTx C.BabbageEra - toCardanoTxOut' :: Address -> Value -> OutputDatum -> TxOut CtxTx BabbageEra -toCardanoTxOut' Address -addr Value -value OutputDatum -datum = + toCardanoTxOut' :: Address -> Value -> OutputDatum -> TxOut CtxTx BabbageEra +toCardanoTxOut' Address +addr Value +value OutputDatum +datum = Either ToCardanoError (TxOut CtxTx BabbageEra) -> TxOut CtxTx BabbageEra forall e a. Show e => Either e a -> a -fromRight' (Either ToCardanoError (TxOut CtxTx BabbageEra) +fromRight' (Either ToCardanoError (TxOut CtxTx BabbageEra) -> TxOut CtxTx BabbageEra) -> Either ToCardanoError (TxOut CtxTx BabbageEra) -> TxOut CtxTx BabbageEra @@ -1327,18 +1327,18 @@ -> TxOut -> Either ToCardanoError (TxOut CtxTx BabbageEra) Ledger.toCardanoTxOut NetworkId -theNetworkId +theNetworkId (Address -> Value -> OutputDatum -> Maybe ScriptHash -> TxOut PV2.TxOut Address -addr Value -value OutputDatum -datum Maybe ScriptHash +addr Value +value OutputDatum +datum Maybe ScriptHash forall a. Maybe a Nothing) - theNetworkId :: C.NetworkId - theNetworkId :: NetworkId -theNetworkId = NetworkMagic -> NetworkId + theNetworkId :: C.NetworkId + theNetworkId :: NetworkId +theNetworkId = NetworkMagic -> NetworkId C.Testnet (NetworkMagic -> NetworkId) -> NetworkMagic -> NetworkId forall a b. (a -> b) -> a -> b $ Word32 -> NetworkMagic @@ -1368,11 +1368,11 @@ . ((TxIn, TxOut CtxUTxO BabbageEra) -> (TxOutRef, TxOut)) -> [(TxIn, TxOut CtxUTxO BabbageEra)] -> [(TxOutRef, TxOut)] forall a b. (a -> b) -> [a] -> [b] -map (\(TxIn -k, TxOut CtxUTxO BabbageEra -v) -> (TxIn -> TxOutRef +map (\(TxIn +k, TxOut CtxUTxO BabbageEra +v) -> (TxIn -> TxOutRef Ledger.fromCardanoTxIn TxIn -k, TxOut CtxTx BabbageEra -> TxOut +k, TxOut CtxTx BabbageEra -> TxOut Ledger.TxOut (TxOut CtxTx BabbageEra -> TxOut) -> (TxOut CtxUTxO BabbageEra -> TxOut CtxTx BabbageEra) -> TxOut CtxUTxO BabbageEra @@ -1380,11 +1380,11 @@ forall b c a. (b -> c) -> (a -> b) -> a -> c . TxOut CtxUTxO BabbageEra -> TxOut CtxTx BabbageEra forall era. TxOut CtxUTxO era -> TxOut CtxTx era -toCtxTxTxOut (TxOut CtxUTxO BabbageEra -> TxOut) +toCtxTxTxOut (TxOut CtxUTxO BabbageEra -> TxOut) -> TxOut CtxUTxO BabbageEra -> TxOut forall a b. (a -> b) -> a -> b $ TxOut CtxUTxO BabbageEra -v)) +v)) ([(TxIn, TxOut CtxUTxO BabbageEra)] -> [(TxOutRef, TxOut)]) -> (UtxoIndex -> [(TxIn, TxOut CtxUTxO BabbageEra)]) -> UtxoIndex @@ -1407,40 +1407,40 @@ -- We need to convert a UTxO context TxOut to a Transaction context Tx out. -- One could be forgiven for thinking this exists somewhere, but I couldn't find -- it. It's this complicated because the datum type is indexed by the context. - toCtxTxTxOut :: C.TxOut C.CtxUTxO era -> C.TxOut C.CtxTx era - toCtxTxTxOut :: TxOut CtxUTxO era -> TxOut CtxTx era -toCtxTxTxOut (C.TxOut AddressInEra era -addr TxOutValue era -val TxOutDatum CtxUTxO era -d ReferenceScript era -refS) = - let dat :: TxOutDatum CtxTx era -dat = case TxOutDatum CtxUTxO era -d of + toCtxTxTxOut :: C.TxOut C.CtxUTxO era -> C.TxOut C.CtxTx era + toCtxTxTxOut :: TxOut CtxUTxO era -> TxOut CtxTx era +toCtxTxTxOut (C.TxOut AddressInEra era +addr TxOutValue era +val TxOutDatum CtxUTxO era +d ReferenceScript era +refS) = + let dat :: TxOutDatum CtxTx era +dat = case TxOutDatum CtxUTxO era +d of TxOutDatum CtxUTxO era C.TxOutDatumNone -> TxOutDatum CtxTx era forall ctx era. TxOutDatum ctx era C.TxOutDatumNone - C.TxOutDatumHash ScriptDataSupportedInEra era -s Hash ScriptData -h -> ScriptDataSupportedInEra era + C.TxOutDatumHash ScriptDataSupportedInEra era +s Hash ScriptData +h -> ScriptDataSupportedInEra era -> Hash ScriptData -> TxOutDatum CtxTx era forall era ctx. ScriptDataSupportedInEra era -> Hash ScriptData -> TxOutDatum ctx era C.TxOutDatumHash ScriptDataSupportedInEra era -s Hash ScriptData -h - C.TxOutDatumInline ReferenceTxInsScriptsInlineDatumsSupportedInEra era -s ScriptData -sd -> ReferenceTxInsScriptsInlineDatumsSupportedInEra era +s Hash ScriptData +h + C.TxOutDatumInline ReferenceTxInsScriptsInlineDatumsSupportedInEra era +s ScriptData +sd -> ReferenceTxInsScriptsInlineDatumsSupportedInEra era -> ScriptData -> TxOutDatum CtxTx era forall era ctx. ReferenceTxInsScriptsInlineDatumsSupportedInEra era -> ScriptData -> TxOutDatum ctx era C.TxOutDatumInline ReferenceTxInsScriptsInlineDatumsSupportedInEra era -s ScriptData -sd +s ScriptData +sd in AddressInEra era -> TxOutValue era -> TxOutDatum CtxTx era @@ -1453,20 +1453,20 @@ -> ReferenceScript era -> TxOut ctx era C.TxOut AddressInEra era -addr TxOutValue era -val TxOutDatum CtxTx era -dat ReferenceScript era -refS +addr TxOutValue era +val TxOutDatum CtxTx era +dat ReferenceScript era +refS -instance Monad m => MonadBlockChainBalancing (MockChainT m) where - getParams :: MockChainT m Params +instance Monad m => MonadBlockChainBalancing (MockChainT m) where + getParams :: MockChainT m Params getParams = (MockChainEnv -> Params) -> MockChainT m Params forall r (m :: * -> *) a. MonadReader r m => (r -> a) -> m a asks MockChainEnv -> Params mceParams - validatorFromHash :: ValidatorHash -> MockChainT m (Maybe (Versioned Validator)) -validatorFromHash ValidatorHash -valHash = (MockChainSt -> Maybe (Versioned Validator)) + validatorFromHash :: ValidatorHash -> MockChainT m (Maybe (Versioned Validator)) +validatorFromHash ValidatorHash +valHash = (MockChainSt -> Maybe (Versioned Validator)) -> MockChainT m (Maybe (Versioned Validator)) forall s (m :: * -> *) a. MonadState s m => (s -> a) -> m a gets ((MockChainSt -> Maybe (Versioned Validator)) @@ -1479,7 +1479,7 @@ -> Maybe (Versioned Validator) forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup ValidatorHash -valHash (Map ValidatorHash (Versioned Validator) +valHash (Map ValidatorHash (Versioned Validator) -> Maybe (Versioned Validator)) -> (MockChainSt -> Map ValidatorHash (Versioned Validator)) -> MockChainSt @@ -1487,9 +1487,9 @@ forall b c a. (b -> c) -> (a -> b) -> a -> c . MockChainSt -> Map ValidatorHash (Versioned Validator) mcstValidators - txOutByRefLedger :: TxOutRef -> MockChainT m (Maybe TxOut) -txOutByRefLedger TxOutRef -outref = (MockChainSt -> Maybe TxOut) -> MockChainT m (Maybe TxOut) + txOutByRefLedger :: TxOutRef -> MockChainT m (Maybe TxOut) +txOutByRefLedger TxOutRef +outref = (MockChainSt -> Maybe TxOut) -> MockChainT m (Maybe TxOut) forall s (m :: * -> *) a. MonadState s m => (s -> a) -> m a gets ((MockChainSt -> Maybe TxOut) -> MockChainT m (Maybe TxOut)) -> (MockChainSt -> Maybe TxOut) -> MockChainT m (Maybe TxOut) @@ -1497,7 +1497,7 @@ $ TxOutRef -> Map TxOutRef TxOut -> Maybe TxOut forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup TxOutRef -outref (Map TxOutRef TxOut -> Maybe TxOut) +outref (Map TxOutRef TxOut -> Maybe TxOut) -> (MockChainSt -> Map TxOutRef TxOut) -> MockChainSt -> Maybe TxOut @@ -1508,9 +1508,9 @@ forall b c a. (b -> c) -> (a -> b) -> a -> c . MockChainSt -> UtxoIndex mcstIndex - datumFromHash :: DatumHash -> MockChainT m (Maybe Datum) -datumFromHash DatumHash -datumHash = (TxSkelOutDatum -> Maybe Datum + datumFromHash :: DatumHash -> MockChainT m (Maybe Datum) +datumFromHash DatumHash +datumHash = (TxSkelOutDatum -> Maybe Datum txSkelOutUntypedDatum (TxSkelOutDatum -> Maybe Datum) -> (Map DatumHash (TxSkelOutDatum, Integer) -> Maybe TxSkelOutDatum) @@ -1541,7 +1541,7 @@ -> Maybe (TxSkelOutDatum, Integer) forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup DatumHash -datumHash) (Map DatumHash (TxSkelOutDatum, Integer) -> Maybe Datum) +datumHash) (Map DatumHash (TxSkelOutDatum, Integer) -> Maybe Datum) -> MockChainT m (Map DatumHash (TxSkelOutDatum, Integer)) -> MockChainT m (Maybe Datum) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b @@ -1550,13 +1550,13 @@ forall s (m :: * -> *) a. MonadState s m => (s -> a) -> m a gets MockChainSt -> Map DatumHash (TxSkelOutDatum, Integer) mcstDatums - utxosAtLedger :: Address -> MockChainT m [(TxOutRef, TxOut)] -utxosAtLedger Address -addr = ((TxOutRef, TxOut) -> Bool) + utxosAtLedger :: Address -> MockChainT m [(TxOutRef, TxOut)] +utxosAtLedger Address +addr = ((TxOutRef, TxOut) -> Bool) -> [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)] forall a. (a -> Bool) -> [a] -> [a] filter ((Address -addr Address -> Address -> Bool +addr Address -> Address -> Bool forall a. Eq a => a -> a -> Bool ==) (Address -> Bool) -> ((TxOutRef, TxOut) -> Address) -> (TxOutRef, TxOut) -> Bool @@ -1584,9 +1584,9 @@ m [(TxOutRef, TxOut)] allUtxosLedger -instance Monad m => MonadBlockChainWithoutValidation (MockChainT m) where - allUtxosLedger :: MockChainT m [(TxOutRef, TxOut)] -allUtxosLedger = (MockChainSt -> [(TxOutRef, TxOut)]) +instance Monad m => MonadBlockChainWithoutValidation (MockChainT m) where + allUtxosLedger :: MockChainT m [(TxOutRef, TxOut)] +allUtxosLedger = (MockChainSt -> [(TxOutRef, TxOut)]) -> MockChainT m [(TxOutRef, TxOut)] forall s (m :: * -> *) a. MonadState s m => (s -> a) -> m a gets ((MockChainSt -> [(TxOutRef, TxOut)]) @@ -1608,61 +1608,61 @@ . MockChainSt -> UtxoIndex mcstIndex - currentSlot :: MockChainT m Slot + currentSlot :: MockChainT m Slot currentSlot = (MockChainSt -> Slot) -> MockChainT m Slot forall s (m :: * -> *) a. MonadState s m => (s -> a) -> m a gets MockChainSt -> Slot mcstCurrentSlot - awaitSlot :: Slot -> MockChainT m Slot -awaitSlot Slot -s = (MockChainSt -> MockChainSt) -> MockChainT m () + awaitSlot :: Slot -> MockChainT m Slot +awaitSlot Slot +s = (MockChainSt -> MockChainSt) -> MockChainT m () forall s (m :: * -> *). MonadState s m => (s -> s) -> m () -modify' (\MockChainSt -st -> MockChainSt -st {mcstCurrentSlot :: Slot +modify' (\MockChainSt +st -> MockChainSt +st {mcstCurrentSlot :: Slot mcstCurrentSlot = Slot -> Slot -> Slot forall a. Ord a => a -> a -> a max Slot -s (MockChainSt -> Slot +s (MockChainSt -> Slot mcstCurrentSlot MockChainSt -st)}) MockChainT m () -> MockChainT m Slot -> MockChainT m Slot +st)}) MockChainT m () -> MockChainT m Slot -> MockChainT m Slot forall (m :: * -> *) a b. Monad m => m a -> m b -> m b >> MockChainT m Slot forall (m :: * -> *). MonadBlockChainWithoutValidation m => m Slot currentSlot -instance Monad m => MonadBlockChain (MockChainT m) where - validateTxSkel :: TxSkel -> MockChainT m CardanoTx -validateTxSkel TxSkel -skelUnbal = do - (TxSkel -skel, Fee -fee, Set TxOutRef -collateralInputs) <- TxSkel -> MockChainT m (TxSkel, Fee, Set TxOutRef) +instance Monad m => MonadBlockChain (MockChainT m) where + validateTxSkel :: TxSkel -> MockChainT m CardanoTx +validateTxSkel TxSkel +skelUnbal = do + (TxSkel +skel, Fee +fee, Set TxOutRef +collateralInputs) <- TxSkel -> MockChainT m (TxSkel, Fee, Set TxOutRef) forall (m :: * -> *). MonadBlockChainBalancing m => TxSkel -> m (TxSkel, Fee, Set TxOutRef) balancedTxSkel TxSkel -skelUnbal - Tx BabbageEra -tx <- (TxSkel, Fee, Set TxOutRef) -> MockChainT m (Tx BabbageEra) +skelUnbal + Tx BabbageEra +tx <- (TxSkel, Fee, Set TxOutRef) -> MockChainT m (Tx BabbageEra) forall (m :: * -> *). MonadBlockChainBalancing m => (TxSkel, Fee, Set TxOutRef) -> m (Tx BabbageEra) balancedTx (TxSkel -skel, Fee -fee, Set TxOutRef -collateralInputs) - Map DatumHash Datum -consumedData <- TxSkel -> MockChainT m (Map DatumHash Datum) +skel, Fee +fee, Set TxOutRef +collateralInputs) + Map DatumHash Datum +consumedData <- TxSkel -> MockChainT m (Map DatumHash Datum) forall (m :: * -> *). MonadBlockChainBalancing m => TxSkel -> m (Map DatumHash Datum) txSkelInputData TxSkel -skel - Params -theParams <- Maybe EmulatorParamsModification -> Params -> Params +skel + Params +theParams <- Maybe EmulatorParamsModification -> Params -> Params applyEmulatorParamsModification (TxOpts -> Maybe EmulatorParamsModification txOptEmulatorParamsModification (TxOpts -> Maybe EmulatorParamsModification) -> (TxSkel -> TxOpts) -> TxSkel -> Maybe EmulatorParamsModification @@ -1672,13 +1672,13 @@ -> TxSkel -> Maybe EmulatorParamsModification forall a b. (a -> b) -> a -> b $ TxSkel -skel) (Params -> Params) -> MockChainT m Params -> MockChainT m Params +skel) (Params -> Params) -> MockChainT m Params -> MockChainT m Params forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> MockChainT m Params forall (m :: * -> *). MonadBlockChainBalancing m => m Params getParams - CardanoTx -someCardanoTx <- + CardanoTx +someCardanoTx <- Params -> Tx BabbageEra -> [RawModTx] @@ -1697,29 +1697,29 @@ -> MockChainT m CardanoTx runTransactionValidation Params -theParams +theParams Tx BabbageEra -tx +tx (TxOpts -> [RawModTx] txOptUnsafeModTx (TxOpts -> [RawModTx]) -> TxOpts -> [RawModTx] forall a b. (a -> b) -> a -> b $ TxSkel -> TxOpts txSkelOpts TxSkel -skel) +skel) Map DatumHash Datum -consumedData +consumedData (TxSkel -> Map DatumHash TxSkelOutDatum txSkelOutputData TxSkel -skel) +skel) (TxSkel -> Map ValidatorHash (Versioned Validator) txSkelOutValidators TxSkel -skel Map ValidatorHash (Versioned Validator) +skel Map ValidatorHash (Versioned Validator) -> Map ValidatorHash (Versioned Validator) -> Map ValidatorHash (Versioned Validator) forall a. Semigroup a => a -> a -> a <> TxSkel -> Map ValidatorHash (Versioned Validator) txSkelOutReferenceScripts TxSkel -skel) +skel) Bool -> MockChainT m () -> MockChainT m () forall (f :: * -> *). Applicative f => Bool -> f () -> f () when (TxOpts -> Bool @@ -1727,28 +1727,28 @@ forall a b. (a -> b) -> a -> b $ TxSkel -> TxOpts txSkelOpts TxSkel -skel) (MockChainT m () -> MockChainT m ()) +skel) (MockChainT m () -> MockChainT m ()) -> MockChainT m () -> MockChainT m () forall a b. (a -> b) -> a -> b $ (MockChainSt -> MockChainSt) -> MockChainT m () forall s (m :: * -> *). MonadState s m => (s -> s) -> m () -modify' (\MockChainSt -st -> MockChainSt -st {mcstCurrentSlot :: Slot +modify' (\MockChainSt +st -> MockChainSt +st {mcstCurrentSlot :: Slot mcstCurrentSlot = MockChainSt -> Slot mcstCurrentSlot MockChainSt -st Slot -> Slot -> Slot +st Slot -> Slot -> Slot forall a. Num a => a -> a -> a + Slot 1}) CardanoTx -> MockChainT m CardanoTx forall (m :: * -> *) a. Monad m => a -> m a return CardanoTx -someCardanoTx +someCardanoTx -runTransactionValidation :: - Monad m => +runTransactionValidation :: + Monad m => -- | The emulator parameters to use. They might have been changed by the 'txOptEmulatorParamsModification'. Emulator.Params -> -- | The transaction to validate. It should already be balanced, and include @@ -1764,7 +1764,7 @@ -- reference script field of transaction outputs. The 'MockChain' will -- remember them. Map Pl.ValidatorHash (Pl.Versioned Pl.Validator) -> - MockChainT m Ledger.CardanoTx + MockChainT m Ledger.CardanoTx runTransactionValidation :: Params -> Tx BabbageEra -> [RawModTx] @@ -1772,58 +1772,58 @@ -> Map DatumHash TxSkelOutDatum -> Map ValidatorHash (Versioned Validator) -> MockChainT m CardanoTx -runTransactionValidation Params -theParams Tx BabbageEra -cardanoTx [RawModTx] -rawModTx Map DatumHash Datum -consumedData Map DatumHash TxSkelOutDatum -producedData Map ValidatorHash (Versioned Validator) -outputValidators = do - UtxoIndex -utxoIndex <- (MockChainSt -> UtxoIndex) -> MockChainT m UtxoIndex +runTransactionValidation Params +theParams Tx BabbageEra +cardanoTx [RawModTx] +rawModTx Map DatumHash Datum +consumedData Map DatumHash TxSkelOutDatum +producedData Map ValidatorHash (Versioned Validator) +outputValidators = do + UtxoIndex +utxoIndex <- (MockChainSt -> UtxoIndex) -> MockChainT m UtxoIndex forall s (m :: * -> *) a. MonadState s m => (s -> a) -> m a gets MockChainSt -> UtxoIndex mcstIndex - Slot -theSlot <- MockChainT m Slot + Slot +theSlot <- MockChainT m Slot forall (m :: * -> *). MonadBlockChainWithoutValidation m => m Slot currentSlot - let cardanoIndex :: CardanoLedger.UTxO Emulator.EmulatorEra - cardanoIndex :: UTxO EmulatorEra -cardanoIndex = UtxoIndex -> UTxO EmulatorEra + let cardanoIndex :: CardanoLedger.UTxO Emulator.EmulatorEra + cardanoIndex :: UTxO EmulatorEra +cardanoIndex = UtxoIndex -> UTxO EmulatorEra Ledger.fromPlutusIndex UtxoIndex -utxoIndex +utxoIndex -- "Ledger.CardanoTx" is a plutus-apps type 'Tx BabbageEra' is a -- cardano-api type with the information we need. This wraps the latter -- inside the former. - txWrapped :: Ledger.CardanoTx - txWrapped :: CardanoTx -txWrapped = Tx BabbageEra -> CardanoTx + txWrapped :: Ledger.CardanoTx + txWrapped :: CardanoTx +txWrapped = Tx BabbageEra -> CardanoTx Ledger.CardanoEmulatorEraTx Tx BabbageEra -cardanoTx +cardanoTx - mValidationError :: Either Ledger.ValidationErrorInPhase Ledger.ValidationSuccess - mValidationError :: Either ValidationErrorInPhase ValidationSuccess -mValidationError = Params + mValidationError :: Either Ledger.ValidationErrorInPhase Ledger.ValidationSuccess + mValidationError :: Either ValidationErrorInPhase ValidationSuccess +mValidationError = Params -> Slot -> UTxO EmulatorEra -> CardanoTx -> Either ValidationErrorInPhase ValidationSuccess Emulator.validateCardanoTx Params -theParams Slot -theSlot UTxO EmulatorEra -cardanoIndex CardanoTx -txWrapped +theParams Slot +theSlot UTxO EmulatorEra +cardanoIndex CardanoTx +txWrapped - newUtxoIndex :: Ledger.UtxoIndex - newUtxoIndex :: UtxoIndex -newUtxoIndex = case Either ValidationErrorInPhase ValidationSuccess -mValidationError of + newUtxoIndex :: Ledger.UtxoIndex + newUtxoIndex :: UtxoIndex +newUtxoIndex = case Either ValidationErrorInPhase ValidationSuccess +mValidationError of Left (ValidationPhase Ledger.Phase1, ValidationError _) -> UtxoIndex -utxoIndex +utxoIndex Left (ValidationPhase Ledger.Phase2, ValidationError _) -> @@ -1831,21 +1831,21 @@ -- the index CardanoTx -> UtxoIndex -> UtxoIndex Ledger.insertCollateral CardanoTx -txWrapped UtxoIndex -utxoIndex +txWrapped UtxoIndex +utxoIndex Right ValidationSuccess _ -> CardanoTx -> UtxoIndex -> UtxoIndex Ledger.insert CardanoTx -txWrapped UtxoIndex -utxoIndex +txWrapped UtxoIndex +utxoIndex case Either ValidationErrorInPhase ValidationSuccess -mValidationError of - Left ValidationErrorInPhase -err -> MockChainError -> MockChainT m CardanoTx +mValidationError of + Left ValidationErrorInPhase +err -> MockChainError -> MockChainT m CardanoTx forall e (m :: * -> *) a. MonadError e m => e -> m a throwError (ValidationErrorInPhase -> MockChainError MCEValidationError ValidationErrorInPhase -err) +err) Right ValidationSuccess _ -> do -- Validation succeeded; now we update the UTxO index, the managed @@ -1856,71 +1856,71 @@ (MockChainSt -> MockChainSt) -> MockChainT m () forall s (m :: * -> *). MonadState s m => (s -> s) -> m () modify' - ( \MockChainSt -st -> + ( \MockChainSt +st -> MockChainSt -st +st { mcstIndex :: UtxoIndex mcstIndex = UtxoIndex -newUtxoIndex, +newUtxoIndex, mcstDatums :: Map DatumHash (TxSkelOutDatum, Integer) mcstDatums = (MockChainSt -> Map DatumHash (TxSkelOutDatum, Integer) mcstDatums MockChainSt -st Map DatumHash (TxSkelOutDatum, Integer) +st Map DatumHash (TxSkelOutDatum, Integer) -> Map DatumHash Datum -> Map DatumHash (TxSkelOutDatum, Integer) forall a b. Map DatumHash (a, Integer) -> Map DatumHash b -> Map DatumHash (a, Integer) -`removeMcstDatums` Map DatumHash Datum -consumedData) Map DatumHash (TxSkelOutDatum, Integer) +`removeMcstDatums` Map DatumHash Datum +consumedData) Map DatumHash (TxSkelOutDatum, Integer) -> Map DatumHash TxSkelOutDatum -> Map DatumHash (TxSkelOutDatum, Integer) forall k a a. (Ord k, Num a) => Map k (a, a) -> Map k a -> Map k (a, a) -`addMcstDatums` Map DatumHash TxSkelOutDatum -producedData, +`addMcstDatums` Map DatumHash TxSkelOutDatum +producedData, mcstValidators :: Map ValidatorHash (Versioned Validator) mcstValidators = MockChainSt -> Map ValidatorHash (Versioned Validator) mcstValidators MockChainSt -st Map ValidatorHash (Versioned Validator) +st Map ValidatorHash (Versioned Validator) -> Map ValidatorHash (Versioned Validator) -> Map ValidatorHash (Versioned Validator) forall k a. Ord k => Map k a -> Map k a -> Map k a `Map.union` Map ValidatorHash (Versioned Validator) -outputValidators +outputValidators } ) CardanoTx -> MockChainT m CardanoTx forall (m :: * -> *) a. Monad m => a -> m a return (Tx BabbageEra -> CardanoTx Ledger.CardanoEmulatorEraTx Tx BabbageEra -cardanoTx) +cardanoTx) where - addMcstDatums :: Map k (a, a) -> Map k a -> Map k (a, a) -addMcstDatums Map k (a, a) -stored Map k a -new = ((a, a) -> (a, a) -> (a, a)) + addMcstDatums :: Map k (a, a) -> Map k a -> Map k (a, a) +addMcstDatums Map k (a, a) +stored Map k a +new = ((a, a) -> (a, a) -> (a, a)) -> Map k (a, a) -> Map k (a, a) -> Map k (a, a) forall k a. Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a -Map.unionWith (\(a -d, a -n1) (a -_, a -n2) -> (a -d, a -n1 a -> a -> a +Map.unionWith (\(a +d, a +n1) (a +_, a +n2) -> (a +d, a +n1 a -> a -> a forall a. Num a => a -> a -> a + a -n2)) Map k (a, a) -stored ((a -> (a, a)) -> Map k a -> Map k (a, a) +n2)) Map k (a, a) +stored ((a -> (a, a)) -> Map k a -> Map k (a, a) forall a b k. (a -> b) -> Map k a -> Map k b Map.map (,a 1) Map k a -new) - removeMcstDatums :: Map DatumHash (a, Integer) +new) + removeMcstDatums :: Map DatumHash (a, Integer) -> Map DatumHash b -> Map DatumHash (a, Integer) -removeMcstDatums = ((a, Integer) -> b -> Maybe (a, Integer)) +removeMcstDatums = ((a, Integer) -> b -> Maybe (a, Integer)) -> Map DatumHash (a, Integer) -> Map DatumHash b -> Map DatumHash (a, Integer) @@ -1936,11 +1936,11 @@ -> Map DatumHash b -> Map DatumHash (a, Integer) forall a b. (a -> b) -> a -> b -$ \(a -d, Integer -n) b +$ \(a +d, Integer +n) b _ -> if Integer -n Integer -> Integer -> Bool +n Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 1 then Maybe (a, Integer) @@ -1948,8 +1948,8 @@ Nothing else (a, Integer) -> Maybe (a, Integer) forall a. a -> Maybe a Just (a -d, Integer -n Integer -> Integer -> Integer +d, Integer +n Integer -> Integer -> Integer forall a. Num a => a -> a -> a - Integer 1) diff --git a/src/Cooked.MockChain.GenerateTx.html b/src/Cooked.MockChain.GenerateTx.html index 69c707ee1..dd346b0d6 100644 --- a/src/Cooked.MockChain.GenerateTx.html +++ b/src/Cooked.MockChain.GenerateTx.html @@ -43,7 +43,7 @@ = ToCardanoError String Pl.ToCardanoError | TxBodyError String C.TxBodyError | GenerateTxErrorGeneral String - deriving (Int -> GenerateTxError -> ShowS + deriving (Int -> GenerateTxError -> ShowS [GenerateTxError] -> ShowS GenerateTxError -> String (Int -> GenerateTxError -> ShowS) @@ -58,7 +58,7 @@ $cshow :: GenerateTxError -> String showsPrec :: Int -> GenerateTxError -> ShowS $cshowsPrec :: Int -> GenerateTxError -> ShowS -Show, GenerateTxError -> GenerateTxError -> Bool +Show, GenerateTxError -> GenerateTxError -> Bool (GenerateTxError -> GenerateTxError -> Bool) -> (GenerateTxError -> GenerateTxError -> Bool) -> Eq GenerateTxError @@ -84,7 +84,7 @@ } instance Default GenTxParams where - def :: GenTxParams + def :: GenTxParams def = GenTxParams :: Set TxOutRef -> Fee -> GenTxParams GenTxParams {gtpCollateralIns :: Set TxOutRef gtpCollateralIns = Set TxOutRef @@ -116,20 +116,20 @@ -> Map ValidatorHash (Versioned Validator) -> TxSkel -> Either GenerateTxError (TxBodyContent BuildTx BabbageEra) -generateTxBodyContent GenTxParams {Set TxOutRef +generateTxBodyContent GenTxParams {Set TxOutRef Fee gtpFee :: Fee gtpCollateralIns :: Set TxOutRef gtpFee :: GenTxParams -> Fee gtpCollateralIns :: GenTxParams -> Set TxOutRef -..} Params -theParams Map DatumHash Datum -managedData Map TxOutRef TxOut -managedTxOuts Map ValidatorHash (Versioned Validator) -managedValidators TxSkel -skel = do - [(TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn BabbageEra))] -txIns <- ((TxOutRef, TxSkelRedeemer) +..} Params +theParams Map DatumHash Datum +managedData Map TxOutRef TxOut +managedTxOuts Map ValidatorHash (Versioned Validator) +managedValidators TxSkel +skel = do + [(TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn BabbageEra))] +txIns <- ((TxOutRef, TxSkelRedeemer) -> Either GenerateTxError (TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn BabbageEra))) @@ -144,7 +144,7 @@ -> Either GenerateTxError (TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn BabbageEra)) -txSkelInToTxIn ([(TxOutRef, TxSkelRedeemer)] +txSkelInToTxIn ([(TxOutRef, TxSkelRedeemer)] -> Either GenerateTxError [(TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn BabbageEra))]) @@ -157,12 +157,12 @@ forall k a. Map k a -> [(k, a)] Map.toList (TxSkel -> Map TxOutRef TxSkelRedeemer txSkelIns TxSkel -skel) - TxInsReference BuildTx BabbageEra -txInsReference <- +skel) + TxInsReference BuildTx BabbageEra +txInsReference <- [TxOutRef] -> Either GenerateTxError (TxInsReference BuildTx BabbageEra) -txOutRefsToTxInsReference ([TxOutRef] +txOutRefsToTxInsReference ([TxOutRef] -> Either GenerateTxError (TxInsReference BuildTx BabbageEra)) -> [TxOutRef] -> Either GenerateTxError (TxInsReference BuildTx BabbageEra) @@ -173,12 +173,12 @@ forall a b. (a -> Maybe b) -> [a] -> [b] Maybe.mapMaybe ( \case - TxSkelRedeemerForReferencedScript TxOutRef -oref redeemer + TxSkelRedeemerForReferencedScript TxOutRef +oref redeemer _ -> TxOutRef -> Maybe TxOutRef forall a. a -> Maybe a Just TxOutRef -oref +oref TxSkelRedeemer _ -> Maybe TxOutRef forall a. Maybe a @@ -191,26 +191,26 @@ forall a b. (a -> b) -> a -> b $ TxSkel -> Map TxOutRef TxSkelRedeemer txSkelIns TxSkel -skel) +skel) [TxOutRef] -> [TxOutRef] -> [TxOutRef] forall a. [a] -> [a] -> [a] ++ Set TxOutRef -> [TxOutRef] forall a. Set a -> [a] Set.toList (TxSkel -> Set TxOutRef txSkelInsReference TxSkel -skel) - TxInsCollateral BabbageEra -txInsCollateral <- [TxOutRef] -> Either GenerateTxError (TxInsCollateral BabbageEra) -txOutRefsToTxSkelInsCollateral ([TxOutRef] -> Either GenerateTxError (TxInsCollateral BabbageEra)) +skel) + TxInsCollateral BabbageEra +txInsCollateral <- [TxOutRef] -> Either GenerateTxError (TxInsCollateral BabbageEra) +txOutRefsToTxSkelInsCollateral ([TxOutRef] -> Either GenerateTxError (TxInsCollateral BabbageEra)) -> [TxOutRef] -> Either GenerateTxError (TxInsCollateral BabbageEra) forall a b. (a -> b) -> a -> b $ Set TxOutRef -> [TxOutRef] forall a. Set a -> [a] Set.toList Set TxOutRef -gtpCollateralIns - [TxOut CtxTx BabbageEra] -txOuts <- (TxSkelOut -> Either GenerateTxError (TxOut CtxTx BabbageEra)) +gtpCollateralIns + [TxOut CtxTx BabbageEra] +txOuts <- (TxSkelOut -> Either GenerateTxError (TxOut CtxTx BabbageEra)) -> [TxSkelOut] -> Either GenerateTxError [TxOut CtxTx BabbageEra] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => @@ -218,14 +218,14 @@ mapM (Params -> TxSkelOut -> Either GenerateTxError (TxOut CtxTx BabbageEra) txSkelOutToCardanoTxOut Params -theParams) ([TxSkelOut] -> Either GenerateTxError [TxOut CtxTx BabbageEra]) +theParams) ([TxSkelOut] -> Either GenerateTxError [TxOut CtxTx BabbageEra]) -> [TxSkelOut] -> Either GenerateTxError [TxOut CtxTx BabbageEra] forall a b. (a -> b) -> a -> b $ TxSkel -> [TxSkelOut] txSkelOuts TxSkel -skel - (TxValidityLowerBound BabbageEra, TxValidityUpperBound BabbageEra) -txValidityRange <- +skel + (TxValidityLowerBound BabbageEra, TxValidityUpperBound BabbageEra) +txValidityRange <- (ToCardanoError -> GenerateTxError) -> Either ToCardanoError @@ -271,28 +271,28 @@ forall a b. (a -> b) -> a -> b $ TxSkel -> SlotRange txSkelValidityRange TxSkel -skel - TxMintValue BuildTx BabbageEra -txMintValue <- TxSkelMints +skel + TxMintValue BuildTx BabbageEra +txMintValue <- TxSkelMints -> Either GenerateTxError (TxMintValue BuildTx BabbageEra) -txSkelMintsToTxMintValue (TxSkelMints +txSkelMintsToTxMintValue (TxSkelMints -> Either GenerateTxError (TxMintValue BuildTx BabbageEra)) -> TxSkelMints -> Either GenerateTxError (TxMintValue BuildTx BabbageEra) forall a b. (a -> b) -> a -> b $ TxSkel -> TxSkelMints txSkelMints TxSkel -skel - TxExtraKeyWitnesses BabbageEra -txExtraKeyWits <- - let signers :: [Wallet] -signers = TxSkel -> [Wallet] +skel + TxExtraKeyWitnesses BabbageEra +txExtraKeyWits <- + let signers :: [Wallet] +signers = TxSkel -> [Wallet] txSkelSigners TxSkel -skel +skel in if [Wallet] -> Bool forall (t :: * -> *) a. Foldable t => t a -> Bool null [Wallet] -signers +signers then GenerateTxError -> Either GenerateTxError (TxExtraKeyWitnesses BabbageEra) forall a b. a -> Either a b @@ -347,9 +347,9 @@ . Wallet -> PubKeyHash walletPKHash) [Wallet] -signers - TxTotalCollateral BabbageEra -txTotalCollateral <- +signers + TxTotalCollateral BabbageEra +txTotalCollateral <- ([Value] -> TxTotalCollateral BabbageEra) -> Either GenerateTxError [Value] -> Either GenerateTxError (TxTotalCollateral BabbageEra) @@ -398,16 +398,16 @@ (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM - ( \TxOutRef -txOutRef -> do + ( \TxOutRef +txOutRef -> do Pl.TxOut Address -_ Value -outValue OutputDatum +_ Value +outValue OutputDatum _ Maybe ScriptHash _ <- GenerateTxError -> Maybe TxOut -> Either GenerateTxError TxOut forall e a. e -> Maybe a -> Either e a -throwOnNothing +throwOnNothing (String -> GenerateTxError GenerateTxErrorGeneral (String -> GenerateTxError) -> String -> GenerateTxError forall a b. (a -> b) -> a -> b @@ -417,16 +417,16 @@ ++ TxOutRef -> String forall a. Show a => a -> String show TxOutRef -txOutRef) +txOutRef) (TxOutRef -> Map TxOutRef TxOut -> Maybe TxOut forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup TxOutRef -txOutRef Map TxOutRef TxOut -managedTxOuts) +txOutRef Map TxOutRef TxOut +managedTxOuts) Value -> Either GenerateTxError Value forall a b. b -> Either a b Right Value -outValue +outValue ) ([TxOutRef] -> Either GenerateTxError [Value]) -> [TxOutRef] -> Either GenerateTxError [Value] @@ -434,7 +434,7 @@ $ Set TxOutRef -> [TxOutRef] forall a. Set a -> [a] Set.toList Set TxOutRef -gtpCollateralIns +gtpCollateralIns ) TxBodyContent BuildTx BabbageEra -> Either GenerateTxError (TxBodyContent BuildTx BabbageEra) @@ -467,19 +467,19 @@ C.TxBodyContent { txIns :: [(TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn BabbageEra))] C.txIns = [(TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn BabbageEra))] -txIns, +txIns, txInsCollateral :: TxInsCollateral BabbageEra C.txInsCollateral = TxInsCollateral BabbageEra -txInsCollateral, +txInsCollateral, txInsReference :: TxInsReference BuildTx BabbageEra C.txInsReference = TxInsReference BuildTx BabbageEra -txInsReference, +txInsReference, txOuts :: [TxOut CtxTx BabbageEra] C.txOuts = [TxOut CtxTx BabbageEra] -txOuts, +txOuts, txTotalCollateral :: TxTotalCollateral BabbageEra C.txTotalCollateral = TxTotalCollateral BabbageEra -txTotalCollateral, +txTotalCollateral, -- WARN For now we are not dealing with return collateral txReturnCollateral :: TxReturnCollateral CtxTx BabbageEra C.txReturnCollateral = TxReturnCollateral CtxTx BabbageEra @@ -496,10 +496,10 @@ forall a b. (a -> b) -> a -> b $ Fee -> Integer feeLovelace Fee -gtpFee, +gtpFee, txValidityRange :: (TxValidityLowerBound BabbageEra, TxValidityUpperBound BabbageEra) C.txValidityRange = (TxValidityLowerBound BabbageEra, TxValidityUpperBound BabbageEra) -txValidityRange, +txValidityRange, txMetadata :: TxMetadataInEra BabbageEra C.txMetadata = TxMetadataInEra BabbageEra forall era. TxMetadataInEra era @@ -509,10 +509,10 @@ forall era. TxAuxScripts era C.TxAuxScriptsNone, -- That's what plutus-apps does as well txExtraKeyWits :: TxExtraKeyWitnesses BabbageEra -C.txExtraKeyWits = TxExtraKeyWitnesses BabbageEra -txExtraKeyWits, +C.txExtraKeyWits = TxExtraKeyWitnesses BabbageEra +txExtraKeyWits, txProtocolParams :: BuildTxWith BuildTx (Maybe ProtocolParameters) -C.txProtocolParams = Maybe ProtocolParameters +C.txProtocolParams = Maybe ProtocolParameters -> BuildTxWith BuildTx (Maybe ProtocolParameters) forall a. a -> BuildTxWith BuildTx a C.BuildTxWith (Maybe ProtocolParameters @@ -533,38 +533,38 @@ -> Params -> BuildTxWith BuildTx (Maybe ProtocolParameters) forall a b. (a -> b) -> a -> b $ Params -theParams, -- That's what plutus-apps does as well +theParams, -- That's what plutus-apps does as well txWithdrawals :: TxWithdrawals BuildTx BabbageEra -C.txWithdrawals = TxWithdrawals BuildTx BabbageEra +C.txWithdrawals = TxWithdrawals BuildTx BabbageEra forall build era. TxWithdrawals build era C.TxWithdrawalsNone, -- That's what plutus-apps does as well txCertificates :: TxCertificates BuildTx BabbageEra -C.txCertificates = TxCertificates BuildTx BabbageEra +C.txCertificates = TxCertificates BuildTx BabbageEra forall build era. TxCertificates build era C.TxCertificatesNone, -- That's what plutus-apps does as well txUpdateProposal :: TxUpdateProposal BabbageEra -C.txUpdateProposal = TxUpdateProposal BabbageEra +C.txUpdateProposal = TxUpdateProposal BabbageEra forall era. TxUpdateProposal era C.TxUpdateProposalNone, -- That's what plutus-apps does as well txMintValue :: TxMintValue BuildTx BabbageEra -C.txMintValue = TxMintValue BuildTx BabbageEra -txMintValue, +C.txMintValue = TxMintValue BuildTx BabbageEra +txMintValue, txScriptValidity :: TxScriptValidity BabbageEra -C.txScriptValidity = TxScriptValidity BabbageEra +C.txScriptValidity = TxScriptValidity BabbageEra forall era. TxScriptValidity era C.TxScriptValidityNone -- That's what plutus-apps does as well } where -- Helper function to throw errors. - throwOnNothing :: e -> Maybe a -> Either e a - throwOnNothing :: e -> Maybe a -> Either e a -throwOnNothing e -err = Either e a -> (a -> Either e a) -> Maybe a -> Either e a + throwOnNothing :: e -> Maybe a -> Either e a + throwOnNothing :: e -> Maybe a -> Either e a +throwOnNothing e +err = Either e a -> (a -> Either e a) -> Maybe a -> Either e a forall b a. b -> (a -> b) -> Maybe a -> b maybe (e -> Either e a forall a b. a -> Either a b Left e -err) a -> Either e a +err) a -> Either e a forall a b. b -> Either a b Right @@ -572,7 +572,7 @@ -- 'TxSkelIn', into a 'C.TxIn', together with the appropriate witness. If -- you add reference inputs, don't forget to also update the -- 'txInsReference'! - txSkelInToTxIn :: + txSkelInToTxIn :: (Pl.TxOutRef, TxSkelRedeemer) -> Either GenerateTxError @@ -581,18 +581,18 @@ C.BuildTx (C.Witness C.WitCtxTxIn C.BabbageEra) ) - txSkelInToTxIn :: (TxOutRef, TxSkelRedeemer) + txSkelInToTxIn :: (TxOutRef, TxSkelRedeemer) -> Either GenerateTxError (TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn BabbageEra)) -txSkelInToTxIn (TxOutRef -txOutRef, TxSkelRedeemer -txSkelRedeemer) = do - Witness WitCtxTxIn BabbageEra -witness <- TxSkelRedeemer +txSkelInToTxIn (TxOutRef +txOutRef, TxSkelRedeemer +txSkelRedeemer) = do + Witness WitCtxTxIn BabbageEra +witness <- TxSkelRedeemer -> Either GenerateTxError (Witness WitCtxTxIn BabbageEra) -mkWitness TxSkelRedeemer -txSkelRedeemer +mkWitness TxSkelRedeemer +txSkelRedeemer (ToCardanoError -> GenerateTxError) -> (TxIn -> (TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn BabbageEra))) @@ -611,7 +611,7 @@ -> BuildTxWith BuildTx (Witness WitCtxTxIn BabbageEra) forall a. a -> BuildTxWith BuildTx a C.BuildTxWith Witness WitCtxTxIn BabbageEra -witness) +witness) (Either ToCardanoError TxIn -> Either GenerateTxError @@ -623,59 +623,59 @@ forall a b. (a -> b) -> a -> b $ TxOutRef -> Either ToCardanoError TxIn Pl.toCardanoTxIn TxOutRef -txOutRef +txOutRef where - resolveScriptOutputOwnerAndDatum :: + resolveScriptOutputOwnerAndDatum :: Either GenerateTxError ( Pl.ValidatorHash, Pl.Versioned Pl.Validator, C.ScriptDatum C.WitCtxTxIn ) - resolveScriptOutputOwnerAndDatum :: Either + resolveScriptOutputOwnerAndDatum :: Either GenerateTxError (ValidatorHash, Versioned Validator, ScriptDatum WitCtxTxIn) -resolveScriptOutputOwnerAndDatum = do - TxOut -txOut <- +resolveScriptOutputOwnerAndDatum = do + TxOut +txOut <- GenerateTxError -> Maybe TxOut -> Either GenerateTxError TxOut forall e a. e -> Maybe a -> Either e a -throwOnNothing +throwOnNothing (String -> GenerateTxError GenerateTxErrorGeneral String "txSkelInToTxIn: Unknown txOutRef") (TxOutRef -> Map TxOutRef TxOut -> Maybe TxOut forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup TxOutRef -txOutRef Map TxOutRef TxOut -managedTxOuts) - ValidatorHash -validatorHash <- +txOutRef Map TxOutRef TxOut +managedTxOuts) + ValidatorHash +validatorHash <- case TxOut -> Address forall o. (IsAbstractOutput o, ToCredential (OwnerType o)) => o -> Address outputAddress TxOut -txOut of - (Pl.Address (Pl.ScriptCredential ValidatorHash -validatorHash) Maybe StakingCredential +txOut of + (Pl.Address (Pl.ScriptCredential ValidatorHash +validatorHash) Maybe StakingCredential _) -> ValidatorHash -> Either GenerateTxError ValidatorHash forall a b. b -> Either a b Right ValidatorHash -validatorHash +validatorHash Address _ -> GenerateTxError -> Either GenerateTxError ValidatorHash forall a b. a -> Either a b Left (String -> GenerateTxError GenerateTxErrorGeneral String "txSkelInToTxIn: Output is not a script output") - Versioned Validator -validator <- + Versioned Validator +validator <- GenerateTxError -> Maybe (Versioned Validator) -> Either GenerateTxError (Versioned Validator) forall e a. e -> Maybe a -> Either e a -throwOnNothing +throwOnNothing (String -> GenerateTxError GenerateTxErrorGeneral String "txSkelInToTxIn: Unknown validator") @@ -684,35 +684,35 @@ -> Maybe (Versioned Validator) forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup ValidatorHash -validatorHash Map ValidatorHash (Versioned Validator) -managedValidators) - ScriptDatum WitCtxTxIn -datum <- +validatorHash Map ValidatorHash (Versioned Validator) +managedValidators) + ScriptDatum WitCtxTxIn +datum <- case TxOut -> OutputDatum forall o. (IsAbstractOutput o, ToOutputDatum (DatumType o)) => o -> OutputDatum outputOutputDatum TxOut -txOut of +txOut of OutputDatum Pl.NoOutputDatum -> GenerateTxError -> Either GenerateTxError (ScriptDatum WitCtxTxIn) forall a b. a -> Either a b Left (String -> GenerateTxError GenerateTxErrorGeneral String "txSkelInToTxIn: No datum found on script output") - Pl.OutputDatum Datum -_datum -> ScriptDatum WitCtxTxIn + Pl.OutputDatum Datum +_datum -> ScriptDatum WitCtxTxIn -> Either GenerateTxError (ScriptDatum WitCtxTxIn) forall a b. b -> Either a b Right ScriptDatum WitCtxTxIn C.InlineScriptDatum - Pl.OutputDatumHash DatumHash -datumHash -> + Pl.OutputDatumHash DatumHash +datumHash -> GenerateTxError -> Maybe (ScriptDatum WitCtxTxIn) -> Either GenerateTxError (ScriptDatum WitCtxTxIn) forall e a. e -> Maybe a -> Either e a -throwOnNothing +throwOnNothing (String -> GenerateTxError GenerateTxErrorGeneral String "txSkelInToTxIn: Datum hash could not be resolved") @@ -731,22 +731,22 @@ <$> DatumHash -> Map DatumHash Datum -> Maybe Datum forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup DatumHash -datumHash Map DatumHash Datum -managedData) +datumHash Map DatumHash Datum +managedData) (ValidatorHash, Versioned Validator, ScriptDatum WitCtxTxIn) -> Either GenerateTxError (ValidatorHash, Versioned Validator, ScriptDatum WitCtxTxIn) forall (m :: * -> *) a. Monad m => a -> m a return (ValidatorHash -validatorHash, Versioned Validator -validator, ScriptDatum WitCtxTxIn -datum) +validatorHash, Versioned Validator +validator, ScriptDatum WitCtxTxIn +datum) - mkWitness :: TxSkelRedeemer -> Either GenerateTxError (C.Witness C.WitCtxTxIn C.BabbageEra) - mkWitness :: TxSkelRedeemer + mkWitness :: TxSkelRedeemer -> Either GenerateTxError (C.Witness C.WitCtxTxIn C.BabbageEra) + mkWitness :: TxSkelRedeemer -> Either GenerateTxError (Witness WitCtxTxIn BabbageEra) -mkWitness TxSkelRedeemer +mkWitness TxSkelRedeemer TxSkelNoRedeemerForPK = Witness WitCtxTxIn BabbageEra -> Either GenerateTxError (Witness WitCtxTxIn BabbageEra) forall a b. b -> Either a b @@ -759,18 +759,18 @@ forall witctx era. KeyWitnessInCtx witctx -> Witness witctx era C.KeyWitness KeyWitnessInCtx WitCtxTxIn C.KeyWitnessForSpending - mkWitness (TxSkelRedeemerForReferencedScript TxOutRef -validatorOref redeemer -redeemer) = do - (ValidatorHash -validatorHash, Versioned Validator -validator, ScriptDatum WitCtxTxIn -datum) <- Either + mkWitness (TxSkelRedeemerForReferencedScript TxOutRef +validatorOref redeemer +redeemer) = do + (ValidatorHash +validatorHash, Versioned Validator +validator, ScriptDatum WitCtxTxIn +datum) <- Either GenerateTxError (ValidatorHash, Versioned Validator, ScriptDatum WitCtxTxIn) -resolveScriptOutputOwnerAndDatum - ScriptHash -scriptHashAtOref <- +resolveScriptOutputOwnerAndDatum + ScriptHash +scriptHashAtOref <- -- In our own MockChainT implementation, this error should never -- been thrown, because we collect the 'managedTxOuts' using -- (eventually) 'lookupUtxos', which will already fail on @@ -778,7 +778,7 @@ GenerateTxError -> Maybe ScriptHash -> Either GenerateTxError ScriptHash forall e a. e -> Maybe a -> Either e a -throwOnNothing +throwOnNothing (String -> GenerateTxError GenerateTxErrorGeneral String "txSkelInToTxIn: Can't resolve reference script outref. This might mean that you either never created or accidentally consumed the UTxO where the reference script is stored") @@ -788,8 +788,8 @@ $ TxOutRef -> Map TxOutRef TxOut -> Maybe TxOut forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup TxOutRef -validatorOref Map TxOutRef TxOut -managedTxOuts Maybe TxOut -> (TxOut -> Maybe ScriptHash) -> Maybe ScriptHash +validatorOref Map TxOutRef TxOut +managedTxOuts Maybe TxOut -> (TxOut -> Maybe ScriptHash) -> Maybe ScriptHash forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= (TxOut -> Optic' A_Lens NoIx TxOut (Maybe ScriptHash) -> Maybe ScriptHash @@ -804,12 +804,12 @@ Bool -> Either GenerateTxError () -> Either GenerateTxError () forall (f :: * -> *). Applicative f => Bool -> f () -> f () when (ScriptHash -scriptHashAtOref ScriptHash -> ScriptHash -> Bool +scriptHashAtOref ScriptHash -> ScriptHash -> Bool forall a. Eq a => a -> a -> Bool /= ValidatorHash -> ScriptHash forall a. ToScriptHash a => a -> ScriptHash toScriptHash ValidatorHash -validatorHash) (Either GenerateTxError () -> Either GenerateTxError ()) +validatorHash) (Either GenerateTxError () -> Either GenerateTxError ()) -> Either GenerateTxError () -> Either GenerateTxError () forall a b. (a -> b) -> a -> b $ @@ -822,8 +822,8 @@ String -> GenerateTxError GenerateTxErrorGeneral String "txSkelInToTxIn: Wrong reference script hash. Are you using the correct TxOutRef on your TxSkelRedeemerForReferencedScript?" - TxIn -validatorTxIn <- + TxIn +validatorTxIn <- (ToCardanoError -> GenerateTxError) -> Either ToCardanoError TxIn -> Either GenerateTxError TxIn forall (a :: * -> * -> *) b c d. @@ -838,9 +838,9 @@ forall a b. (a -> b) -> a -> b $ TxOutRef -> Either ToCardanoError TxIn Pl.toCardanoTxIn TxOutRef -validatorOref - ScriptHash -scriptHash <- +validatorOref + ScriptHash +scriptHash <- (ToCardanoError -> GenerateTxError) -> Either ToCardanoError ScriptHash -> Either GenerateTxError ScriptHash @@ -853,13 +853,13 @@ "txSkelInToTxIn: could not convert script hash of referenced script") (ValidatorHash -> Either ToCardanoError ScriptHash Pl.toCardanoScriptHash ValidatorHash -validatorHash) - let scriptWitnessBuilder :: ScriptDatum WitCtxTxIn +validatorHash) + let scriptWitnessBuilder :: ScriptDatum WitCtxTxIn -> ScriptData -> ExecutionUnits -> ScriptWitness WitCtxTxIn BabbageEra -scriptWitnessBuilder = case Versioned Validator -validator of +scriptWitnessBuilder = case Versioned Validator +validator of Pl.Versioned Validator _ Language Pl.PlutusV1 -> @@ -888,10 +888,10 @@ forall lang. TxIn -> Maybe ScriptHash -> PlutusScriptOrReferenceInput lang C.PReferenceScript TxIn -validatorTxIn (ScriptHash -> Maybe ScriptHash +validatorTxIn (ScriptHash -> Maybe ScriptHash forall a. a -> Maybe a Just ScriptHash -scriptHash)) +scriptHash)) Pl.Versioned Validator _ Language Pl.PlutusV2 -> @@ -920,10 +920,10 @@ forall lang. TxIn -> Maybe ScriptHash -> PlutusScriptOrReferenceInput lang C.PReferenceScript TxIn -validatorTxIn (ScriptHash -> Maybe ScriptHash +validatorTxIn (ScriptHash -> Maybe ScriptHash forall a. a -> Maybe a Just ScriptHash -scriptHash)) +scriptHash)) Witness WitCtxTxIn BabbageEra -> Either GenerateTxError (Witness WitCtxTxIn BabbageEra) forall (m :: * -> *) a. Monad m => a -> m a @@ -950,36 +950,36 @@ -> ScriptData -> ExecutionUnits -> ScriptWitness WitCtxTxIn BabbageEra -scriptWitnessBuilder +scriptWitnessBuilder ScriptDatum WitCtxTxIn -datum +datum (BuiltinData -> ScriptData Pl.toCardanoScriptData (BuiltinData -> ScriptData) -> BuiltinData -> ScriptData forall a b. (a -> b) -> a -> b $ redeemer -> BuiltinData forall a. ToData a => a -> BuiltinData Pl.toBuiltinData redeemer -redeemer) +redeemer) ExecutionUnits Pl.zeroExecutionUnits -- We can't guess that yet, no? - mkWitness (TxSkelRedeemerForScript redeemer -redeemer) = do - (ValidatorHash -_validatorHash, Versioned Validator -validator, ScriptDatum WitCtxTxIn -datum) <- Either + mkWitness (TxSkelRedeemerForScript redeemer +redeemer) = do + (ValidatorHash +_validatorHash, Versioned Validator +validator, ScriptDatum WitCtxTxIn +datum) <- Either GenerateTxError (ValidatorHash, Versioned Validator, ScriptDatum WitCtxTxIn) -resolveScriptOutputOwnerAndDatum - ScriptDatum WitCtxTxIn +resolveScriptOutputOwnerAndDatum + ScriptDatum WitCtxTxIn -> ScriptData -> ExecutionUnits -> ScriptWitness WitCtxTxIn BabbageEra -scriptWitnessBuilder <- +scriptWitnessBuilder <- case Versioned Validator -validator of - Pl.Versioned (Pl.Validator Script -script) Language +validator of + Pl.Versioned (Pl.Validator Script +script) Language Pl.PlutusV1 -> (ToCardanoError -> GenerateTxError) -> (PlutusScript PlutusScriptV1 @@ -1044,9 +1044,9 @@ forall lang. AsType lang -> AsType (PlutusScript lang) C.AsPlutusScript AsType PlutusScriptV1 C.AsPlutusScriptV1) Script -script) - Pl.Versioned (Pl.Validator Script -script) Language +script) + Pl.Versioned (Pl.Validator Script +script) Language Pl.PlutusV2 -> (ToCardanoError -> GenerateTxError) -> (PlutusScript PlutusScriptV2 @@ -1111,7 +1111,7 @@ forall lang. AsType lang -> AsType (PlutusScript lang) C.AsPlutusScript AsType PlutusScriptV2 C.AsPlutusScriptV2) Script -script) +script) Witness WitCtxTxIn BabbageEra -> Either GenerateTxError (Witness WitCtxTxIn BabbageEra) forall (m :: * -> *) a. Monad m => a -> m a @@ -1138,24 +1138,24 @@ -> ScriptData -> ExecutionUnits -> ScriptWitness WitCtxTxIn BabbageEra -scriptWitnessBuilder +scriptWitnessBuilder ScriptDatum WitCtxTxIn -datum +datum (BuiltinData -> ScriptData Pl.toCardanoScriptData (BuiltinData -> ScriptData) -> BuiltinData -> ScriptData forall a b. (a -> b) -> a -> b $ redeemer -> BuiltinData forall a. ToData a => a -> BuiltinData Pl.toBuiltinData redeemer -redeemer) +redeemer) ExecutionUnits Pl.zeroExecutionUnits -- We can't guess that yet, no? -- Convert a list of 'Pl.TxOutRef' into a 'C.TxInsReference' - txOutRefsToTxInsReference :: [Pl.TxOutRef] -> Either GenerateTxError (C.TxInsReference C.BuildTx C.BabbageEra) - txOutRefsToTxInsReference :: [TxOutRef] + txOutRefsToTxInsReference :: [Pl.TxOutRef] -> Either GenerateTxError (C.TxInsReference C.BuildTx C.BabbageEra) + txOutRefsToTxInsReference :: [TxOutRef] -> Either GenerateTxError (TxInsReference BuildTx BabbageEra) -txOutRefsToTxInsReference = +txOutRefsToTxInsReference = (ToCardanoError -> GenerateTxError) -> ([TxIn] -> TxInsReference BuildTx BabbageEra) -> Either ToCardanoError [TxIn] @@ -1171,15 +1171,15 @@ [] -> TxInsReference BuildTx BabbageEra forall build era. TxInsReference build era C.TxInsReferenceNone - [TxIn] -txIns -> ReferenceTxInsScriptsInlineDatumsSupportedInEra BabbageEra + [TxIn] +txIns -> ReferenceTxInsScriptsInlineDatumsSupportedInEra BabbageEra -> [TxIn] -> TxInsReference BuildTx BabbageEra forall era build. ReferenceTxInsScriptsInlineDatumsSupportedInEra era -> [TxIn] -> TxInsReference build era C.TxInsReference ReferenceTxInsScriptsInlineDatumsSupportedInEra BabbageEra C.ReferenceTxInsScriptsInlineDatumsInBabbageEra [TxIn] -txIns +txIns ) (Either ToCardanoError [TxIn] -> Either GenerateTxError (TxInsReference BuildTx BabbageEra)) @@ -1196,9 +1196,9 @@ Pl.toCardanoTxIn -- Convert a list of 'Pl.TxOutRef' into a 'C.TxInsCollateral' - txOutRefsToTxSkelInsCollateral :: [Pl.TxOutRef] -> Either GenerateTxError (C.TxInsCollateral C.BabbageEra) - txOutRefsToTxSkelInsCollateral :: [TxOutRef] -> Either GenerateTxError (TxInsCollateral BabbageEra) -txOutRefsToTxSkelInsCollateral = + txOutRefsToTxSkelInsCollateral :: [Pl.TxOutRef] -> Either GenerateTxError (C.TxInsCollateral C.BabbageEra) + txOutRefsToTxSkelInsCollateral :: [TxOutRef] -> Either GenerateTxError (TxInsCollateral BabbageEra) +txOutRefsToTxSkelInsCollateral = (ToCardanoError -> GenerateTxError) -> Either ToCardanoError (TxInsCollateral BabbageEra) -> Either GenerateTxError (TxInsCollateral BabbageEra) @@ -1220,7 +1220,7 @@ -> Either ToCardanoError (TxInsCollateral BabbageEra) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap [TxIn] -> TxInsCollateral BabbageEra -toTxInsCollateral +toTxInsCollateral (Either ToCardanoError [TxIn] -> Either ToCardanoError (TxInsCollateral BabbageEra)) -> ([TxOutRef] -> Either ToCardanoError [TxIn]) @@ -1235,27 +1235,27 @@ mapM TxOutRef -> Either ToCardanoError TxIn Pl.toCardanoTxIn where - toTxInsCollateral :: [TxIn] -> TxInsCollateral BabbageEra -toTxInsCollateral [] = TxInsCollateral BabbageEra + toTxInsCollateral :: [TxIn] -> TxInsCollateral BabbageEra +toTxInsCollateral [] = TxInsCollateral BabbageEra forall era. TxInsCollateral era C.TxInsCollateralNone - toTxInsCollateral [TxIn] -ins = CollateralSupportedInEra BabbageEra + toTxInsCollateral [TxIn] +ins = CollateralSupportedInEra BabbageEra -> [TxIn] -> TxInsCollateral BabbageEra forall era. CollateralSupportedInEra era -> [TxIn] -> TxInsCollateral era C.TxInsCollateral CollateralSupportedInEra BabbageEra C.CollateralInBabbageEra [TxIn] -ins +ins -- Convert the 'TxSkelMints' into a 'TxMintValue' - txSkelMintsToTxMintValue :: TxSkelMints -> Either GenerateTxError (C.TxMintValue C.BuildTx C.BabbageEra) - txSkelMintsToTxMintValue :: TxSkelMints + txSkelMintsToTxMintValue :: TxSkelMints -> Either GenerateTxError (C.TxMintValue C.BuildTx C.BabbageEra) + txSkelMintsToTxMintValue :: TxSkelMints -> Either GenerateTxError (TxMintValue BuildTx BabbageEra) -txSkelMintsToTxMintValue TxSkelMints -mints = +txSkelMintsToTxMintValue TxSkelMints +mints = if TxSkelMints -mints TxSkelMints -> TxSkelMints -> Bool +mints TxSkelMints -> TxSkelMints -> Bool forall a. Eq a => a -> a -> Bool == TxSkelMints forall k a. Map k a @@ -1289,7 +1289,7 @@ -> TxMintValue BuildTx BabbageEra) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Either GenerateTxError Value -mintVal Either +mintVal Either GenerateTxError (BuildTxWith BuildTx (Map PolicyId (ScriptWitness WitCtxMint BabbageEra)) @@ -1318,11 +1318,11 @@ <$> Either GenerateTxError (Map PolicyId (ScriptWitness WitCtxMint BabbageEra)) -witnessMap) +witnessMap) where - mintVal :: Either GenerateTxError C.Value - mintVal :: Either GenerateTxError Value -mintVal = + mintVal :: Either GenerateTxError C.Value + mintVal :: Either GenerateTxError Value +mintVal = (ToCardanoError -> GenerateTxError) -> Either ToCardanoError Value -> Either GenerateTxError Value forall (a :: * -> * -> *) b c d. @@ -1349,13 +1349,13 @@ -> TxSkelMints -> Either GenerateTxError Value forall a b. (a -> b) -> a -> b $ TxSkelMints -mints +mints - witnessMap :: Either GenerateTxError (Map C.PolicyId (C.ScriptWitness C.WitCtxMint C.BabbageEra)) - witnessMap :: Either + witnessMap :: Either GenerateTxError (Map C.PolicyId (C.ScriptWitness C.WitCtxMint C.BabbageEra)) + witnessMap :: Either GenerateTxError (Map PolicyId (ScriptWitness WitCtxMint BabbageEra)) -witnessMap = +witnessMap = ([Map PolicyId (ScriptWitness WitCtxMint BabbageEra)] -> Map PolicyId (ScriptWitness WitCtxMint BabbageEra)) -> Either @@ -1396,11 +1396,11 @@ (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM - ( \(Versioned MintingPolicy -policy, MintsRedeemer -redeemer, TokenName -_tName, Integer -_amount) -> + ( \(Versioned MintingPolicy +policy, MintsRedeemer +redeemer, TokenName +_tName, Integer +_amount) -> PolicyId -> ScriptWitness WitCtxMint BabbageEra -> Map PolicyId (ScriptWitness WitCtxMint BabbageEra) @@ -1428,7 +1428,7 @@ (MintingPolicyHash -> Either ToCardanoError PolicyId Pl.toCardanoPolicyId (Versioned MintingPolicy -> MintingPolicyHash Pl.mintingPolicyHash Versioned MintingPolicy -policy)) +policy)) Either GenerateTxError (ScriptWitness WitCtxMint BabbageEra @@ -1441,9 +1441,9 @@ <*> Versioned MintingPolicy -> MintsRedeemer -> Either GenerateTxError (ScriptWitness WitCtxMint BabbageEra) -mkMintWitness Versioned MintingPolicy -policy MintsRedeemer -redeemer +mkMintWitness Versioned MintingPolicy +policy MintsRedeemer +redeemer ) ([(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -> Either @@ -1457,28 +1457,28 @@ $ TxSkelMints -> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] txSkelMintsToList TxSkelMints -mints +mints - mkMintWitness :: + mkMintWitness :: Pl.Versioned Pl.MintingPolicy -> MintsRedeemer -> Either GenerateTxError (C.ScriptWitness C.WitCtxMint C.BabbageEra) - mkMintWitness :: Versioned MintingPolicy + mkMintWitness :: Versioned MintingPolicy -> MintsRedeemer -> Either GenerateTxError (ScriptWitness WitCtxMint BabbageEra) -mkMintWitness (Pl.Versioned (Pl.MintingPolicy Script -script) Language -version) MintsRedeemer -redeemer = do - ScriptDatum WitCtxMint +mkMintWitness (Pl.Versioned (Pl.MintingPolicy Script +script) Language +version) MintsRedeemer +redeemer = do + ScriptDatum WitCtxMint -> ScriptData -> ExecutionUnits -> ScriptWitness WitCtxMint BabbageEra -scriptWitnessBuilder <- +scriptWitnessBuilder <- case Language -version of +version of Language Pl.PlutusV1 -> (ToCardanoError -> GenerateTxError) @@ -1544,7 +1544,7 @@ forall lang. AsType lang -> AsType (PlutusScript lang) C.AsPlutusScript AsType PlutusScriptV1 C.AsPlutusScriptV1) Script -script) +script) Language Pl.PlutusV2 -> (ToCardanoError -> GenerateTxError) @@ -1610,7 +1610,7 @@ forall lang. AsType lang -> AsType (PlutusScript lang) C.AsPlutusScript AsType PlutusScriptV2 C.AsPlutusScriptV2) Script -script) +script) ScriptWitness WitCtxMint BabbageEra -> Either GenerateTxError (ScriptWitness WitCtxMint BabbageEra) forall (m :: * -> *) a. Monad m => a -> m a @@ -1624,11 +1624,11 @@ -> ScriptData -> ExecutionUnits -> ScriptWitness WitCtxMint BabbageEra -scriptWitnessBuilder +scriptWitnessBuilder ScriptDatum WitCtxMint C.NoScriptDatumForMint -- This seems to be the only well-typed option (?) ( case MintsRedeemer -redeemer of +redeemer of MintsRedeemer NoMintsRedeemer -> BuiltinData -> ScriptData Pl.toCardanoScriptData (BuiltinData -> ScriptData) -> BuiltinData -> ScriptData @@ -1636,14 +1636,14 @@ $ () -> BuiltinData forall a. ToData a => a -> BuiltinData Pl.toBuiltinData () -- This is also how plutus-apps is doing it: Using no redeemer means using '()' on-chain - SomeMintsRedeemer redeemer -red -> BuiltinData -> ScriptData + SomeMintsRedeemer redeemer +red -> BuiltinData -> ScriptData Pl.toCardanoScriptData (BuiltinData -> ScriptData) -> BuiltinData -> ScriptData forall a b. (a -> b) -> a -> b $ redeemer -> BuiltinData forall a. ToData a => a -> BuiltinData Pl.toBuiltinData redeemer -red +red ) ExecutionUnits Pl.zeroExecutionUnits -- This is what plutus-apps does as well, we can't know this yet, no? @@ -1652,9 +1652,9 @@ txSkelOutToCardanoTxOut :: Pl.Params -> TxSkelOut -> Either GenerateTxError (C.TxOut C.CtxTx C.BabbageEra) txSkelOutToCardanoTxOut :: Params -> TxSkelOut -> Either GenerateTxError (TxOut CtxTx BabbageEra) -txSkelOutToCardanoTxOut Params -theParams (Pays o -output) = +txSkelOutToCardanoTxOut Params +theParams (Pays o +output) = (ToCardanoError -> GenerateTxError) -> Either ToCardanoError (TxOut CtxTx BabbageEra) -> Either GenerateTxError (TxOut CtxTx BabbageEra) @@ -1698,12 +1698,12 @@ -> Address -> Either ToCardanoError (AddressInEra BabbageEra) Pl.toCardanoAddressInEra (Params -> NetworkId Pl.pNetworkId Params -theParams) (o -> Address +theParams) (o -> Address forall o. (IsAbstractOutput o, ToCredential (OwnerType o)) => o -> Address outputAddress o -output) +output) Either ToCardanoError (TxOutValue BabbageEra @@ -1725,7 +1725,7 @@ Pl.toCardanoValue (o -> Value forall o. (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value outputValue o -output)) +output)) Either ToCardanoError (TxOutDatum CtxTx BabbageEra @@ -1736,7 +1736,7 @@ (ReferenceScript BabbageEra -> TxOut CtxTx BabbageEra) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> ( case o -output o -> Optic' A_Lens NoIx o TxSkelOutDatum -> TxSkelOutDatum +output o -> Optic' A_Lens NoIx o TxSkelOutDatum -> TxSkelOutDatum forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -1749,8 +1749,8 @@ forall a b. b -> Either a b Right TxOutDatum CtxTx BabbageEra Pl.toCardanoTxOutNoDatum - TxSkelOutDatumHash a -datum -> DatumHash -> Either ToCardanoError (TxOutDatum CtxTx BabbageEra) + TxSkelOutDatumHash a +datum -> DatumHash -> Either ToCardanoError (TxOutDatum CtxTx BabbageEra) forall ctx. DatumHash -> Either ToCardanoError (TxOutDatum ctx BabbageEra) Pl.toCardanoTxOutDatumHash (DatumHash -> Either ToCardanoError (TxOutDatum CtxTx BabbageEra)) @@ -1770,9 +1770,9 @@ -> a -> Either ToCardanoError (TxOutDatum CtxTx BabbageEra) forall a b. (a -> b) -> a -> b $ a -datum - TxSkelOutDatum a -datum -> TxOutDatum CtxTx BabbageEra +datum + TxSkelOutDatum a +datum -> TxOutDatum CtxTx BabbageEra -> Either ToCardanoError (TxOutDatum CtxTx BabbageEra) forall a b. b -> Either a b Right (TxOutDatum CtxTx BabbageEra @@ -1794,9 +1794,9 @@ -> a -> Either ToCardanoError (TxOutDatum CtxTx BabbageEra) forall a b. (a -> b) -> a -> b $ a -datum - TxSkelOutInlineDatum a -datum -> TxOutDatum CtxTx BabbageEra +datum + TxSkelOutInlineDatum a +datum -> TxOutDatum CtxTx BabbageEra -> Either ToCardanoError (TxOutDatum CtxTx BabbageEra) forall a b. b -> Either a b Right (TxOutDatum CtxTx BabbageEra @@ -1818,7 +1818,7 @@ -> a -> Either ToCardanoError (TxOutDatum CtxTx BabbageEra) forall a b. (a -> b) -> a -> b $ a -datum +datum ) Either ToCardanoError @@ -1834,7 +1834,7 @@ -> Maybe (ReferenceScriptType o) -> Maybe (Versioned Script) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> o -output o +output o -> Optic' A_Lens NoIx o (Maybe (ReferenceScriptType o)) -> Maybe (ReferenceScriptType o) forall k s (is :: IxList) a. @@ -1869,15 +1869,15 @@ -> Map ValidatorHash (Versioned Validator) -> TxSkel -> Either GenerateTxError (Tx BabbageEra) -generateTx GenTxParams -genTxParams Params -params Map DatumHash Datum -datums Map TxOutRef TxOut -txOuts Map ValidatorHash (Versioned Validator) -validators TxSkel -skel = do - TxBodyContent BuildTx BabbageEra -txBodyContent <- GenTxParams +generateTx GenTxParams +genTxParams Params +params Map DatumHash Datum +datums Map TxOutRef TxOut +txOuts Map ValidatorHash (Versioned Validator) +validators TxSkel +skel = do + TxBodyContent BuildTx BabbageEra +txBodyContent <- GenTxParams -> Params -> Map DatumHash Datum -> Map TxOutRef TxOut @@ -1885,14 +1885,14 @@ -> TxSkel -> Either GenerateTxError (TxBodyContent BuildTx BabbageEra) generateTxBodyContent GenTxParams -genTxParams Params -params Map DatumHash Datum -datums Map TxOutRef TxOut -txOuts Map ValidatorHash (Versioned Validator) -validators TxSkel -skel - Tx BabbageEra -cardanoTxUnsigned <- +genTxParams Params +params Map DatumHash Datum +datums Map TxOutRef TxOut +txOuts Map ValidatorHash (Versioned Validator) +validators TxSkel +skel + Tx BabbageEra +cardanoTxUnsigned <- (TxBodyError -> GenerateTxError) -> (TxBody BabbageEra -> Tx BabbageEra) -> Either TxBodyError (TxBody BabbageEra) @@ -1920,18 +1920,18 @@ IsCardanoEra era => TxBodyContent BuildTx era -> Either TxBodyError (TxBody era) C.makeTransactionBody TxBodyContent BuildTx BabbageEra -txBodyContent) - let cardanoTxSigned :: Tx BabbageEra -cardanoTxSigned = (Tx BabbageEra -> Wallet -> Tx BabbageEra) +txBodyContent) + let cardanoTxSigned :: Tx BabbageEra +cardanoTxSigned = (Tx BabbageEra -> Wallet -> Tx BabbageEra) -> Tx BabbageEra -> [Wallet] -> Tx BabbageEra forall (t :: * -> *) b a. Foldable t => (b -> a -> b) -> b -> t a -> b foldl' Tx BabbageEra -> Wallet -> Tx BabbageEra -txAddSignature Tx BabbageEra -cardanoTxUnsigned (TxSkel -> [Wallet] +txAddSignature Tx BabbageEra +cardanoTxUnsigned (TxSkel -> [Wallet] txSkelSigners TxSkel -skel) +skel) Tx BabbageEra -> Either GenerateTxError (Tx BabbageEra) forall (m :: * -> *) a. Monad m => a -> m a return (Tx BabbageEra -> Either GenerateTxError (Tx BabbageEra)) @@ -1946,30 +1946,30 @@ txSkelOpts (TxSkel -> [RawModTx]) -> TxSkel -> [RawModTx] forall a b. (a -> b) -> a -> b $ TxSkel -skel) Tx BabbageEra -cardanoTxSigned +skel) Tx BabbageEra +cardanoTxSigned where - txAddSignature :: C.Tx C.BabbageEra -> Wallet -> C.Tx C.BabbageEra - txAddSignature :: Tx BabbageEra -> Wallet -> Tx BabbageEra -txAddSignature Tx BabbageEra -tx Wallet -wal = case PrivateKey -> CardanoTx -> CardanoTx + txAddSignature :: C.Tx C.BabbageEra -> Wallet -> C.Tx C.BabbageEra + txAddSignature :: Tx BabbageEra -> Wallet -> Tx BabbageEra +txAddSignature Tx BabbageEra +tx Wallet +wal = case PrivateKey -> CardanoTx -> CardanoTx Ledger.addCardanoTxSignature (Wallet -> PrivateKey walletSK Wallet -wal) +wal) (Tx BabbageEra -> EraInMode BabbageEra CardanoMode -> CardanoTx forall era. IsCardanoEra era => Tx era -> EraInMode era CardanoMode -> CardanoTx Ledger.CardanoTx Tx BabbageEra -tx EraInMode BabbageEra CardanoMode +tx EraInMode BabbageEra CardanoMode C.BabbageEraInCardanoMode) of - Ledger.CardanoTx Tx era -tx' EraInMode era CardanoMode + Ledger.CardanoTx Tx era +tx' EraInMode era CardanoMode C.BabbageEraInCardanoMode -> Tx era Tx BabbageEra -tx' +tx' -- Looking at the implementation of Ledger.addCardanoTxSignature: -- It never changes the constructor used, so the above branch -- will never happen diff --git a/src/Cooked.MockChain.Staged.html b/src/Cooked.MockChain.Staged.html index e09728ea1..63fd876a8 100644 --- a/src/Cooked.MockChain.Staged.html +++ b/src/Cooked.MockChain.Staged.html @@ -20,44 +20,45 @@ runTweak, everywhere, withTweak, - ) -where - -import qualified Cardano.Node.Emulator as Emulator -import Control.Applicative -import Control.Arrow hiding ((<+>)) -import Control.Monad.Except -import Control.Monad.Reader -import Control.Monad.State -import Control.Monad.Writer.Strict hiding (Alt) -import Cooked.Ltl -import Cooked.MockChain.BlockChain -import Cooked.MockChain.Direct -import Cooked.MockChain.UtxoState -import Cooked.Skeleton -import Cooked.Tweak.Common -import Data.Default -import qualified Data.Map as Map -import qualified Ledger.Slot as Ledger -import qualified Ledger.Tx as Ledger -import qualified Ledger.Tx.CardanoAPI as Ledger -import qualified Ledger.Typed.Scripts as Pl -import qualified Plutus.V2.Ledger.Api as Pl - --- * Interpreting and running 'StagedMockChain' - --- | Interprets the staged mockchain then runs the resulting computation with a --- custom function. This can be used, for example, to supply a custom --- 'InitialDistribution' by providing 'runMockChainTFrom'. -interpretAndRunWith :: - (forall m. Monad m => MockChainT m a -> m res) -> - StagedMockChain a -> - [(res, MockChainLog)] -interpretAndRunWith :: (forall (m :: * -> *). Monad m => MockChainT m a -> m res) + there, + ) +where + +import qualified Cardano.Node.Emulator as Emulator +import Control.Applicative +import Control.Arrow hiding ((<+>)) +import Control.Monad.Except +import Control.Monad.Reader +import Control.Monad.State +import Control.Monad.Writer.Strict hiding (Alt) +import Cooked.Ltl +import Cooked.MockChain.BlockChain +import Cooked.MockChain.Direct +import Cooked.MockChain.UtxoState +import Cooked.Skeleton +import Cooked.Tweak.Common +import Data.Default +import qualified Data.Map as Map +import qualified Ledger.Slot as Ledger +import qualified Ledger.Tx as Ledger +import qualified Ledger.Tx.CardanoAPI as Ledger +import qualified Ledger.Typed.Scripts as Pl +import qualified Plutus.V2.Ledger.Api as Pl + +-- * Interpreting and running 'StagedMockChain' + +-- | Interprets the staged mockchain then runs the resulting computation with a +-- custom function. This can be used, for example, to supply a custom +-- 'InitialDistribution' by providing 'runMockChainTFrom'. +interpretAndRunWith :: + (forall m. Monad m => MockChainT m a -> m res) -> + StagedMockChain a -> + [(res, MockChainLog)] +interpretAndRunWith :: (forall (m :: * -> *). Monad m => MockChainT m a -> m res) -> StagedMockChain a -> [(res, MockChainLog)] -interpretAndRunWith forall (m :: * -> *). Monad m => MockChainT m a -> m res -f StagedMockChain a -smc = WriterT MockChainLog [] res -> [(res, MockChainLog)] +interpretAndRunWith forall (m :: * -> *). Monad m => MockChainT m a -> m res +f StagedMockChain a +smc = WriterT MockChainLog [] res -> [(res, MockChainLog)] forall w (m :: * -> *) a. WriterT w m a -> m (a, w) runWriterT (WriterT MockChainLog [] res -> [(res, MockChainLog)]) -> WriterT MockChainLog [] res -> [(res, MockChainLog)] @@ -65,7 +66,7 @@ $ MockChainT (WriterT MockChainLog []) a -> WriterT MockChainLog [] res forall (m :: * -> *). Monad m => MockChainT m a -> m res -f (MockChainT (WriterT MockChainLog []) a +f (MockChainT (WriterT MockChainLog []) a -> WriterT MockChainLog [] res) -> MockChainT (WriterT MockChainLog []) a -> WriterT MockChainLog [] res @@ -73,12 +74,12 @@ $ StagedMockChain a -> MockChainT (WriterT MockChainLog []) a forall a. StagedMockChain a -> InterpMockChain a interpret StagedMockChain a -smc - -interpretAndRun :: - StagedMockChain a -> - [(Either MockChainError (a, UtxoState), MockChainLog)] -interpretAndRun :: StagedMockChain a +smc + +interpretAndRun :: + StagedMockChain a -> + [(Either MockChainError (a, UtxoState), MockChainLog)] +interpretAndRun :: StagedMockChain a -> [(Either MockChainError (a, UtxoState), MockChainLog)] interpretAndRun = (forall (m :: * -> *). Monad m => @@ -95,48 +96,48 @@ Monad m => MockChainT m a -> m (Either MockChainError (a, UtxoState)) runMockChainT - -data MockChainLogEntry - = MCLogSubmittedTxSkel SkelContext TxSkel - | MCLogNewTx Pl.TxId - | MCLogFail String - -newtype MockChainLog = MockChainLog {MockChainLog -> [MockChainLogEntry] + +data MockChainLogEntry + = MCLogSubmittedTxSkel SkelContext TxSkel + | MCLogNewTx Pl.TxId + | MCLogFail String + +newtype MockChainLog = MockChainLog {MockChainLog -> [MockChainLogEntry] unMockChainLog :: [MockChainLogEntry]} - -instance Semigroup MockChainLog where - MockChainLog [MockChainLogEntry] -x <> :: MockChainLog -> MockChainLog -> MockChainLog -<> MockChainLog [MockChainLogEntry] -y = [MockChainLogEntry] -> MockChainLog + +instance Semigroup MockChainLog where + MockChainLog [MockChainLogEntry] +x <> :: MockChainLog -> MockChainLog -> MockChainLog +<> MockChainLog [MockChainLogEntry] +y = [MockChainLogEntry] -> MockChainLog MockChainLog ([MockChainLogEntry] -> MockChainLog) -> [MockChainLogEntry] -> MockChainLog forall a b. (a -> b) -> a -> b $ [MockChainLogEntry] -x [MockChainLogEntry] -> [MockChainLogEntry] -> [MockChainLogEntry] +x [MockChainLogEntry] -> [MockChainLogEntry] -> [MockChainLogEntry] forall a. Semigroup a => a -> a -> a <> [MockChainLogEntry] -y - -instance Monoid MockChainLog where - mempty :: MockChainLog +y + +instance Monoid MockChainLog where + mempty :: MockChainLog mempty = [MockChainLogEntry] -> MockChainLog MockChainLog [] - --- | The semantic domain in which 'StagedMockChain' gets interpreted; see the --- 'interpret' function for more. -type InterpMockChain = MockChainT (WriterT MockChainLog []) - --- | The 'interpret' function gives semantics to our traces. One --- 'StagedMockChain' computation yields a potential list of 'MockChainT' --- computations, which emit a description of their operation. Recall a --- 'MockChainT' is a state and except monad composed: --- --- > MockChainT (WriterT TraceDescr []) a --- > =~= st -> (WriterT TraceDescr []) (Either err (a, st)) --- > =~= st -> [(Either err (a, st) , TraceDescr)] -interpret :: StagedMockChain a -> InterpMockChain a -interpret :: StagedMockChain a -> InterpMockChain a + +-- | The semantic domain in which 'StagedMockChain' gets interpreted; see the +-- 'interpret' function for more. +type InterpMockChain = MockChainT (WriterT MockChainLog []) + +-- | The 'interpret' function gives semantics to our traces. One +-- 'StagedMockChain' computation yields a potential list of 'MockChainT' +-- computations, which emit a description of their operation. Recall a +-- 'MockChainT' is a state and except monad composed: +-- +-- > MockChainT (WriterT TraceDescr []) a +-- > =~= st -> (WriterT TraceDescr []) (Either err (a, st)) +-- > =~= st -> [(Either err (a, st) , TraceDescr)] +interpret :: StagedMockChain a -> InterpMockChain a +interpret :: StagedMockChain a -> InterpMockChain a interpret = (StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a -> [Ltl (UntypedTweak InterpMockChain)] -> InterpMockChain a) -> [Ltl (UntypedTweak InterpMockChain)] @@ -160,40 +161,40 @@ Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a interpLtlAndPruneUnfinished - --- * 'StagedMockChain': An AST for 'MonadMockChain' computations - -data MockChainBuiltin a where - -- methods of 'MonadBlockChain' - - GetParams :: MockChainBuiltin Emulator.Params - ValidateTxSkel :: TxSkel -> MockChainBuiltin Ledger.CardanoTx - TxOutByRefLedger :: Pl.TxOutRef -> MockChainBuiltin (Maybe Ledger.TxOut) - GetCurrentSlot :: MockChainBuiltin Ledger.Slot - AwaitSlot :: Ledger.Slot -> MockChainBuiltin Ledger.Slot - DatumFromHash :: Pl.DatumHash -> MockChainBuiltin (Maybe Pl.Datum) - AllUtxosLedger :: MockChainBuiltin [(Pl.TxOutRef, Ledger.TxOut)] - UtxosAtLedger :: Pl.Address -> MockChainBuiltin [(Pl.TxOutRef, Ledger.TxOut)] - ValidatorFromHash :: Pl.ValidatorHash -> MockChainBuiltin (Maybe (Pl.Versioned Pl.Validator)) - -- | The empty set of traces - Empty :: MockChainBuiltin a - -- | The union of two sets of traces - Alt :: - StagedMockChain a -> - StagedMockChain a -> - MockChainBuiltin a - -- for the 'MonadFail' instance - Fail :: String -> MockChainBuiltin a - -- for the 'MonadError MockChainError' instance - ThrowError :: MockChainError -> MockChainBuiltin a - CatchError :: StagedMockChain a -> (MockChainError -> StagedMockChain a) -> MockChainBuiltin a - -type MockChainOp = LtlOp (UntypedTweak InterpMockChain) MockChainBuiltin - -type StagedMockChain = Staged MockChainOp - -instance Alternative StagedMockChain where - empty :: StagedMockChain a + +-- * 'StagedMockChain': An AST for 'MonadMockChain' computations + +data MockChainBuiltin a where + -- methods of 'MonadBlockChain' + + GetParams :: MockChainBuiltin Emulator.Params + ValidateTxSkel :: TxSkel -> MockChainBuiltin Ledger.CardanoTx + TxOutByRefLedger :: Pl.TxOutRef -> MockChainBuiltin (Maybe Ledger.TxOut) + GetCurrentSlot :: MockChainBuiltin Ledger.Slot + AwaitSlot :: Ledger.Slot -> MockChainBuiltin Ledger.Slot + DatumFromHash :: Pl.DatumHash -> MockChainBuiltin (Maybe Pl.Datum) + AllUtxosLedger :: MockChainBuiltin [(Pl.TxOutRef, Ledger.TxOut)] + UtxosAtLedger :: Pl.Address -> MockChainBuiltin [(Pl.TxOutRef, Ledger.TxOut)] + ValidatorFromHash :: Pl.ValidatorHash -> MockChainBuiltin (Maybe (Pl.Versioned Pl.Validator)) + -- | The empty set of traces + Empty :: MockChainBuiltin a + -- | The union of two sets of traces + Alt :: + StagedMockChain a -> + StagedMockChain a -> + MockChainBuiltin a + -- for the 'MonadFail' instance + Fail :: String -> MockChainBuiltin a + -- for the 'MonadError MockChainError' instance + ThrowError :: MockChainError -> MockChainBuiltin a + CatchError :: StagedMockChain a -> (MockChainError -> StagedMockChain a) -> MockChainBuiltin a + +type MockChainOp = LtlOp (UntypedTweak InterpMockChain) MockChainBuiltin + +type StagedMockChain = Staged MockChainOp + +instance Alternative StagedMockChain where + empty :: StagedMockChain a empty = LtlOp (UntypedTweak InterpMockChain) MockChainBuiltin a -> (a -> StagedMockChain a) -> StagedMockChain a forall (op :: * -> *) a b. @@ -207,10 +208,10 @@ Empty) a -> StagedMockChain a forall a (op :: * -> *). a -> Staged op a Return - StagedMockChain a -a <|> :: StagedMockChain a -> StagedMockChain a -> StagedMockChain a -<|> StagedMockChain a -b = LtlOp (UntypedTweak InterpMockChain) MockChainBuiltin a + StagedMockChain a +a <|> :: StagedMockChain a -> StagedMockChain a -> StagedMockChain a +<|> StagedMockChain a +b = LtlOp (UntypedTweak InterpMockChain) MockChainBuiltin a -> (a -> StagedMockChain a) -> StagedMockChain a forall (op :: * -> *) a b. op a -> (a -> Staged op b) -> Staged op b @@ -222,15 +223,15 @@ forall a. StagedMockChain a -> StagedMockChain a -> MockChainBuiltin a Alt StagedMockChain a -a StagedMockChain a -b)) a -> StagedMockChain a +a StagedMockChain a +b)) a -> StagedMockChain a forall a (op :: * -> *). a -> Staged op a Return - -instance MonadFail StagedMockChain where - fail :: String -> StagedMockChain a -fail String -msg = LtlOp (UntypedTweak InterpMockChain) MockChainBuiltin a + +instance MonadFail StagedMockChain where + fail :: String -> StagedMockChain a +fail String +msg = LtlOp (UntypedTweak InterpMockChain) MockChainBuiltin a -> (a -> StagedMockChain a) -> StagedMockChain a forall (op :: * -> *) a b. op a -> (a -> Staged op b) -> Staged op b @@ -241,14 +242,14 @@ Builtin (String -> MockChainBuiltin a forall a. String -> MockChainBuiltin a Fail String -msg)) a -> StagedMockChain a +msg)) a -> StagedMockChain a forall a (op :: * -> *). a -> Staged op a Return - --- * 'InterpLtl' instance - -instance MonadPlus m => MonadPlus (MockChainT m) where - mzero :: MockChainT m a + +-- * 'InterpLtl' instance + +instance MonadPlus m => MonadPlus (MockChainT m) where + mzero :: MockChainT m a mzero = m a -> MockChainT m a forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => @@ -256,7 +257,7 @@ lift m a forall (m :: * -> *) a. MonadPlus m => m a mzero - mplus :: MockChainT m a -> MockChainT m a -> MockChainT m a + mplus :: MockChainT m a -> MockChainT m a -> MockChainT m a mplus = (forall a. m a -> m a -> m a) -> MockChainT m a -> MockChainT m a -> MockChainT m a forall (m :: * -> *) x. @@ -266,9 +267,9 @@ combineMockChainT forall a. m a -> m a -> m a forall (m :: * -> *) a. MonadPlus m => m a -> m a -> m a mplus - -instance InterpLtl (UntypedTweak InterpMockChain) MockChainBuiltin InterpMockChain where - interpBuiltin :: MockChainBuiltin a + +instance InterpLtl (UntypedTweak InterpMockChain) MockChainBuiltin InterpMockChain where + interpBuiltin :: MockChainBuiltin a -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a interpBuiltin MockChainBuiltin a GetParams = InterpMockChain Params @@ -288,15 +289,15 @@ forall r (m :: * -> *) a. MonadReader r m => (r -> a) -> m a asks MockChainEnv -> Params mceParams - interpBuiltin (ValidateTxSkel TxSkel -skel) = - StateT + interpBuiltin (ValidateTxSkel TxSkel +skel) = + StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain [Ltl (UntypedTweak InterpMockChain)] forall s (m :: * -> *). MonadState s m => m s get - StateT + StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain [Ltl (UntypedTweak InterpMockChain)] @@ -314,7 +315,7 @@ (Foldable t, MonadPlus m) => t (m a) -> m a msum - ([StateT + ([StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain CardanoTx] -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain CardanoTx) @@ -347,8 +348,8 @@ -> [Ltl (UntypedTweak InterpMockChain)] -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain CardanoTx -interpretAndTell) - ([(UntypedTweak InterpMockChain, +interpretAndTell) + ([(UntypedTweak InterpMockChain, [Ltl (UntypedTweak InterpMockChain)])] -> [StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain CardanoTx]) @@ -364,20 +365,20 @@ [Ltl (UntypedTweak InterpMockChain)])] forall a. Monoid a => [Ltl a] -> [(a, [Ltl a])] nowLaterList - where - interpretAndTell :: - UntypedTweak InterpMockChain -> - [Ltl (UntypedTweak InterpMockChain)] -> - StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain Ledger.CardanoTx - interpretAndTell :: UntypedTweak InterpMockChain + where + interpretAndTell :: + UntypedTweak InterpMockChain -> + [Ltl (UntypedTweak InterpMockChain)] -> + StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain Ledger.CardanoTx + interpretAndTell :: UntypedTweak InterpMockChain -> [Ltl (UntypedTweak InterpMockChain)] -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain CardanoTx -interpretAndTell (UntypedTweak Tweak InterpMockChain a -now) [Ltl (UntypedTweak InterpMockChain)] -later = do - MockChainSt -mcst <- InterpMockChain MockChainSt +interpretAndTell (UntypedTweak Tweak InterpMockChain a +now) [Ltl (UntypedTweak InterpMockChain)] +later = do + MockChainSt +mcst <- InterpMockChain MockChainSt -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain MockChainSt forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. @@ -386,8 +387,8 @@ lift InterpMockChain MockChainSt forall s (m :: * -> *). MonadState s m => m s get - let managedTxOuts :: Map TxOutRef TxOut -managedTxOuts = UtxoIndex -> Map TxOutRef TxOut + let managedTxOuts :: Map TxOutRef TxOut +managedTxOuts = UtxoIndex -> Map TxOutRef TxOut getIndex (UtxoIndex -> Map TxOutRef TxOut) -> (MockChainSt -> UtxoIndex) -> MockChainSt -> Map TxOutRef TxOut forall b c a. (b -> c) -> (a -> b) -> a -> c @@ -396,14 +397,14 @@ -> MockChainSt -> Map TxOutRef TxOut forall a b. (a -> b) -> a -> b $ MockChainSt -mcst - managedDatums :: Map DatumHash (TxSkelOutDatum, Integer) -managedDatums = MockChainSt -> Map DatumHash (TxSkelOutDatum, Integer) +mcst + managedDatums :: Map DatumHash (TxSkelOutDatum, Integer) +managedDatums = MockChainSt -> Map DatumHash (TxSkelOutDatum, Integer) mcstDatums MockChainSt -mcst - (a -_, TxSkel -skel') <- InterpMockChain (a, TxSkel) +mcst + (a +_, TxSkel +skel') <- InterpMockChain (a, TxSkel) -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain (a, TxSkel) forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. @@ -421,9 +422,9 @@ (MonadBlockChainWithoutValidation m, MonadPlus m) => Tweak m a -> TxSkel -> m (a, TxSkel) runTweakInChain Tweak InterpMockChain a -now TxSkel -skel - MockChainT (WriterT MockChainLog []) () +now TxSkel +skel + MockChainT (WriterT MockChainLog []) () -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain () forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => @@ -434,7 +435,7 @@ -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain () forall a b. (a -> b) -> a -> b $ - WriterT MockChainLog [] () + WriterT MockChainLog [] () -> MockChainT (WriterT MockChainLog []) () forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => @@ -445,22 +446,22 @@ -> MockChainT (WriterT MockChainLog []) () forall a b. (a -> b) -> a -> b $ - MockChainLog -> WriterT MockChainLog [] () + MockChainLog -> WriterT MockChainLog [] () forall w (m :: * -> *). MonadWriter w m => w -> m () tell (MockChainLog -> WriterT MockChainLog [] ()) -> MockChainLog -> WriterT MockChainLog [] () forall a b. (a -> b) -> a -> b $ - [MockChainLogEntry] -> MockChainLog + [MockChainLogEntry] -> MockChainLog MockChainLog - [ SkelContext -> TxSkel -> MockChainLogEntry + [ SkelContext -> TxSkel -> MockChainLogEntry MCLogSubmittedTxSkel - (Map TxOutRef TxOut -> Map DatumHash TxSkelOutDatum -> SkelContext + (Map TxOutRef TxOut -> Map DatumHash TxSkelOutDatum -> SkelContext SkelContext (TxOut -> TxOut txOutV2FromLedger (TxOut -> TxOut) -> Map TxOutRef TxOut -> Map TxOutRef TxOut forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Map TxOutRef TxOut -managedTxOuts) (Map DatumHash TxSkelOutDatum -> SkelContext) +managedTxOuts) (Map DatumHash TxSkelOutDatum -> SkelContext) -> Map DatumHash TxSkelOutDatum -> SkelContext forall a b. (a -> b) -> a -> b $ ((TxSkelOutDatum, Integer) -> TxSkelOutDatum) @@ -470,18 +471,18 @@ Map.map (TxSkelOutDatum, Integer) -> TxSkelOutDatum forall a b. (a, b) -> a fst Map DatumHash (TxSkelOutDatum, Integer) -managedDatums) - TxSkel -skel' - ] - CardanoTx -tx <- TxSkel +managedDatums) + TxSkel +skel' + ] + CardanoTx +tx <- TxSkel -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain CardanoTx forall (m :: * -> *). MonadBlockChain m => TxSkel -> m CardanoTx validateTxSkel TxSkel -skel' - MockChainT (WriterT MockChainLog []) () +skel' + MockChainT (WriterT MockChainLog []) () -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain () forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => @@ -492,7 +493,7 @@ -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain () forall a b. (a -> b) -> a -> b $ - WriterT MockChainLog [] () + WriterT MockChainLog [] () -> MockChainT (WriterT MockChainLog []) () forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => @@ -503,63 +504,63 @@ -> MockChainT (WriterT MockChainLog []) () forall a b. (a -> b) -> a -> b $ - MockChainLog -> WriterT MockChainLog [] () + MockChainLog -> WriterT MockChainLog [] () forall w (m :: * -> *). MonadWriter w m => w -> m () tell (MockChainLog -> WriterT MockChainLog [] ()) -> MockChainLog -> WriterT MockChainLog [] () forall a b. (a -> b) -> a -> b $ - [MockChainLogEntry] -> MockChainLog + [MockChainLogEntry] -> MockChainLog MockChainLog [TxId -> MockChainLogEntry MCLogNewTx (TxId -> TxId Ledger.fromCardanoTxId (TxId -> TxId) -> TxId -> TxId forall a b. (a -> b) -> a -> b $ CardanoTx -> TxId Ledger.getCardanoTxId CardanoTx -tx)] - [Ltl (UntypedTweak InterpMockChain)] +tx)] + [Ltl (UntypedTweak InterpMockChain)] -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain () forall s (m :: * -> *). MonadState s m => s -> m () put [Ltl (UntypedTweak InterpMockChain)] -later - CardanoTx +later + CardanoTx -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain CardanoTx forall (m :: * -> *) a. Monad m => a -> m a return CardanoTx -tx - interpBuiltin (TxOutByRefLedger TxOutRef -o) = TxOutRef +tx + interpBuiltin (TxOutByRefLedger TxOutRef +o) = TxOutRef -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain (Maybe TxOut) forall (m :: * -> *). MonadBlockChainBalancing m => TxOutRef -> m (Maybe TxOut) txOutByRefLedger TxOutRef -o - interpBuiltin MockChainBuiltin a +o + interpBuiltin MockChainBuiltin a GetCurrentSlot = StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a forall (m :: * -> *). MonadBlockChainWithoutValidation m => m Slot currentSlot - interpBuiltin (AwaitSlot Slot -s) = Slot + interpBuiltin (AwaitSlot Slot +s) = Slot -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain Slot forall (m :: * -> *). MonadBlockChainWithoutValidation m => Slot -> m Slot awaitSlot Slot -s - interpBuiltin (DatumFromHash DatumHash -h) = DatumHash +s + interpBuiltin (DatumFromHash DatumHash +h) = DatumHash -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain (Maybe Datum) forall (m :: * -> *). MonadBlockChainBalancing m => DatumHash -> m (Maybe Datum) datumFromHash DatumHash -h - interpBuiltin (ValidatorFromHash ValidatorHash -h) = ValidatorHash +h + interpBuiltin (ValidatorFromHash ValidatorHash +h) = ValidatorHash -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain @@ -568,15 +569,15 @@ MonadBlockChainBalancing m => ValidatorHash -> m (Maybe (Versioned Validator)) validatorFromHash ValidatorHash -h - interpBuiltin MockChainBuiltin a +h + interpBuiltin MockChainBuiltin a AllUtxosLedger = StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a forall (m :: * -> *). MonadBlockChainWithoutValidation m => m [(TxOutRef, TxOut)] allUtxosLedger - interpBuiltin (UtxosAtLedger Address -address) = Address + interpBuiltin (UtxosAtLedger Address +address) = Address -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain @@ -585,21 +586,21 @@ MonadBlockChainBalancing m => Address -> m [(TxOutRef, TxOut)] utxosAtLedger Address -address - interpBuiltin MockChainBuiltin a +address + interpBuiltin MockChainBuiltin a Empty = StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a forall (m :: * -> *) a. MonadPlus m => m a mzero - interpBuiltin (Alt StagedMockChain a -l StagedMockChain a -r) = StagedMockChain a + interpBuiltin (Alt StagedMockChain a +l StagedMockChain a +r) = StagedMockChain a -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a forall modification (builtin :: * -> *) (m :: * -> *) a. InterpLtl modification builtin m => Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a interpLtl StagedMockChain a -l StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a +l StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a forall (m :: * -> *) a. MonadPlus m => m a -> m a -> m a @@ -610,10 +611,10 @@ Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a interpLtl StagedMockChain a -r - interpBuiltin (Fail String -msg) = do - MockChainT (WriterT MockChainLog []) () +r + interpBuiltin (Fail String +msg) = do + MockChainT (WriterT MockChainLog []) () -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain () forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => @@ -641,21 +642,21 @@ $ [MockChainLogEntry] -> MockChainLog MockChainLog [String -> MockChainLogEntry MCLogFail String -msg] - String +msg] + String -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a forall (m :: * -> *) a. MonadFail m => String -> m a fail String -msg - interpBuiltin (ThrowError MockChainError -err) = MockChainError +msg + interpBuiltin (ThrowError MockChainError +err) = MockChainError -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a forall e (m :: * -> *) a. MonadError e m => e -> m a throwError MockChainError -err - interpBuiltin (CatchError StagedMockChain a -act MockChainError -> StagedMockChain a -handler) = StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a +err + interpBuiltin (CatchError StagedMockChain a +act MockChainError -> StagedMockChain a +handler) = StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a -> (MockChainError -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a) -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a @@ -669,7 +670,7 @@ Staged (LtlOp modification builtin) a -> StateT [Ltl modification] m a interpLtl StagedMockChain a -act) (StagedMockChain a +act) (StagedMockChain a -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a forall modification (builtin :: * -> *) (m :: * -> *) a. InterpLtl modification builtin m => @@ -682,12 +683,12 @@ -> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a forall b c a. (b -> c) -> (a -> b) -> a -> c . MockChainError -> StagedMockChain a -handler) - --- ** Helpers to run tweaks for use in tests for tweaks - -runTweak :: Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)] -runTweak :: Tweak InterpMockChain a +handler) + +-- ** Helpers to run tweaks for use in tests for tweaks + +runTweak :: Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)] +runTweak :: Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)] runTweak = MockChainEnv -> MockChainSt @@ -705,19 +706,19 @@ def MockChainSt forall a. Default a => a def - -runTweakFrom :: MockChainEnv -> MockChainSt -> Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)] -runTweakFrom :: MockChainEnv + +runTweakFrom :: MockChainEnv -> MockChainSt -> Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)] +runTweakFrom :: MockChainEnv -> MockChainSt -> Tweak InterpMockChain a -> TxSkel -> [Either MockChainError (a, TxSkel)] -runTweakFrom MockChainEnv -mcenv MockChainSt -mcst Tweak InterpMockChain a -tweak TxSkel -skel = - ((Either MockChainError ((a, TxSkel), MockChainSt), MockChainLog) +runTweakFrom MockChainEnv +mcenv MockChainSt +mcst Tweak InterpMockChain a +tweak TxSkel +skel = + ((Either MockChainError ((a, TxSkel), MockChainSt), MockChainLog) -> Either MockChainError (a, TxSkel)) -> [(Either MockChainError ((a, TxSkel), MockChainSt), MockChainLog)] @@ -743,7 +744,7 @@ -> Either MockChainError ((a, TxSkel), MockChainSt) forall a b. (a, b) -> a fst) - ([(Either MockChainError ((a, TxSkel), MockChainSt), MockChainLog)] + ([(Either MockChainError ((a, TxSkel), MockChainSt), MockChainLog)] -> [Either MockChainError (a, TxSkel)]) -> (MockChainT (WriterT MockChainLog []) (a, TxSkel) -> [(Either MockChainError ((a, TxSkel), MockChainSt), @@ -757,7 +758,7 @@ MockChainLog)] forall w (m :: * -> *) a. WriterT w m a -> m (a, w) runWriterT - (WriterT + (WriterT MockChainLog [] (Either MockChainError ((a, TxSkel), MockChainSt)) -> [(Either MockChainError ((a, TxSkel), MockChainSt), MockChainLog)]) @@ -780,9 +781,9 @@ -> MockChainT m a -> m (Either MockChainError (a, MockChainSt)) runMockChainTRaw MockChainEnv -mcenv MockChainSt -mcst - (MockChainT (WriterT MockChainLog []) (a, TxSkel) +mcenv MockChainSt +mcst + (MockChainT (WriterT MockChainLog []) (a, TxSkel) -> [Either MockChainError (a, TxSkel)]) -> MockChainT (WriterT MockChainLog []) (a, TxSkel) -> [Either MockChainError (a, TxSkel)] @@ -793,97 +794,175 @@ (MonadBlockChainWithoutValidation m, MonadPlus m) => Tweak m a -> TxSkel -> m (a, TxSkel) runTweakInChain Tweak InterpMockChain a -tweak TxSkel -skel - --- ** Modalities - --- | A modal mock chain is a mock chain that allows us to use LTL modifications --- with 'Tweak's -type MonadModalBlockChain m = (MonadBlockChain m, MonadModal m, Modification m ~ UntypedTweak InterpMockChain) - --- | Apply a 'Tweak' to some transaction in the given Trace. The tweak must --- apply at least once. -somewhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a -somewhere :: Tweak InterpMockChain b -> m a -> m a -somewhere Tweak InterpMockChain b -x = Ltl (Modification m) -> m a -> m a +tweak TxSkel +skel + +-- ** Modalities + +-- | A modal mock chain is a mock chain that allows us to use LTL modifications +-- with 'Tweak's +type MonadModalBlockChain m = (MonadBlockChain m, MonadModal m, Modification m ~ UntypedTweak InterpMockChain) + +-- | Apply a 'Tweak' to some transaction in the given Trace. The tweak must +-- apply at least once. +somewhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a +somewhere :: Tweak InterpMockChain b -> m a -> m a +somewhere = Ltl (UntypedTweak InterpMockChain) -> m a -> m a forall (m :: * -> *) a. MonadModal m => Ltl (Modification m) -> m a -> m a -modifyLtl (Ltl (UntypedTweak InterpMockChain) -forall a. Ltl a -LtlTruth Ltl (UntypedTweak InterpMockChain) +modifyLtl (Ltl (UntypedTweak InterpMockChain) -> m a -> m a) +-> (Tweak InterpMockChain b -> Ltl (UntypedTweak InterpMockChain)) +-> Tweak InterpMockChain b +-> m a +-> m a +forall b c a. (b -> c) -> (a -> b) -> a -> c +. Ltl (UntypedTweak InterpMockChain) -> Ltl (UntypedTweak InterpMockChain) -> Ltl (UntypedTweak InterpMockChain) forall a. Ltl a -> Ltl a -> Ltl a -`LtlUntil` UntypedTweak InterpMockChain -> Ltl (UntypedTweak InterpMockChain) +LtlUntil Ltl (UntypedTweak InterpMockChain) +forall a. Ltl a +LtlTruth (Ltl (UntypedTweak InterpMockChain) + -> Ltl (UntypedTweak InterpMockChain)) +-> (Tweak InterpMockChain b -> Ltl (UntypedTweak InterpMockChain)) +-> Tweak InterpMockChain b +-> Ltl (UntypedTweak InterpMockChain) +forall b c a. (b -> c) -> (a -> b) -> a -> c +. UntypedTweak InterpMockChain -> Ltl (UntypedTweak InterpMockChain) forall a. a -> Ltl a -LtlAtom (Tweak InterpMockChain b -> UntypedTweak InterpMockChain +LtlAtom (UntypedTweak InterpMockChain + -> Ltl (UntypedTweak InterpMockChain)) +-> (Tweak InterpMockChain b -> UntypedTweak InterpMockChain) +-> Tweak InterpMockChain b +-> Ltl (UntypedTweak InterpMockChain) +forall b c a. (b -> c) -> (a -> b) -> a -> c +. Tweak InterpMockChain b -> UntypedTweak InterpMockChain forall (m :: * -> *) a. Tweak m a -> UntypedTweak m -UntypedTweak Tweak InterpMockChain b -x)) - --- | Apply a 'Tweak' to every transaction in a given trace. This is also --- successful if there are no transactions at all. -everywhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a -everywhere :: Tweak InterpMockChain b -> m a -> m a -everywhere Tweak InterpMockChain b -x = Ltl (Modification m) -> m a -> m a +UntypedTweak + +-- | Apply a 'Tweak' to every transaction in a given trace. This is also +-- successful if there are no transactions at all. +everywhere :: MonadModalBlockChain m => Tweak InterpMockChain b -> m a -> m a +everywhere :: Tweak InterpMockChain b -> m a -> m a +everywhere = Ltl (UntypedTweak InterpMockChain) -> m a -> m a forall (m :: * -> *) a. MonadModal m => Ltl (Modification m) -> m a -> m a -modifyLtl (Ltl (UntypedTweak InterpMockChain) -forall a. Ltl a -LtlFalsity Ltl (UntypedTweak InterpMockChain) +modifyLtl (Ltl (UntypedTweak InterpMockChain) -> m a -> m a) +-> (Tweak InterpMockChain b -> Ltl (UntypedTweak InterpMockChain)) +-> Tweak InterpMockChain b +-> m a +-> m a +forall b c a. (b -> c) -> (a -> b) -> a -> c +. Ltl (UntypedTweak InterpMockChain) -> Ltl (UntypedTweak InterpMockChain) -> Ltl (UntypedTweak InterpMockChain) forall a. Ltl a -> Ltl a -> Ltl a -`LtlRelease` UntypedTweak InterpMockChain -> Ltl (UntypedTweak InterpMockChain) +LtlRelease Ltl (UntypedTweak InterpMockChain) +forall a. Ltl a +LtlFalsity (Ltl (UntypedTweak InterpMockChain) + -> Ltl (UntypedTweak InterpMockChain)) +-> (Tweak InterpMockChain b -> Ltl (UntypedTweak InterpMockChain)) +-> Tweak InterpMockChain b +-> Ltl (UntypedTweak InterpMockChain) +forall b c a. (b -> c) -> (a -> b) -> a -> c +. UntypedTweak InterpMockChain -> Ltl (UntypedTweak InterpMockChain) forall a. a -> Ltl a -LtlAtom (Tweak InterpMockChain b -> UntypedTweak InterpMockChain +LtlAtom (UntypedTweak InterpMockChain + -> Ltl (UntypedTweak InterpMockChain)) +-> (Tweak InterpMockChain b -> UntypedTweak InterpMockChain) +-> Tweak InterpMockChain b +-> Ltl (UntypedTweak InterpMockChain) +forall b c a. (b -> c) -> (a -> b) -> a -> c +. Tweak InterpMockChain b -> UntypedTweak InterpMockChain forall (m :: * -> *) a. Tweak m a -> UntypedTweak m -UntypedTweak Tweak InterpMockChain b -x)) - --- | Apply a 'Tweak' to the next transaction in the given trace. The order of --- arguments is reversed compared to 'somewhere' and 'everywhere', because that --- enables an idiom like --- --- > do ... --- > endpoint arguments `withTweak` someModification --- > ... --- --- where @endpoint@ builds and validates a single transaction depending on the --- given @arguments@. Then `withTweak` says "I want to modify the transaction --- returned by this endpoint in the following way". -withTweak :: MonadModalBlockChain m => m x -> Tweak InterpMockChain a -> m x -withTweak :: m x -> Tweak InterpMockChain a -> m x -withTweak m x -trace Tweak InterpMockChain a -tweak = Ltl (Modification m) -> m x -> m x +UntypedTweak + +-- | Apply a 'Tweak' to the nth transaction in a given trace, 0 indexed. +-- Only successful when this transaction exists and can be modified. +there :: MonadModalBlockChain m => Integer -> Tweak InterpMockChain b -> m a -> m a +there :: Integer -> Tweak InterpMockChain b -> m a -> m a +there Integer +n = Ltl (UntypedTweak InterpMockChain) -> m a -> m a forall (m :: * -> *) a. MonadModal m => Ltl (Modification m) -> m a -> m a -modifyLtl (UntypedTweak InterpMockChain -> Ltl (UntypedTweak InterpMockChain) +modifyLtl (Ltl (UntypedTweak InterpMockChain) -> m a -> m a) +-> (Tweak InterpMockChain b -> Ltl (UntypedTweak InterpMockChain)) +-> Tweak InterpMockChain b +-> m a +-> m a +forall b c a. (b -> c) -> (a -> b) -> a -> c +. Integer +-> Tweak InterpMockChain b -> Ltl (UntypedTweak InterpMockChain) +forall t (m :: * -> *) a. +(Eq t, Num t) => +t -> Tweak m a -> Ltl (UntypedTweak m) +mkLtlFormula Integer +n + where + mkLtlFormula :: t -> Tweak m a -> Ltl (UntypedTweak m) +mkLtlFormula t +x = + if t +x t -> t -> Bool +forall a. Eq a => a -> a -> Bool +== t +0 + then UntypedTweak m -> Ltl (UntypedTweak m) forall a. a -> Ltl a -LtlAtom (UntypedTweak InterpMockChain - -> Ltl (UntypedTweak InterpMockChain)) --> UntypedTweak InterpMockChain --> Ltl (UntypedTweak InterpMockChain) -forall a b. (a -> b) -> a -> b -$ Tweak InterpMockChain a -> UntypedTweak InterpMockChain +LtlAtom (UntypedTweak m -> Ltl (UntypedTweak m)) +-> (Tweak m a -> UntypedTweak m) +-> Tweak m a +-> Ltl (UntypedTweak m) +forall b c a. (b -> c) -> (a -> b) -> a -> c +. Tweak m a -> UntypedTweak m forall (m :: * -> *) a. Tweak m a -> UntypedTweak m -UntypedTweak Tweak InterpMockChain a -tweak) m x -trace - --- * 'MonadBlockChain' and 'MonadMockChain' instances - -singletonBuiltin :: builtin a -> Staged (LtlOp modification builtin) a -singletonBuiltin :: builtin a -> Staged (LtlOp modification builtin) a -singletonBuiltin builtin a -b = LtlOp modification builtin a +UntypedTweak + else Ltl (UntypedTweak m) -> Ltl (UntypedTweak m) +forall a. Ltl a -> Ltl a +LtlNext (Ltl (UntypedTweak m) -> Ltl (UntypedTweak m)) +-> (Tweak m a -> Ltl (UntypedTweak m)) +-> Tweak m a +-> Ltl (UntypedTweak m) +forall b c a. (b -> c) -> (a -> b) -> a -> c +. t -> Tweak m a -> Ltl (UntypedTweak m) +mkLtlFormula (t +x t -> t -> t +forall a. Num a => a -> a -> a +- t +1) + +-- | Apply a 'Tweak' to the next transaction in the given trace. The order of +-- arguments is reversed compared to 'somewhere' and 'everywhere', because that +-- enables an idiom like +-- +-- > do ... +-- > endpoint arguments `withTweak` someModification +-- > ... +-- +-- where @endpoint@ builds and validates a single transaction depending on the +-- given @arguments@. Then `withTweak` says "I want to modify the transaction +-- returned by this endpoint in the following way". +withTweak :: MonadModalBlockChain m => m x -> Tweak InterpMockChain a -> m x +withTweak :: m x -> Tweak InterpMockChain a -> m x +withTweak = (Tweak InterpMockChain a -> m x -> m x) +-> m x -> Tweak InterpMockChain a -> m x +forall a b c. (a -> b -> c) -> b -> a -> c +flip (Integer -> Tweak InterpMockChain a -> m x -> m x +forall (m :: * -> *) b a. +MonadModalBlockChain m => +Integer -> Tweak InterpMockChain b -> m a -> m a +there Integer +0) + +-- * 'MonadBlockChain' and 'MonadMockChain' instances + +singletonBuiltin :: builtin a -> Staged (LtlOp modification builtin) a +singletonBuiltin :: builtin a -> Staged (LtlOp modification builtin) a +singletonBuiltin builtin a +b = LtlOp modification builtin a -> (a -> Staged (LtlOp modification builtin) a) -> Staged (LtlOp modification builtin) a forall (op :: * -> *) a b. @@ -892,13 +971,13 @@ forall (builtin :: * -> *) a modification. builtin a -> LtlOp modification builtin a Builtin builtin a -b) a -> Staged (LtlOp modification builtin) a +b) a -> Staged (LtlOp modification builtin) a forall a (op :: * -> *). a -> Staged op a Return - -instance MonadError MockChainError StagedMockChain where - throwError :: MockChainError -> StagedMockChain a -throwError = MockChainBuiltin a -> StagedMockChain a + +instance MonadError MockChainError StagedMockChain where + throwError :: MockChainError -> StagedMockChain a +throwError = MockChainBuiltin a -> StagedMockChain a forall (builtin :: * -> *) a modification. builtin a -> Staged (LtlOp modification builtin) a singletonBuiltin (MockChainBuiltin a -> StagedMockChain a) @@ -909,11 +988,11 @@ . MockChainError -> MockChainBuiltin a forall a. MockChainError -> MockChainBuiltin a ThrowError - catchError :: StagedMockChain a + catchError :: StagedMockChain a -> (MockChainError -> StagedMockChain a) -> StagedMockChain a -catchError StagedMockChain a -act MockChainError -> StagedMockChain a -handler = MockChainBuiltin a -> StagedMockChain a +catchError StagedMockChain a +act MockChainError -> StagedMockChain a +handler = MockChainBuiltin a -> StagedMockChain a forall (builtin :: * -> *) a modification. builtin a -> Staged (LtlOp modification builtin) a singletonBuiltin (MockChainBuiltin a -> StagedMockChain a) @@ -925,18 +1004,18 @@ StagedMockChain a -> (MockChainError -> StagedMockChain a) -> MockChainBuiltin a CatchError StagedMockChain a -act MockChainError -> StagedMockChain a -handler - -instance MonadBlockChainBalancing StagedMockChain where - getParams :: StagedMockChain Params +act MockChainError -> StagedMockChain a +handler + +instance MonadBlockChainBalancing StagedMockChain where + getParams :: StagedMockChain Params getParams = MockChainBuiltin Params -> StagedMockChain Params forall (builtin :: * -> *) a modification. builtin a -> Staged (LtlOp modification builtin) a singletonBuiltin MockChainBuiltin Params GetParams - datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) -datumFromHash = MockChainBuiltin (Maybe Datum) -> StagedMockChain (Maybe Datum) + datumFromHash :: DatumHash -> StagedMockChain (Maybe Datum) +datumFromHash = MockChainBuiltin (Maybe Datum) -> StagedMockChain (Maybe Datum) forall (builtin :: * -> *) a modification. builtin a -> Staged (LtlOp modification builtin) a singletonBuiltin (MockChainBuiltin (Maybe Datum) -> StagedMockChain (Maybe Datum)) @@ -946,8 +1025,8 @@ forall b c a. (b -> c) -> (a -> b) -> a -> c . DatumHash -> MockChainBuiltin (Maybe Datum) DatumFromHash - txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) -txOutByRefLedger = MockChainBuiltin (Maybe TxOut) -> StagedMockChain (Maybe TxOut) + txOutByRefLedger :: TxOutRef -> StagedMockChain (Maybe TxOut) +txOutByRefLedger = MockChainBuiltin (Maybe TxOut) -> StagedMockChain (Maybe TxOut) forall (builtin :: * -> *) a modification. builtin a -> Staged (LtlOp modification builtin) a singletonBuiltin (MockChainBuiltin (Maybe TxOut) -> StagedMockChain (Maybe TxOut)) @@ -957,8 +1036,8 @@ forall b c a. (b -> c) -> (a -> b) -> a -> c . TxOutRef -> MockChainBuiltin (Maybe TxOut) TxOutByRefLedger - utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] -utxosAtLedger = MockChainBuiltin [(TxOutRef, TxOut)] + utxosAtLedger :: Address -> StagedMockChain [(TxOutRef, TxOut)] +utxosAtLedger = MockChainBuiltin [(TxOutRef, TxOut)] -> StagedMockChain [(TxOutRef, TxOut)] forall (builtin :: * -> *) a modification. builtin a -> Staged (LtlOp modification builtin) a @@ -970,8 +1049,8 @@ forall b c a. (b -> c) -> (a -> b) -> a -> c . Address -> MockChainBuiltin [(TxOutRef, TxOut)] UtxosAtLedger - validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) -validatorFromHash = MockChainBuiltin (Maybe (Versioned Validator)) + validatorFromHash :: ValidatorHash -> StagedMockChain (Maybe (Versioned Validator)) +validatorFromHash = MockChainBuiltin (Maybe (Versioned Validator)) -> StagedMockChain (Maybe (Versioned Validator)) forall (builtin :: * -> *) a modification. builtin a -> Staged (LtlOp modification builtin) a @@ -984,23 +1063,23 @@ forall b c a. (b -> c) -> (a -> b) -> a -> c . ValidatorHash -> MockChainBuiltin (Maybe (Versioned Validator)) ValidatorFromHash - -instance MonadBlockChainWithoutValidation StagedMockChain where - allUtxosLedger :: StagedMockChain [(TxOutRef, TxOut)] -allUtxosLedger = MockChainBuiltin [(TxOutRef, TxOut)] + +instance MonadBlockChainWithoutValidation StagedMockChain where + allUtxosLedger :: StagedMockChain [(TxOutRef, TxOut)] +allUtxosLedger = MockChainBuiltin [(TxOutRef, TxOut)] -> StagedMockChain [(TxOutRef, TxOut)] forall (builtin :: * -> *) a modification. builtin a -> Staged (LtlOp modification builtin) a singletonBuiltin MockChainBuiltin [(TxOutRef, TxOut)] AllUtxosLedger - currentSlot :: StagedMockChain Slot -currentSlot = MockChainBuiltin Slot -> StagedMockChain Slot + currentSlot :: StagedMockChain Slot +currentSlot = MockChainBuiltin Slot -> StagedMockChain Slot forall (builtin :: * -> *) a modification. builtin a -> Staged (LtlOp modification builtin) a singletonBuiltin MockChainBuiltin Slot GetCurrentSlot - awaitSlot :: Slot -> StagedMockChain Slot -awaitSlot = MockChainBuiltin Slot -> StagedMockChain Slot + awaitSlot :: Slot -> StagedMockChain Slot +awaitSlot = MockChainBuiltin Slot -> StagedMockChain Slot forall (builtin :: * -> *) a modification. builtin a -> Staged (LtlOp modification builtin) a singletonBuiltin (MockChainBuiltin Slot -> StagedMockChain Slot) @@ -1008,10 +1087,10 @@ forall b c a. (b -> c) -> (a -> b) -> a -> c . Slot -> MockChainBuiltin Slot AwaitSlot - -instance MonadBlockChain StagedMockChain where - validateTxSkel :: TxSkel -> StagedMockChain CardanoTx -validateTxSkel = MockChainBuiltin CardanoTx -> StagedMockChain CardanoTx + +instance MonadBlockChain StagedMockChain where + validateTxSkel :: TxSkel -> StagedMockChain CardanoTx +validateTxSkel = MockChainBuiltin CardanoTx -> StagedMockChain CardanoTx forall (builtin :: * -> *) a modification. builtin a -> Staged (LtlOp modification builtin) a singletonBuiltin (MockChainBuiltin CardanoTx -> StagedMockChain CardanoTx) @@ -1021,4 +1100,4 @@ forall b c a. (b -> c) -> (a -> b) -> a -> c . TxSkel -> MockChainBuiltin CardanoTx ValidateTxSkel - \ No newline at end of file + \ No newline at end of file diff --git a/src/Cooked.MockChain.Testing.html b/src/Cooked.MockChain.Testing.html index 00f8ccc5b..7d3c6407e 100644 --- a/src/Cooked.MockChain.Testing.html +++ b/src/Cooked.MockChain.Testing.html @@ -24,39 +24,39 @@ -- | This module provides a common interface for HUnit and QuickCheck tests. -- We do so by abstracting uses of 'HU.Assertion' and 'QC.Property' for @(IsProp prop) => prop@, -- then provide instances for both @HU.Asserton@ and @QC.Property@. -class IsProp prop where +class IsProp prop where -- | Displays the string to the user in case of failure - testCounterexample :: String -> prop -> prop + testCounterexample :: String -> prop -> prop -- | Conjunction of a number of results - testConjoin :: [prop] -> prop + testConjoin :: [prop] -> prop -- | Disjunction of a number of results - testDisjoin :: [prop] -> prop + testDisjoin :: [prop] -> prop -- | Flags a failure - testFailure :: prop - testFailure = [prop] -> prop + testFailure :: prop + testFailure = [prop] -> prop forall prop. IsProp prop => [prop] -> prop testDisjoin [] -- | Flags a success - testSuccess :: prop - testSuccess = [prop] -> prop + testSuccess :: prop + testSuccess = [prop] -> prop forall prop. IsProp prop => [prop] -> prop testConjoin [] -- | Flags a failure with a message - testFailureMsg :: String -> prop - testFailureMsg String -msg = String -> prop -> prop + testFailureMsg :: String -> prop + testFailureMsg String +msg = String -> prop -> prop forall prop. IsProp prop => String -> prop -> prop testCounterexample String -msg prop +msg prop forall prop. IsProp prop => prop testFailure -testBool :: (IsProp prop) => Bool -> prop +testBool :: (IsProp prop) => Bool -> prop testBool :: Bool -> prop testBool Bool True = prop @@ -67,71 +67,71 @@ forall prop. IsProp prop => prop testFailure -testAll :: (IsProp prop) => (a -> prop) -> [a] -> prop +testAll :: (IsProp prop) => (a -> prop) -> [a] -> prop testAll :: (a -> prop) -> [a] -> prop -testAll a -> prop -f = [prop] -> prop +testAll a -> prop +f = [prop] -> prop forall prop. IsProp prop => [prop] -> prop testConjoin ([prop] -> prop) -> ([a] -> [prop]) -> [a] -> prop forall b c a. (b -> c) -> (a -> b) -> a -> c . (a -> prop) -> [a] -> [prop] forall a b. (a -> b) -> [a] -> [b] map a -> prop -f +f infix 4 .==. -(.==.) :: (IsProp prop, Eq a) => a -> a -> prop -a -a .==. :: a -> a -> prop -.==. a -b = Bool -> prop +(.==.) :: (IsProp prop, Eq a) => a -> a -> prop +a +a .==. :: a -> a -> prop +.==. a +b = Bool -> prop forall prop. IsProp prop => Bool -> prop testBool (Bool -> prop) -> Bool -> prop forall a b. (a -> b) -> a -> b $ a -a a -> a -> Bool +a a -> a -> Bool forall a. Eq a => a -> a -> Bool == a -b +b infixr 3 .&&. -(.&&.) :: (IsProp prop) => prop -> prop -> prop -prop -a .&&. :: prop -> prop -> prop -.&&. prop -b = [prop] -> prop +(.&&.) :: (IsProp prop) => prop -> prop -> prop +prop +a .&&. :: prop -> prop -> prop +.&&. prop +b = [prop] -> prop forall prop. IsProp prop => [prop] -> prop testConjoin [prop -a, prop -b] +a, prop +b] infixr 2 .||. -(.||.) :: (IsProp prop) => prop -> prop -> prop -prop -a .||. :: prop -> prop -> prop -.||. prop -b = [prop] -> prop +(.||.) :: (IsProp prop) => prop -> prop -> prop +prop +a .||. :: prop -> prop -> prop +.||. prop +b = [prop] -> prop forall prop. IsProp prop => [prop] -> prop testDisjoin [prop -a, prop -b] +a, prop +b] -- | Ensure that all results produced by the staged mockchain /succeed/, starting -- from the default initial distribution -testSucceeds :: (IsProp prop) => PrettyCookedOpts -> StagedMockChain a -> prop +testSucceeds :: (IsProp prop) => PrettyCookedOpts -> StagedMockChain a -> prop testSucceeds :: PrettyCookedOpts -> StagedMockChain a -> prop -testSucceeds PrettyCookedOpts -pcOpts = PrettyCookedOpts +testSucceeds PrettyCookedOpts +pcOpts = PrettyCookedOpts -> InitialDistribution -> StagedMockChain a -> prop forall prop a. IsProp prop => PrettyCookedOpts -> InitialDistribution -> StagedMockChain a -> prop testSucceedsFrom PrettyCookedOpts -pcOpts InitialDistribution +pcOpts InitialDistribution forall a. Default a => a def @@ -140,12 +140,12 @@ -- -- To test that validation fails, use -- > testFails def (isCekEvaluationFailure def) e -testFails :: (IsProp prop, Show a) => PrettyCookedOpts -> (MockChainError -> prop) -> StagedMockChain a -> prop +testFails :: (IsProp prop, Show a) => PrettyCookedOpts -> (MockChainError -> prop) -> StagedMockChain a -> prop testFails :: PrettyCookedOpts -> (MockChainError -> prop) -> StagedMockChain a -> prop -testFails PrettyCookedOpts -pcOpts MockChainError -> prop -predi = PrettyCookedOpts +testFails PrettyCookedOpts +pcOpts MockChainError -> prop +predi = PrettyCookedOpts -> (MockChainError -> prop) -> InitialDistribution -> StagedMockChain a @@ -158,24 +158,24 @@ -> StagedMockChain a -> prop testFailsFrom PrettyCookedOpts -pcOpts MockChainError -> prop -predi InitialDistribution +pcOpts MockChainError -> prop +predi InitialDistribution forall a. Default a => a def -- | Ensure that all results produced by the staged mockchain succeed starting -- from some initial distribution but doesn't impose any additional condition on success. -- Use 'testSucceedsFrom'' for that. -testSucceedsFrom :: - (IsProp prop) => +testSucceedsFrom :: + (IsProp prop) => PrettyCookedOpts -> InitialDistribution -> - StagedMockChain a -> - prop + StagedMockChain a -> + prop testSucceedsFrom :: PrettyCookedOpts -> InitialDistribution -> StagedMockChain a -> prop -testSucceedsFrom PrettyCookedOpts -pcOpts = PrettyCookedOpts +testSucceedsFrom PrettyCookedOpts +pcOpts = PrettyCookedOpts -> (a -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a @@ -188,7 +188,7 @@ -> StagedMockChain a -> prop testSucceedsFrom' PrettyCookedOpts -pcOpts (\a +pcOpts (\a _ UtxoState _ -> prop forall prop. IsProp prop => prop @@ -197,21 +197,21 @@ -- | Ensure that all results produced by the staged mockchain succeed starting -- from some initial distribution. Additionally impose a condition over the -- resulting state and value. -testSucceedsFrom' :: - (IsProp prop) => +testSucceedsFrom' :: + (IsProp prop) => PrettyCookedOpts -> - (a -> UtxoState -> prop) -> + (a -> UtxoState -> prop) -> InitialDistribution -> - StagedMockChain a -> - prop + StagedMockChain a -> + prop testSucceedsFrom' :: PrettyCookedOpts -> (a -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a -> prop -testSucceedsFrom' PrettyCookedOpts -pcOpts a -> UtxoState -> prop -prop = PrettyCookedOpts +testSucceedsFrom' PrettyCookedOpts +pcOpts a -> UtxoState -> prop +prop = PrettyCookedOpts -> (Either MockChainError (a, UtxoState) -> prop) -> InitialDistribution -> StagedMockChain a @@ -224,7 +224,7 @@ -> StagedMockChain a -> prop testAllSatisfiesFrom PrettyCookedOpts -pcOpts ((MockChainError -> prop) +pcOpts ((MockChainError -> prop) -> ((a, UtxoState) -> prop) -> Either MockChainError (a, UtxoState) -> prop @@ -239,28 +239,28 @@ renderString (PrettyCookedOpts -> MockChainError -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts)) ((a -> UtxoState -> prop) -> (a, UtxoState) -> prop +pcOpts)) ((a -> UtxoState -> prop) -> (a, UtxoState) -> prop forall a b c. (a -> b -> c) -> (a, b) -> c uncurry a -> UtxoState -> prop -prop)) +prop)) -- | Ensure that all results produced by the staged mockchain /fail/ starting -- from some initial distribution. -testFailsFrom :: - (IsProp prop, Show a) => +testFailsFrom :: + (IsProp prop, Show a) => PrettyCookedOpts -> - (MockChainError -> prop) -> + (MockChainError -> prop) -> InitialDistribution -> - StagedMockChain a -> - prop + StagedMockChain a -> + prop testFailsFrom :: PrettyCookedOpts -> (MockChainError -> prop) -> InitialDistribution -> StagedMockChain a -> prop -testFailsFrom PrettyCookedOpts -pcOpts MockChainError -> prop -predi = +testFailsFrom PrettyCookedOpts +pcOpts MockChainError -> prop +predi = PrettyCookedOpts -> (Either MockChainError (a, UtxoState) -> prop) -> InitialDistribution @@ -275,14 +275,14 @@ -> prop testAllSatisfiesFrom PrettyCookedOpts -pcOpts +pcOpts ((MockChainError -> prop) -> ((a, UtxoState) -> prop) -> Either MockChainError (a, UtxoState) -> prop forall a c b. (a -> c) -> (b -> c) -> Either a b -> c either MockChainError -> prop -predi (String -> prop +predi (String -> prop forall prop. IsProp prop => String -> prop testFailureMsg (String -> prop) -> ((a, UtxoState) -> String) -> (a, UtxoState) -> prop @@ -292,7 +292,7 @@ renderString (PrettyCookedOpts -> (a, UtxoState) -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts))) +pcOpts))) -- | Is satisfied when the given 'MockChainError' is wrapping a @CekEvaluationFailure@. -- This is particularly important when writing negative tests. For example, if we are simulating @@ -300,7 +300,7 @@ -- yielding a test that fails for reasons such as @ValueLessThanMinAda@ or @ValueNotPreserved@, which -- does not rule out the attack being caught by the validator script. For these scenarios it is -- paramount to rely on @testFailsFrom' isCekEvaluationFailure@ instead. -isCekEvaluationFailure :: (IsProp prop) => PrettyCookedOpts -> MockChainError -> prop +isCekEvaluationFailure :: (IsProp prop) => PrettyCookedOpts -> MockChainError -> prop isCekEvaluationFailure :: PrettyCookedOpts -> MockChainError -> prop isCekEvaluationFailure PrettyCookedOpts _ (MCEValidationError (ValidationPhase @@ -308,9 +308,9 @@ _)) = prop forall prop. IsProp prop => prop testSuccess -isCekEvaluationFailure PrettyCookedOpts -pcOpts MockChainError -e = String -> prop +isCekEvaluationFailure PrettyCookedOpts +pcOpts MockChainError +e = String -> prop forall prop. IsProp prop => String -> prop testFailureMsg (String -> prop) -> String -> prop forall a b. (a -> b) -> a -> b @@ -322,32 +322,32 @@ renderString (PrettyCookedOpts -> MockChainError -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts) MockChainError -e +pcOpts) MockChainError +e -- | Similar to 'isCekEvaluationFailure', but enables us to check for a specific error message in the error. -isCekEvaluationFailureWithMsg :: (IsProp prop) => PrettyCookedOpts -> (String -> Bool) -> MockChainError -> prop +isCekEvaluationFailureWithMsg :: (IsProp prop) => PrettyCookedOpts -> (String -> Bool) -> MockChainError -> prop isCekEvaluationFailureWithMsg :: PrettyCookedOpts -> (String -> Bool) -> MockChainError -> prop isCekEvaluationFailureWithMsg PrettyCookedOpts -_ String -> Bool -f (MCEValidationError (ValidationPhase -_, ScriptFailure (EvaluationError [Text] -msgs String +_ String -> Bool +f (MCEValidationError (ValidationPhase +_, ScriptFailure (EvaluationError [Text] +msgs String _))) | (Text -> Bool) -> [Text] -> Bool forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool any (String -> Bool -f (String -> Bool) -> (Text -> String) -> Text -> Bool +f (String -> Bool) -> (Text -> String) -> Text -> Bool forall b c a. (b -> c) -> (a -> b) -> a -> c . Text -> String T.unpack) [Text] -msgs = prop +msgs = prop forall prop. IsProp prop => prop testSuccess -isCekEvaluationFailureWithMsg PrettyCookedOpts -pcOpts String -> Bool -_ MockChainError -e = String -> prop +isCekEvaluationFailureWithMsg PrettyCookedOpts +pcOpts String -> Bool +_ MockChainError +e = String -> prop forall prop. IsProp prop => String -> prop testFailureMsg (String -> prop) -> String -> prop forall a b. (a -> b) -> a -> b @@ -359,28 +359,28 @@ renderString (PrettyCookedOpts -> MockChainError -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts) MockChainError -e +pcOpts) MockChainError +e -- | Ensure that all results produced by the set of traces encoded by the 'StagedMockChain' -- satisfy the given predicate. If you wish to build custom predicates -- you can use 'testSatisfiesFrom'' directly and see 'testBinaryRelatedBy' as an example. testAllSatisfiesFrom :: - forall prop a. - (IsProp prop) => + forall prop a. + (IsProp prop) => PrettyCookedOpts -> - (Either MockChainError (a, UtxoState) -> prop) -> + (Either MockChainError (a, UtxoState) -> prop) -> InitialDistribution -> - StagedMockChain a -> - prop + StagedMockChain a -> + prop testAllSatisfiesFrom :: PrettyCookedOpts -> (Either MockChainError (a, UtxoState) -> prop) -> InitialDistribution -> StagedMockChain a -> prop -testAllSatisfiesFrom PrettyCookedOpts -pcOpts Either MockChainError (a, UtxoState) -> prop -f = ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) +testAllSatisfiesFrom PrettyCookedOpts +pcOpts Either MockChainError (a, UtxoState) -> prop +f = ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) -> InitialDistribution -> StagedMockChain a -> prop forall a prop. ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) @@ -389,23 +389,23 @@ -> [(Either MockChainError (a, UtxoState), MockChainLog)] -> prop forall prop a. IsProp prop => (a -> prop) -> [a] -> prop testAll (Either MockChainError (a, UtxoState), MockChainLog) -> prop -go) +go) where - go :: (Either MockChainError (a, UtxoState), MockChainLog) -> prop - go :: (Either MockChainError (a, UtxoState), MockChainLog) -> prop -go (Either MockChainError (a, UtxoState) -prop, MockChainLog -mcLog) = String -> prop -> prop + go :: (Either MockChainError (a, UtxoState), MockChainLog) -> prop + go :: (Either MockChainError (a, UtxoState), MockChainLog) -> prop +go (Either MockChainError (a, UtxoState) +prop, MockChainLog +mcLog) = String -> prop -> prop forall prop. IsProp prop => String -> prop -> prop testCounterexample ((MockChainLog -> DocCooked) -> MockChainLog -> String forall a. (a -> DocCooked) -> a -> String renderString (PrettyCookedOpts -> MockChainLog -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts) MockChainLog -mcLog) (Either MockChainError (a, UtxoState) -> prop -f Either MockChainError (a, UtxoState) -prop) +pcOpts) MockChainLog +mcLog) (Either MockChainError (a, UtxoState) -> prop +f Either MockChainError (a, UtxoState) +prop) -- | Asserts that the given 'StagedMockChain' produces exactly two outcomes, both of which -- are successful and have their resulting states related by a given predicate. A typical @@ -414,21 +414,21 @@ -- > testBinaryRelatedBy equalModuloAda myInitDistr $ do -- > x <- trPrepare -- > execOption1 x <|> execOption2 x -testBinaryRelatedBy :: - (IsProp prop) => +testBinaryRelatedBy :: + (IsProp prop) => PrettyCookedOpts -> - (UtxoState -> UtxoState -> prop) -> + (UtxoState -> UtxoState -> prop) -> InitialDistribution -> - StagedMockChain a -> - prop + StagedMockChain a -> + prop testBinaryRelatedBy :: PrettyCookedOpts -> (UtxoState -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a -> prop -testBinaryRelatedBy PrettyCookedOpts -pcOpts UtxoState -> UtxoState -> prop -rel = ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) +testBinaryRelatedBy PrettyCookedOpts +pcOpts UtxoState -> UtxoState -> prop +rel = ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) -> InitialDistribution -> StagedMockChain a -> prop forall a prop. ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) @@ -441,25 +441,25 @@ -> prop forall a b. (a -> b) -> a -> b $ \case - [(Either MockChainError (a, UtxoState) -ra, MockChainLog -ta), (Either MockChainError (a, UtxoState) -rb, MockChainLog -tb)] -> case (Either MockChainError (a, UtxoState) -ra, Either MockChainError (a, UtxoState) -rb) of - (Right (a, UtxoState) -resA, Right (a, UtxoState) -resB) -> UtxoState -> UtxoState -> prop -rel ((a, UtxoState) -> UtxoState + [(Either MockChainError (a, UtxoState) +ra, MockChainLog +ta), (Either MockChainError (a, UtxoState) +rb, MockChainLog +tb)] -> case (Either MockChainError (a, UtxoState) +ra, Either MockChainError (a, UtxoState) +rb) of + (Right (a, UtxoState) +resA, Right (a, UtxoState) +resB) -> UtxoState -> UtxoState -> prop +rel ((a, UtxoState) -> UtxoState forall a b. (a, b) -> b snd (a, UtxoState) -resA) ((a, UtxoState) -> UtxoState +resA) ((a, UtxoState) -> UtxoState forall a b. (a, b) -> b snd (a, UtxoState) -resB) - (Left MockChainError -errA, Right (a, UtxoState) +resB) + (Left MockChainError +errA, Right (a, UtxoState) _) -> String -> prop forall prop. IsProp prop => String -> prop @@ -473,18 +473,18 @@ renderString (PrettyCookedOpts -> MockChainError -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts) MockChainError -errA, String +pcOpts) MockChainError +errA, String "\n", (MockChainLog -> DocCooked) -> MockChainLog -> String forall a. (a -> DocCooked) -> a -> String renderString (PrettyCookedOpts -> MockChainLog -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts) MockChainLog -ta] +pcOpts) MockChainLog +ta] (Right (a, UtxoState) -_, Left MockChainError -errB) -> +_, Left MockChainError +errB) -> String -> prop forall prop. IsProp prop => String -> prop testFailureMsg (String -> prop) -> String -> prop @@ -497,18 +497,18 @@ renderString (PrettyCookedOpts -> MockChainError -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts) MockChainError -errB, String +pcOpts) MockChainError +errB, String "\n", (MockChainLog -> DocCooked) -> MockChainLog -> String forall a. (a -> DocCooked) -> a -> String renderString (PrettyCookedOpts -> MockChainLog -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts) MockChainLog -tb] - (Left MockChainError -errA, Left MockChainError -errB) -> +pcOpts) MockChainLog +tb] + (Left MockChainError +errA, Left MockChainError +errB) -> String -> prop forall prop. IsProp prop => String -> prop testFailureMsg (String -> prop) -> String -> prop @@ -524,8 +524,8 @@ renderString (PrettyCookedOpts -> MockChainError -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts) MockChainError -errA, +pcOpts) MockChainError +errA, String "; ", (MockChainError -> DocCooked) -> MockChainError -> String @@ -533,8 +533,8 @@ renderString (PrettyCookedOpts -> MockChainError -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts) MockChainError -errB, +pcOpts) MockChainError +errB, String "\n First: ", (MockChainLog -> DocCooked) -> MockChainLog -> String @@ -542,8 +542,8 @@ renderString (PrettyCookedOpts -> MockChainLog -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts) MockChainLog -ta, +pcOpts) MockChainLog +ta, String "\nSecond: ", (MockChainLog -> DocCooked) -> MockChainLog -> String @@ -551,11 +551,11 @@ renderString (PrettyCookedOpts -> MockChainLog -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts) MockChainLog -tb +pcOpts) MockChainLog +tb ] - [(Either MockChainError (a, UtxoState), MockChainLog)] -xs -> String -> prop + [(Either MockChainError (a, UtxoState), MockChainLog)] +xs -> String -> prop forall prop. IsProp prop => String -> prop testFailureMsg (String -> prop) -> String -> prop forall a b. (a -> b) -> a -> b @@ -567,7 +567,7 @@ show ([(Either MockChainError (a, UtxoState), MockChainLog)] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int length [(Either MockChainError (a, UtxoState), MockChainLog)] -xs) +xs) -- | Generalizes 'testBinaryRelatedBy', asserting that the given 'StagedMockChain' produces -- more than two outcomes, say @[x,y,z,w]@, all of which are successful (i.e. are not a 'MockChainError') @@ -577,21 +577,21 @@ -- -- Because @(~)@ should be symmetric and transitive we can estabilish that these states all belong -- to the same equivalence class. This function does /not/ check each pointwise case. -testOneEquivClass :: - (IsProp prop) => +testOneEquivClass :: + (IsProp prop) => PrettyCookedOpts -> - (UtxoState -> UtxoState -> prop) -> + (UtxoState -> UtxoState -> prop) -> InitialDistribution -> - StagedMockChain a -> - prop + StagedMockChain a -> + prop testOneEquivClass :: PrettyCookedOpts -> (UtxoState -> UtxoState -> prop) -> InitialDistribution -> StagedMockChain a -> prop -testOneEquivClass PrettyCookedOpts -pcOpts UtxoState -> UtxoState -> prop -rel = ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) +testOneEquivClass PrettyCookedOpts +pcOpts UtxoState -> UtxoState -> prop +rel = ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) -> InitialDistribution -> StagedMockChain a -> prop forall a prop. ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) @@ -613,9 +613,9 @@ forall prop. IsProp prop => String -> prop testFailureMsg String "Expected two of more outcomes, received: 1" - ((Left MockChainError -errX, MockChainLog -tx) : [(Either MockChainError (a, UtxoState), MockChainLog)] + ((Left MockChainError +errX, MockChainLog +tx) : [(Either MockChainError (a, UtxoState), MockChainLog)] _) -> String -> prop forall prop. IsProp prop => String -> prop testFailureMsg (String -> prop) -> String -> prop @@ -628,40 +628,40 @@ renderString (PrettyCookedOpts -> MockChainError -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts) MockChainError -errX, String +pcOpts) MockChainError +errX, String "\n", (MockChainLog -> DocCooked) -> MockChainLog -> String forall a. (a -> DocCooked) -> a -> String renderString (PrettyCookedOpts -> MockChainLog -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts) MockChainLog -tx] - ((Right (a, UtxoState) -resX, MockChainLog -_) : [(Either MockChainError (a, UtxoState), MockChainLog)] -xs) -> UtxoState +pcOpts) MockChainLog +tx] + ((Right (a, UtxoState) +resX, MockChainLog +_) : [(Either MockChainError (a, UtxoState), MockChainLog)] +xs) -> UtxoState -> [(Either MockChainError (a, UtxoState), MockChainLog)] -> prop forall a a a. (PrettyCooked a, PrettyCooked a) => UtxoState -> [(Either a (a, UtxoState), a)] -> prop -go ((a, UtxoState) -> UtxoState +go ((a, UtxoState) -> UtxoState forall a b. (a, b) -> b snd (a, UtxoState) -resX) [(Either MockChainError (a, UtxoState), MockChainLog)] -xs +resX) [(Either MockChainError (a, UtxoState), MockChainLog)] +xs where -- we can flag a success here because 'xs' above is guarnateed to have at least -- one element since we ruled out the empty and the singleton lists in the \case - go :: UtxoState -> [(Either a (a, UtxoState), a)] -> prop -go UtxoState -_resX [] = prop + go :: UtxoState -> [(Either a (a, UtxoState), a)] -> prop +go UtxoState +_resX [] = prop forall prop. IsProp prop => prop testSuccess - go UtxoState -_resX ((Left a -errY, a -ty) : [(Either a (a, UtxoState), a)] + go UtxoState +_resX ((Left a +errY, a +ty) : [(Either a (a, UtxoState), a)] _) = String -> prop forall prop. IsProp prop => String -> prop testFailureMsg (String -> prop) -> String -> prop @@ -674,29 +674,29 @@ renderString (PrettyCookedOpts -> a -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts) a -errY, String +pcOpts) a +errY, String "\n", (a -> DocCooked) -> a -> String forall a. (a -> DocCooked) -> a -> String renderString (PrettyCookedOpts -> a -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -pcOpts) a -ty] - go UtxoState -resX ((Right (a -_, UtxoState -resY), a -_) : [(Either a (a, UtxoState), a)] -ys) = [prop] -> prop +pcOpts) a +ty] + go UtxoState +resX ((Right (a +_, UtxoState +resY), a +_) : [(Either a (a, UtxoState), a)] +ys) = [prop] -> prop forall prop. IsProp prop => [prop] -> prop testConjoin [UtxoState -> UtxoState -> prop -rel UtxoState -resX UtxoState -resY, UtxoState -> [(Either a (a, UtxoState), a)] -> prop -go UtxoState -resX [(Either a (a, UtxoState), a)] -ys] +rel UtxoState +resX UtxoState +resY, UtxoState -> [(Either a (a, UtxoState), a)] -> prop +go UtxoState +resX [(Either a (a, UtxoState), a)] +ys] -- | Asserts that the results produced by running the given 'StagedMockChain' from -- some speficied 'InitialDistribution' satisfy a given assertion. In this case, @@ -706,17 +706,17 @@ -- Although this function is mainly used internally, as a building block for the simpler predicates, -- it can be useful in building some custom predicates. Check 'testAllSatisfiesFrom' -- or 'testBinaryRelatedBy' for examples on using this. -testSatisfiesFrom' :: - ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) -> +testSatisfiesFrom' :: + ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) -> InitialDistribution -> - StagedMockChain a -> - prop + StagedMockChain a -> + prop testSatisfiesFrom' :: ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) -> InitialDistribution -> StagedMockChain a -> prop -testSatisfiesFrom' [(Either MockChainError (a, UtxoState), MockChainLog)] -> prop -predi InitialDistribution -i0 = [(Either MockChainError (a, UtxoState), MockChainLog)] -> prop -predi ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) +testSatisfiesFrom' [(Either MockChainError (a, UtxoState), MockChainLog)] -> prop +predi InitialDistribution +i0 = [(Either MockChainError (a, UtxoState), MockChainLog)] -> prop +predi ([(Either MockChainError (a, UtxoState), MockChainLog)] -> prop) -> (StagedMockChain a -> [(Either MockChainError (a, UtxoState), MockChainLog)]) -> StagedMockChain a @@ -737,7 +737,7 @@ InitialDistribution -> MockChainT m a -> m (Either MockChainError (a, UtxoState)) runMockChainTFrom InitialDistribution -i0) +i0) -- * 'TestResult' instances @@ -784,9 +784,9 @@ Nothing) instance IsProp HU.Assertion where - testCounterexample :: String -> Assertion -> Assertion -testCounterexample String -msg = Assertion + testCounterexample :: String -> Assertion -> Assertion +testCounterexample String +msg = Assertion -> (HUnitFailure -> Assertion) -> Maybe HUnitFailure -> Assertion forall b a. b -> (a -> b) -> Maybe a -> b maybe Assertion @@ -797,7 +797,7 @@ -> (HUnitFailure -> HUnitFailure) -> HUnitFailure -> Assertion forall b c a. (b -> c) -> (a -> b) -> a -> c . HUnitFailure -> HUnitFailure -adjustMsg) (Maybe HUnitFailure -> Assertion) +adjustMsg) (Maybe HUnitFailure -> Assertion) -> (Assertion -> IO (Maybe HUnitFailure)) -> Assertion -> Assertion forall (m :: * -> *) b c a. Monad m => @@ -805,55 +805,55 @@ <=< Assertion -> IO (Maybe HUnitFailure) assertionToMaybe where - joinMsg :: String -> String - joinMsg :: String -> String -joinMsg String -rest = String -msg String -> String -> String + joinMsg :: String -> String + joinMsg :: String -> String +joinMsg String +rest = String +msg String -> String -> String forall a. [a] -> [a] -> [a] ++ String ";\n" String -> String -> String forall a. [a] -> [a] -> [a] ++ String -rest +rest - adjustMsg :: HU.HUnitFailure -> HU.HUnitFailure - adjustMsg :: HUnitFailure -> HUnitFailure -adjustMsg (HU.HUnitFailure Maybe SrcLoc -loc String -txt) = + adjustMsg :: HU.HUnitFailure -> HU.HUnitFailure + adjustMsg :: HUnitFailure -> HUnitFailure +adjustMsg (HU.HUnitFailure Maybe SrcLoc +loc String +txt) = Maybe SrcLoc -> String -> HUnitFailure HU.HUnitFailure Maybe SrcLoc -loc (String -> String -joinMsg String -txt) +loc (String -> String +joinMsg String +txt) - testFailure :: Assertion -testFailure = String -> Assertion + testFailure :: Assertion +testFailure = String -> Assertion forall a. HasCallStack => String -> IO a HU.assertFailure String "" - testFailureMsg :: String -> Assertion -testFailureMsg = String -> Assertion + testFailureMsg :: String -> Assertion +testFailureMsg = String -> Assertion forall a. HasCallStack => String -> IO a HU.assertFailure - testConjoin :: [Assertion] -> Assertion -testConjoin = [Assertion] -> Assertion + testConjoin :: [Assertion] -> Assertion +testConjoin = [Assertion] -> Assertion forall (t :: * -> *) (m :: * -> *) a. (Foldable t, Monad m) => t (m a) -> m () sequence_ - testDisjoin :: [Assertion] -> Assertion -testDisjoin [] = Assertion + testDisjoin :: [Assertion] -> Assertion +testDisjoin [] = Assertion forall prop. IsProp prop => prop testFailure - testDisjoin (Assertion -x : [Assertion] -xs) = Assertion -> IO (Maybe HUnitFailure) + testDisjoin (Assertion +x : [Assertion] +xs) = Assertion -> IO (Maybe HUnitFailure) assertionToMaybe Assertion -x IO (Maybe HUnitFailure) +x IO (Maybe HUnitFailure) -> (Maybe HUnitFailure -> Assertion) -> Assertion forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= Assertion @@ -862,42 +862,42 @@ maybe ([Assertion] -> Assertion forall prop. IsProp prop => [prop] -> prop testDisjoin [Assertion] -xs) HUnitFailure -> Assertion +xs) HUnitFailure -> Assertion forall a e. Exception e => e -> a E.throw - testSuccess :: Assertion -testSuccess = () -> Assertion + testSuccess :: Assertion +testSuccess = () -> Assertion forall (m :: * -> *) a. Monad m => a -> m a return () -instance IsProp QC.Property where - testCounterexample :: String -> Property -> Property -testCounterexample = String -> Property -> Property +instance IsProp QC.Property where + testCounterexample :: String -> Property -> Property +testCounterexample = String -> Property -> Property forall prop. Testable prop => String -> prop -> Property QC.counterexample - testFailure :: Property -testFailure = Bool -> Property + testFailure :: Property +testFailure = Bool -> Property forall prop. Testable prop => prop -> Property QC.property Bool False - testSuccess :: Property -testSuccess = Bool -> Property + testSuccess :: Property +testSuccess = Bool -> Property forall prop. Testable prop => prop -> Property QC.property Bool True - testConjoin :: [Property] -> Property -testConjoin = [Property] -> Property + testConjoin :: [Property] -> Property +testConjoin = [Property] -> Property forall prop. Testable prop => [prop] -> Property QC.conjoin - testDisjoin :: [Property] -> Property -testDisjoin = [Property] -> Property + testDisjoin :: [Property] -> Property +testDisjoin = [Property] -> Property forall prop. Testable prop => [prop] -> Property QC.disjoin -- | Here we provide our own universsal quantifier instead of 'QC.forAll', so we can monomorphize -- it to returning a 'QC.Property' -forAll :: (Show a) => QC.Gen a -> (a -> QC.Property) -> QC.Property +forAll :: (Show a) => QC.Gen a -> (a -> QC.Property) -> QC.Property forAll :: Gen a -> (a -> Property) -> Property forAll = Gen a -> (a -> Property) -> Property forall a prop. @@ -908,25 +908,25 @@ -- TODO: Discuss this instance; its here to enable us to easily -- run things in a repl but I'm not sure whether to ignore the counterexample -- messages or not. -instance IsProp Bool where - testCounterexample :: String -> Bool -> Bool -testCounterexample String -msg Bool +instance IsProp Bool where + testCounterexample :: String -> Bool -> Bool +testCounterexample String +msg Bool False = String -> Bool -> Bool forall a. String -> a -> a trace String -msg Bool +msg Bool False testCounterexample String _ Bool True = Bool True - testConjoin :: [Bool] -> Bool -testConjoin = [Bool] -> Bool + testConjoin :: [Bool] -> Bool +testConjoin = [Bool] -> Bool forall (t :: * -> *). Foldable t => t Bool -> Bool and - testDisjoin :: [Bool] -> Bool -testDisjoin = [Bool] -> Bool + testDisjoin :: [Bool] -> Bool +testDisjoin = [Bool] -> Bool forall (t :: * -> *). Foldable t => t Bool -> Bool or \ No newline at end of file diff --git a/src/Cooked.MockChain.UtxoSearch.html b/src/Cooked.MockChain.UtxoSearch.html index 9d7c40413..1929f8556 100644 --- a/src/Cooked.MockChain.UtxoSearch.html +++ b/src/Cooked.MockChain.UtxoSearch.html @@ -29,10 +29,10 @@ -- | If a UTxO is a 'TxOutRef' with some additional information, this type -- captures a "stream" of UTxOs. -type UtxoSearch m a = ListT m (Pl2.TxOutRef, a) +type UtxoSearch m a = ListT m (Pl2.TxOutRef, a) -- | Given a UTxO search, we can run it to obtain a list of UTxOs. -runUtxoSearch :: Monad m => UtxoSearch m a -> m [(Pl2.TxOutRef, a)] +runUtxoSearch :: Monad m => UtxoSearch m a -> m [(Pl2.TxOutRef, a)] runUtxoSearch :: UtxoSearch m a -> m [(TxOutRef, a)] runUtxoSearch = UtxoSearch m a -> m [(TxOutRef, a)] forall (m :: * -> *) a. Monad m => ListT m a -> m [a] @@ -40,7 +40,7 @@ -- | Search all currently known 'TxOutRef's together with their corresponding -- 'TxInfo'-'TxOut'. -allUtxosSearch :: MonadBlockChain m => UtxoSearch m Pl2.TxOut +allUtxosSearch :: MonadBlockChain m => UtxoSearch m Pl2.TxOut allUtxosSearch :: UtxoSearch m TxOut allUtxosSearch = ListT m [(TxOutRef, TxOut)] forall (m :: * -> *). @@ -58,7 +58,7 @@ -- | Like 'allUtxosSearch', but returns a Ledger-level representation of the -- transaction outputs, which might contain more information. -allUtxosLedgerSearch :: MonadBlockChain m => UtxoSearch m Ledger.TxOut +allUtxosLedgerSearch :: MonadBlockChain m => UtxoSearch m Ledger.TxOut allUtxosLedgerSearch :: UtxoSearch m TxOut allUtxosLedgerSearch = ListT m [(TxOutRef, TxOut)] forall (m :: * -> *). @@ -76,7 +76,7 @@ -- | Search all 'TxOutRef's at a certain address, together with their -- 'TxInfo'-'TxOut'. -utxosAtSearch :: MonadBlockChainBalancing m => Pl2.Address -> UtxoSearch m Pl2.TxOut +utxosAtSearch :: MonadBlockChainBalancing m => Pl2.Address -> UtxoSearch m Pl2.TxOut utxosAtSearch :: Address -> UtxoSearch m TxOut utxosAtSearch = Address -> ListT m [(TxOutRef, TxOut)] forall (m :: * -> *). @@ -97,7 +97,7 @@ -- | Like 'utxosAtSearch', but returns a Ledger-level representation of the -- transaction outputs, which might contain more information. -utxosAtLedgerSearch :: MonadBlockChainBalancing m => Pl2.Address -> UtxoSearch m Ledger.TxOut +utxosAtLedgerSearch :: MonadBlockChainBalancing m => Pl2.Address -> UtxoSearch m Ledger.TxOut utxosAtLedgerSearch :: Address -> UtxoSearch m TxOut utxosAtLedgerSearch = Address -> ListT m [(TxOutRef, TxOut)] forall (m :: * -> *). @@ -118,7 +118,7 @@ -- | Search all 'TxOutRef's of a transaction, together with their -- 'TxInfo'-'TxOut'. -utxosFromCardanoTxSearch :: Monad m => Ledger.CardanoTx -> UtxoSearch m Pl2.TxOut +utxosFromCardanoTxSearch :: Monad m => Ledger.CardanoTx -> UtxoSearch m Pl2.TxOut utxosFromCardanoTxSearch :: CardanoTx -> UtxoSearch m TxOut utxosFromCardanoTxSearch = [(TxOutRef, TxOut)] -> UtxoSearch m TxOut forall (m :: * -> *) (f :: * -> *) a. @@ -135,26 +135,26 @@ -- | Search all 'TxInfo'-'TxOut's corresponding to given the list of -- 'TxOutRef's. Any 'TxOutRef' that doesn't correspond to a known output will be -- filtered out. -txOutByRefSearch :: MonadBlockChainBalancing m => [Pl2.TxOutRef] -> UtxoSearch m Pl2.TxOut +txOutByRefSearch :: MonadBlockChainBalancing m => [Pl2.TxOutRef] -> UtxoSearch m Pl2.TxOut txOutByRefSearch :: [TxOutRef] -> UtxoSearch m TxOut -txOutByRefSearch [TxOutRef] -orefs = +txOutByRefSearch [TxOutRef] +orefs = (TxOutRef -> m (TxOutRef, TxOutRef)) -> ListT m TxOutRef -> ListT m (TxOutRef, TxOutRef) forall (m :: * -> *) a b. Monad m => (a -> m b) -> ListT m a -> ListT m b -ListT.traverse (\TxOutRef -o -> (TxOutRef, TxOutRef) -> m (TxOutRef, TxOutRef) +ListT.traverse (\TxOutRef +o -> (TxOutRef, TxOutRef) -> m (TxOutRef, TxOutRef) forall (m :: * -> *) a. Monad m => a -> m a return (TxOutRef -o, TxOutRef -o)) ([TxOutRef] -> ListT m TxOutRef +o, TxOutRef +o)) ([TxOutRef] -> ListT m TxOutRef forall (m :: * -> *) (f :: * -> *) a. (Monad m, Foldable f) => f a -> ListT m a ListT.fromFoldable [TxOutRef] -orefs) +orefs) ListT m (TxOutRef, TxOutRef) -> (TxOutRef -> m (Maybe TxOut)) -> UtxoSearch m TxOut forall (m :: * -> *) a b. @@ -170,11 +170,11 @@ -- | Transform a 'UtxoSearch' by applying a possibly failing monadic "lookup" -- on every output. -filterWith :: Monad m => UtxoSearch m a -> (a -> m (Maybe b)) -> UtxoSearch m b +filterWith :: Monad m => UtxoSearch m a -> (a -> m (Maybe b)) -> UtxoSearch m b filterWith :: UtxoSearch m a -> (a -> m (Maybe b)) -> UtxoSearch m b -filterWith (ListT m (Maybe ((TxOutRef, a), UtxoSearch m a)) -as) a -> m (Maybe b) -f = +filterWith (ListT m (Maybe ((TxOutRef, a), UtxoSearch m a)) +as) a -> m (Maybe b) +f = m (Maybe ((TxOutRef, b), UtxoSearch m b)) -> UtxoSearch m b forall (m :: * -> *) a. m (Maybe (a, ListT m a)) -> ListT m a ListT (m (Maybe ((TxOutRef, b), UtxoSearch m b)) -> UtxoSearch m b) @@ -182,7 +182,7 @@ forall a b. (a -> b) -> a -> b $ m (Maybe ((TxOutRef, a), UtxoSearch m a)) -as m (Maybe ((TxOutRef, a), UtxoSearch m a)) +as m (Maybe ((TxOutRef, a), UtxoSearch m a)) -> (Maybe ((TxOutRef, a), UtxoSearch m a) -> m (Maybe ((TxOutRef, b), UtxoSearch m b))) -> m (Maybe ((TxOutRef, b), UtxoSearch m b)) @@ -195,31 +195,31 @@ return Maybe ((TxOutRef, b), UtxoSearch m b) forall a. Maybe a Nothing - Just ((TxOutRef -oref, a -a), UtxoSearch m a -rest) -> - let filteredRest :: UtxoSearch m b -filteredRest@(ListT m (Maybe ((TxOutRef, b), UtxoSearch m b)) -bs) = UtxoSearch m a -> (a -> m (Maybe b)) -> UtxoSearch m b + Just ((TxOutRef +oref, a +a), UtxoSearch m a +rest) -> + let filteredRest :: UtxoSearch m b +filteredRest@(ListT m (Maybe ((TxOutRef, b), UtxoSearch m b)) +bs) = UtxoSearch m a -> (a -> m (Maybe b)) -> UtxoSearch m b forall (m :: * -> *) a b. Monad m => UtxoSearch m a -> (a -> m (Maybe b)) -> UtxoSearch m b filterWith UtxoSearch m a -rest a -> m (Maybe b) -f +rest a -> m (Maybe b) +f in a -> m (Maybe b) -f a -a m (Maybe b) +f a +a m (Maybe b) -> (Maybe b -> m (Maybe ((TxOutRef, b), UtxoSearch m b))) -> m (Maybe ((TxOutRef, b), UtxoSearch m b)) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b >>= \case Maybe b Nothing -> m (Maybe ((TxOutRef, b), UtxoSearch m b)) -bs - Just b -b -> Maybe ((TxOutRef, b), UtxoSearch m b) +bs + Just b +b -> Maybe ((TxOutRef, b), UtxoSearch m b) -> m (Maybe ((TxOutRef, b), UtxoSearch m b)) forall (m :: * -> *) a. Monad m => a -> m a return (Maybe ((TxOutRef, b), UtxoSearch m b) @@ -231,61 +231,61 @@ -> Maybe ((TxOutRef, b), UtxoSearch m b) forall a. a -> Maybe a Just ((TxOutRef -oref, b -b), UtxoSearch m b -filteredRest) +oref, b +b), UtxoSearch m b +filteredRest) -filterWithPure :: Monad m => UtxoSearch m a -> (a -> Maybe b) -> UtxoSearch m b +filterWithPure :: Monad m => UtxoSearch m a -> (a -> Maybe b) -> UtxoSearch m b filterWithPure :: UtxoSearch m a -> (a -> Maybe b) -> UtxoSearch m b -filterWithPure UtxoSearch m a -as a -> Maybe b -f = UtxoSearch m a -> (a -> m (Maybe b)) -> UtxoSearch m b +filterWithPure UtxoSearch m a +as a -> Maybe b +f = UtxoSearch m a -> (a -> m (Maybe b)) -> UtxoSearch m b forall (m :: * -> *) a b. Monad m => UtxoSearch m a -> (a -> m (Maybe b)) -> UtxoSearch m b filterWith UtxoSearch m a -as (Maybe b -> m (Maybe b) +as (Maybe b -> m (Maybe b) forall (m :: * -> *) a. Monad m => a -> m a return (Maybe b -> m (Maybe b)) -> (a -> Maybe b) -> a -> m (Maybe b) forall b c a. (b -> c) -> (a -> b) -> a -> c . a -> Maybe b -f) +f) -filterWithOptic :: (Is k An_AffineFold, Monad m) => UtxoSearch m a -> Optic' k is a b -> UtxoSearch m b +filterWithOptic :: (Is k An_AffineFold, Monad m) => UtxoSearch m a -> Optic' k is a b -> UtxoSearch m b filterWithOptic :: UtxoSearch m a -> Optic' k is a b -> UtxoSearch m b -filterWithOptic UtxoSearch m a -as Optic' k is a b -optic = UtxoSearch m a -> (a -> Maybe b) -> UtxoSearch m b +filterWithOptic UtxoSearch m a +as Optic' k is a b +optic = UtxoSearch m a -> (a -> Maybe b) -> UtxoSearch m b forall (m :: * -> *) a b. Monad m => UtxoSearch m a -> (a -> Maybe b) -> UtxoSearch m b filterWithPure UtxoSearch m a -as (a -> Optic' k is a b -> Maybe b +as (a -> Optic' k is a b -> Maybe b forall k s (is :: IxList) a. Is k An_AffineFold => s -> Optic' k is s a -> Maybe a ^? Optic' k is a b -optic) +optic) -filterWithPred :: Monad m => UtxoSearch m a -> (a -> Bool) -> UtxoSearch m a +filterWithPred :: Monad m => UtxoSearch m a -> (a -> Bool) -> UtxoSearch m a filterWithPred :: UtxoSearch m a -> (a -> Bool) -> UtxoSearch m a -filterWithPred UtxoSearch m a -as a -> Bool -f = UtxoSearch m a -> (a -> Maybe a) -> UtxoSearch m a +filterWithPred UtxoSearch m a +as a -> Bool +f = UtxoSearch m a -> (a -> Maybe a) -> UtxoSearch m a forall (m :: * -> *) a b. Monad m => UtxoSearch m a -> (a -> Maybe b) -> UtxoSearch m b filterWithPure UtxoSearch m a -as ((a -> Maybe a) -> UtxoSearch m a) +as ((a -> Maybe a) -> UtxoSearch m a) -> (a -> Maybe a) -> UtxoSearch m a forall a b. (a -> b) -> a -> b -$ \a -a -> if a -> Bool -f a -a then a -> Maybe a +$ \a +a -> if a -> Bool +f a +a then a -> Maybe a forall a. a -> Maybe a Just a -a else Maybe a +a else Maybe a forall a. Maybe a Nothing \ No newline at end of file diff --git a/src/Cooked.MockChain.UtxoState.html b/src/Cooked.MockChain.UtxoState.html index 6b9971ceb..24caa2aef 100644 --- a/src/Cooked.MockChain.UtxoState.html +++ b/src/Cooked.MockChain.UtxoState.html @@ -19,7 +19,7 @@ -- and they each own a 'UtxoPayloadSet'. newtype UtxoState = UtxoState {UtxoState -> Map Address UtxoPayloadSet utxoState :: Map Pl.Address UtxoPayloadSet} - deriving (UtxoState -> UtxoState -> Bool + deriving (UtxoState -> UtxoState -> Bool (UtxoState -> UtxoState -> Bool) -> (UtxoState -> UtxoState -> Bool) -> Eq UtxoState forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a @@ -32,9 +32,9 @@ -- | Total value accessible to what's pointed by the address. holdsInState :: PV2.Address -> UtxoState -> PV2.Value holdsInState :: Address -> UtxoState -> Value -holdsInState Address -address (UtxoState Map Address UtxoPayloadSet -m) = +holdsInState Address +address (UtxoState Map Address UtxoPayloadSet +m) = Value -> (UtxoPayloadSet -> Value) -> Maybe UtxoPayloadSet -> Value forall b a. b -> (a -> b) -> Maybe a -> b maybe Value @@ -43,14 +43,14 @@ utxoPayloadSetTotal (Address -> Map Address UtxoPayloadSet -> Maybe UtxoPayloadSet forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup Address -address Map Address UtxoPayloadSet -m) +address Map Address UtxoPayloadSet +m) -instance Semigroup UtxoState where - (UtxoState Map Address UtxoPayloadSet -a) <> :: UtxoState -> UtxoState -> UtxoState -<> (UtxoState Map Address UtxoPayloadSet -b) = Map Address UtxoPayloadSet -> UtxoState +instance Semigroup UtxoState where + (UtxoState Map Address UtxoPayloadSet +a) <> :: UtxoState -> UtxoState -> UtxoState +<> (UtxoState Map Address UtxoPayloadSet +b) = Map Address UtxoPayloadSet -> UtxoState UtxoState (Map Address UtxoPayloadSet -> UtxoState) -> Map Address UtxoPayloadSet -> UtxoState forall a b. (a -> b) -> a -> b @@ -62,8 +62,8 @@ Map.unionWith UtxoPayloadSet -> UtxoPayloadSet -> UtxoPayloadSet forall a. Semigroup a => a -> a -> a (<>) Map Address UtxoPayloadSet -a Map Address UtxoPayloadSet -b +a Map Address UtxoPayloadSet +b -- | Represents a /set/ of payloads. newtype UtxoPayloadSet = UtxoPayloadSet @@ -73,7 +73,7 @@ -- and because it is possible that we want to distinguish between utxo states -- that have additional utxos, even if these could have been merged together. } - deriving (Int -> UtxoPayloadSet -> ShowS + deriving (Int -> UtxoPayloadSet -> ShowS [UtxoPayloadSet] -> ShowS UtxoPayloadSet -> String (Int -> UtxoPayloadSet -> ShowS) @@ -101,7 +101,7 @@ UtxoPayload -> Maybe ScriptHash utxoPayloadReferenceScript :: Maybe Pl.ScriptHash } - deriving (UtxoPayload -> UtxoPayload -> Bool + deriving (UtxoPayload -> UtxoPayload -> Bool (UtxoPayload -> UtxoPayload -> Bool) -> (UtxoPayload -> UtxoPayload -> Bool) -> Eq UtxoPayload forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a @@ -109,7 +109,7 @@ $c/= :: UtxoPayload -> UtxoPayload -> Bool == :: UtxoPayload -> UtxoPayload -> Bool $c== :: UtxoPayload -> UtxoPayload -> Bool -Eq, Int -> UtxoPayload -> ShowS +Eq, Int -> UtxoPayload -> ShowS [UtxoPayload] -> ShowS UtxoPayload -> String (Int -> UtxoPayload -> ShowS) @@ -126,31 +126,31 @@ $cshowsPrec :: Int -> UtxoPayload -> ShowS Show) -instance Eq UtxoPayloadSet where - (UtxoPayloadSet [UtxoPayload] -xs) == :: UtxoPayloadSet -> UtxoPayloadSet -> Bool -== (UtxoPayloadSet [UtxoPayload] -ys) = [UtxoPayload] -xs' [UtxoPayload] -> [UtxoPayload] -> Bool +instance Eq UtxoPayloadSet where + (UtxoPayloadSet [UtxoPayload] +xs) == :: UtxoPayloadSet -> UtxoPayloadSet -> Bool +== (UtxoPayloadSet [UtxoPayload] +ys) = [UtxoPayload] +xs' [UtxoPayload] -> [UtxoPayload] -> Bool forall a. Eq a => a -> a -> Bool == [UtxoPayload] -ys' +ys' where - k :: UtxoPayload + k :: UtxoPayload -> (TxOutRef, [(CurrencySymbol, TokenName, Integer)], TxSkelOutDatum, Maybe ScriptHash) -k (UtxoPayload TxOutRef -ref Value -val TxSkelOutDatum -dat Maybe ScriptHash -rs) = (TxOutRef -ref, Value -> [(CurrencySymbol, TokenName, Integer)] +k (UtxoPayload TxOutRef +ref Value +val TxSkelOutDatum +dat Maybe ScriptHash +rs) = (TxOutRef +ref, Value -> [(CurrencySymbol, TokenName, Integer)] Pl.flattenValue Value -val, TxSkelOutDatum -dat, Maybe ScriptHash -rs) - xs' :: [UtxoPayload] -xs' = (UtxoPayload -> UtxoPayload -> Ordering) +val, TxSkelOutDatum +dat, Maybe ScriptHash +rs) + xs' :: [UtxoPayload] +xs' = (UtxoPayload -> UtxoPayload -> Ordering) -> [UtxoPayload] -> [UtxoPayload] forall a. (a -> a -> Ordering) -> [a] -> [a] List.sortBy ((TxOutRef, [(CurrencySymbol, TokenName, Integer)], TxSkelOutDatum, @@ -174,10 +174,10 @@ `on` UtxoPayload -> (TxOutRef, [(CurrencySymbol, TokenName, Integer)], TxSkelOutDatum, Maybe ScriptHash) -k) [UtxoPayload] -xs - ys' :: [UtxoPayload] -ys' = (UtxoPayload -> UtxoPayload -> Ordering) +k) [UtxoPayload] +xs + ys' :: [UtxoPayload] +ys' = (UtxoPayload -> UtxoPayload -> Ordering) -> [UtxoPayload] -> [UtxoPayload] forall a. (a -> a -> Ordering) -> [a] -> [a] List.sortBy ((TxOutRef, [(CurrencySymbol, TokenName, Integer)], TxSkelOutDatum, @@ -201,25 +201,25 @@ `on` UtxoPayload -> (TxOutRef, [(CurrencySymbol, TokenName, Integer)], TxSkelOutDatum, Maybe ScriptHash) -k) [UtxoPayload] -ys +k) [UtxoPayload] +ys -instance Semigroup UtxoPayloadSet where - UtxoPayloadSet [UtxoPayload] -a <> :: UtxoPayloadSet -> UtxoPayloadSet -> UtxoPayloadSet -<> UtxoPayloadSet [UtxoPayload] -b = [UtxoPayload] -> UtxoPayloadSet +instance Semigroup UtxoPayloadSet where + UtxoPayloadSet [UtxoPayload] +a <> :: UtxoPayloadSet -> UtxoPayloadSet -> UtxoPayloadSet +<> UtxoPayloadSet [UtxoPayload] +b = [UtxoPayload] -> UtxoPayloadSet UtxoPayloadSet ([UtxoPayload] -> UtxoPayloadSet) -> [UtxoPayload] -> UtxoPayloadSet forall a b. (a -> b) -> a -> b $ [UtxoPayload] -a [UtxoPayload] -> [UtxoPayload] -> [UtxoPayload] +a [UtxoPayload] -> [UtxoPayload] -> [UtxoPayload] forall a. [a] -> [a] -> [a] ++ [UtxoPayload] -b +b -instance Monoid UtxoPayloadSet where - mempty :: UtxoPayloadSet +instance Monoid UtxoPayloadSet where + mempty :: UtxoPayloadSet mempty = [UtxoPayload] -> UtxoPayloadSet UtxoPayloadSet [] diff --git a/src/Cooked.Output.html b/src/Cooked.Output.html index 2810e1cc0..e64717e0a 100644 --- a/src/Cooked.Output.html +++ b/src/Cooked.Output.html @@ -63,29 +63,29 @@ -- complete script, a typed validator...?) -- -- to the type level. -class IsAbstractOutput o where - type OwnerType o - type DatumType o - type ValueType o - type ReferenceScriptType o - outputOwnerL :: Lens' o (OwnerType o) - outputStakingCredentialL :: Lens' o (Maybe Pl.StakingCredential) - outputDatumL :: Lens' o (DatumType o) - outputValueL :: Lens' o (ValueType o) - outputReferenceScriptL :: Lens' o (Maybe (ReferenceScriptType o)) +class IsAbstractOutput o where + type OwnerType o + type DatumType o + type ValueType o + type ReferenceScriptType o + outputOwnerL :: Lens' o (OwnerType o) + outputStakingCredentialL :: Lens' o (Maybe Pl.StakingCredential) + outputDatumL :: Lens' o (DatumType o) + outputValueL :: Lens' o (ValueType o) + outputReferenceScriptL :: Lens' o (Maybe (ReferenceScriptType o)) -class ToCredential a where - toCredential :: a -> Pl.Credential +class ToCredential a where + toCredential :: a -> Pl.Credential instance ToCredential Pl.Credential where - toCredential :: Credential -> Credential -toCredential = Credential -> Credential + toCredential :: Credential -> Credential +toCredential = Credential -> Credential forall a. a -> a id -instance ToCredential (Pl.TypedValidator a) where - toCredential :: TypedValidator a -> Credential -toCredential = ValidatorHash -> Credential +instance ToCredential (Pl.TypedValidator a) where + toCredential :: TypedValidator a -> Credential +toCredential = ValidatorHash -> Credential Pl.ScriptCredential (ValidatorHash -> Credential) -> (TypedValidator a -> ValidatorHash) -> TypedValidator a @@ -96,72 +96,72 @@ Pl.validatorHash instance ToCredential Pl.PubKeyHash where - toCredential :: PubKeyHash -> Credential -toCredential = PubKeyHash -> Credential + toCredential :: PubKeyHash -> Credential +toCredential = PubKeyHash -> Credential Pl.PubKeyCredential -class ToOutputDatum a where - toOutputDatum :: a -> Pl.OutputDatum +class ToOutputDatum a where + toOutputDatum :: a -> Pl.OutputDatum instance ToOutputDatum Pl.OutputDatum where - toOutputDatum :: OutputDatum -> OutputDatum -toOutputDatum = OutputDatum -> OutputDatum + toOutputDatum :: OutputDatum -> OutputDatum +toOutputDatum = OutputDatum -> OutputDatum forall a. a -> a id instance ToOutputDatum Pl.Datum where - toOutputDatum :: Datum -> OutputDatum -toOutputDatum = Datum -> OutputDatum + toOutputDatum :: Datum -> OutputDatum +toOutputDatum = Datum -> OutputDatum Pl.OutputDatum instance ToOutputDatum () where - toOutputDatum :: () -> OutputDatum -toOutputDatum = OutputDatum -> () -> OutputDatum + toOutputDatum :: () -> OutputDatum +toOutputDatum = OutputDatum -> () -> OutputDatum forall a b. a -> b -> a const OutputDatum Pl.NoOutputDatum instance ToOutputDatum Pl.DatumHash where - toOutputDatum :: DatumHash -> OutputDatum -toOutputDatum = DatumHash -> OutputDatum + toOutputDatum :: DatumHash -> OutputDatum +toOutputDatum = DatumHash -> OutputDatum Pl.OutputDatumHash -class ToValue a where - toValue :: a -> Pl.Value +class ToValue a where + toValue :: a -> Pl.Value instance ToValue Pl.Value where - toValue :: Value -> Value -toValue = Value -> Value + toValue :: Value -> Value +toValue = Value -> Value forall a. a -> a id instance ToValue Pl.Ada where - toValue :: Ada -> Value -toValue = Ada -> Value + toValue :: Ada -> Value +toValue = Ada -> Value Pl.toValue -class ToScript a where - toScript :: a -> Pl.Versioned Pl.Script +class ToScript a where + toScript :: a -> Pl.Versioned Pl.Script instance ToScript (Pl.Versioned Pl.Script) where - toScript :: Versioned Script -> Versioned Script -toScript = Versioned Script -> Versioned Script + toScript :: Versioned Script -> Versioned Script +toScript = Versioned Script -> Versioned Script forall a. a -> a id instance ToScript (Pl.Versioned Pl.Validator) where - toScript :: Versioned Validator -> Versioned Script -toScript (Pl.Versioned (Pl.Validator Script -script) Language -version) = Script -> Language -> Versioned Script + toScript :: Versioned Validator -> Versioned Script +toScript (Pl.Versioned (Pl.Validator Script +script) Language +version) = Script -> Language -> Versioned Script forall script. script -> Language -> Versioned script Pl.Versioned Script -script Language -version +script Language +version -instance ToScript (Pl.TypedValidator a) where - toScript :: TypedValidator a -> Versioned Script -toScript = Versioned Validator -> Versioned Script +instance ToScript (Pl.TypedValidator a) where + toScript :: TypedValidator a -> Versioned Script +toScript = Versioned Validator -> Versioned Script forall a. ToScript a => a -> Versioned Script toScript (Versioned Validator -> Versioned Script) -> (TypedValidator a -> Versioned Validator) @@ -172,23 +172,23 @@ forall a. TypedValidator a -> Versioned Validator Pl.vValidatorScript -class ToScriptHash a where - toScriptHash :: a -> Pl.ScriptHash +class ToScriptHash a where + toScriptHash :: a -> Pl.ScriptHash instance ToScriptHash Pl.ScriptHash where - toScriptHash :: ScriptHash -> ScriptHash -toScriptHash = ScriptHash -> ScriptHash + toScriptHash :: ScriptHash -> ScriptHash +toScriptHash = ScriptHash -> ScriptHash forall a. a -> a id instance ToScriptHash (Pl.Versioned Pl.Script) where - toScriptHash :: Versioned Script -> ScriptHash -toScriptHash = Versioned Script -> ScriptHash + toScriptHash :: Versioned Script -> ScriptHash +toScriptHash = Versioned Script -> ScriptHash Pl.scriptHash instance ToScriptHash (Pl.Versioned Pl.Validator) where - toScriptHash :: Versioned Validator -> ScriptHash -toScriptHash = Versioned Script -> ScriptHash + toScriptHash :: Versioned Validator -> ScriptHash +toScriptHash = Versioned Script -> ScriptHash forall a. ToScriptHash a => a -> ScriptHash toScriptHash (Versioned Script -> ScriptHash) -> (Versioned Validator -> Versioned Script) @@ -200,15 +200,15 @@ toScript instance ToScriptHash Pl.ValidatorHash where - toScriptHash :: ValidatorHash -> ScriptHash -toScriptHash (Pl.ValidatorHash BuiltinByteString -h) = BuiltinByteString -> ScriptHash + toScriptHash :: ValidatorHash -> ScriptHash +toScriptHash (Pl.ValidatorHash BuiltinByteString +h) = BuiltinByteString -> ScriptHash Pl.ScriptHash BuiltinByteString -h +h -instance ToScriptHash (Pl.TypedValidator a) where - toScriptHash :: TypedValidator a -> ScriptHash -toScriptHash = ValidatorHash -> ScriptHash +instance ToScriptHash (Pl.TypedValidator a) where + toScriptHash :: TypedValidator a -> ScriptHash +toScriptHash = ValidatorHash -> ScriptHash forall a. ToScriptHash a => a -> ScriptHash toScriptHash (ValidatorHash -> ScriptHash) -> (TypedValidator a -> ValidatorHash) @@ -221,29 +221,29 @@ -- | An output that can be translated into its script-perspective (as seen on -- the 'TxInfo') representation -type IsTxInfoOutput o = - ( IsAbstractOutput o, - ToCredential (OwnerType o), - ToOutputDatum (DatumType o), - ToValue (ValueType o), - ToScriptHash (ReferenceScriptType o) +type IsTxInfoOutput o = + ( IsAbstractOutput o, + ToCredential (OwnerType o), + ToOutputDatum (DatumType o), + ToValue (ValueType o), + ToScriptHash (ReferenceScriptType o) ) -outputAddress :: (IsAbstractOutput o, ToCredential (OwnerType o)) => o -> Pl.Address +outputAddress :: (IsAbstractOutput o, ToCredential (OwnerType o)) => o -> Pl.Address outputAddress :: o -> Address -outputAddress o -out = Credential -> Maybe StakingCredential -> Address +outputAddress o +out = Credential -> Maybe StakingCredential -> Address Pl.Address (OwnerType o -> Credential forall a. ToCredential a => a -> Credential toCredential (o -out o -> Optic' A_Lens NoIx o (OwnerType o) -> OwnerType o +out o -> Optic' A_Lens NoIx o (OwnerType o) -> OwnerType o forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a ^. Optic' A_Lens NoIx o (OwnerType o) forall o. IsAbstractOutput o => Lens' o (OwnerType o) outputOwnerL)) (o -out o +out o -> Optic' A_Lens NoIx o (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -253,7 +253,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) -outputOutputDatum :: (IsAbstractOutput o, ToOutputDatum (DatumType o)) => o -> Pl.OutputDatum +outputOutputDatum :: (IsAbstractOutput o, ToOutputDatum (DatumType o)) => o -> Pl.OutputDatum outputOutputDatum :: o -> OutputDatum outputOutputDatum = DatumType o -> OutputDatum forall a. ToOutputDatum a => a -> OutputDatum @@ -268,7 +268,7 @@ forall o. IsAbstractOutput o => Lens' o (DatumType o) outputDatumL) -outputValue :: (IsAbstractOutput o, ToValue (ValueType o)) => o -> Pl.Value +outputValue :: (IsAbstractOutput o, ToValue (ValueType o)) => o -> Pl.Value outputValue :: o -> Value outputValue = ValueType o -> Value forall a. ToValue a => a -> Value @@ -282,7 +282,7 @@ forall o. IsAbstractOutput o => Lens' o (ValueType o) outputValueL) -outputReferenceScriptHash :: (IsAbstractOutput o, ToScriptHash (ReferenceScriptType o)) => o -> Maybe Pl.ScriptHash +outputReferenceScriptHash :: (IsAbstractOutput o, ToScriptHash (ReferenceScriptType o)) => o -> Maybe Pl.ScriptHash outputReferenceScriptHash :: o -> Maybe ScriptHash outputReferenceScriptHash = (ReferenceScriptType o -> ScriptHash forall a. ToScriptHash a => a -> ScriptHash @@ -305,10 +305,10 @@ outputReferenceScriptL) -- | Return the output as it is seen by a validator on the 'TxInfo'. -outputTxOut :: IsTxInfoOutput o => o -> Pl.TxOut +outputTxOut :: IsTxInfoOutput o => o -> Pl.TxOut outputTxOut :: o -> TxOut -outputTxOut o -o = +outputTxOut o +o = Address -> Value -> OutputDatum -> Maybe ScriptHash -> TxOut Pl.TxOut (o -> Address @@ -316,23 +316,23 @@ (IsAbstractOutput o, ToCredential (OwnerType o)) => o -> Address outputAddress o -o) +o) (o -> Value forall o. (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value outputValue o -o) +o) (o -> OutputDatum forall o. (IsAbstractOutput o, ToOutputDatum (DatumType o)) => o -> OutputDatum outputOutputDatum o -o) +o) (o -> Maybe ScriptHash forall o. (IsAbstractOutput o, ToScriptHash (ReferenceScriptType o)) => o -> Maybe ScriptHash outputReferenceScriptHash o -o) +o) -- * 'Pl.TxOut's are outputs @@ -341,8 +341,8 @@ type DatumType Pl.TxOut = Pl.OutputDatum type ValueType Pl.TxOut = Pl.Value type ReferenceScriptType Pl.TxOut = Pl.ScriptHash - outputOwnerL :: Lens' TxOut (OwnerType TxOut) -outputOwnerL = + outputOwnerL :: Lens' TxOut (OwnerType TxOut) +outputOwnerL = LensVL TxOut TxOut Address Address -> Lens TxOut TxOut Address Address forall s t a b. LensVL s t a b -> Lens s t a b @@ -362,20 +362,20 @@ lens Address -> Credential Pl.addressCredential - (\Address -addr Credential -cred -> Address -addr {addressCredential :: Credential + (\Address +addr Credential +cred -> Address +addr {addressCredential :: Credential Pl.addressCredential = Credential -cred}) - outputDatumL :: Lens' TxOut (DatumType TxOut) -outputDatumL = LensVL TxOut TxOut OutputDatum OutputDatum +cred}) + outputDatumL :: Lens' TxOut (DatumType TxOut) +outputDatumL = LensVL TxOut TxOut OutputDatum OutputDatum -> Lens TxOut TxOut OutputDatum OutputDatum forall s t a b. LensVL s t a b -> Lens s t a b lensVL LensVL TxOut TxOut OutputDatum OutputDatum Pl.outDatum - outputStakingCredentialL :: Lens' TxOut (Maybe StakingCredential) -outputStakingCredentialL = + outputStakingCredentialL :: Lens' TxOut (Maybe StakingCredential) +outputStakingCredentialL = (TxOut -> Maybe StakingCredential) -> (TxOut -> Maybe StakingCredential -> TxOut) -> Lens' TxOut (Maybe StakingCredential) @@ -387,24 +387,24 @@ forall b c a. (b -> c) -> (a -> b) -> a -> c . TxOut -> Address Pl.txOutAddress) - ( \TxOut -out Maybe StakingCredential -mStCred -> + ( \TxOut +out Maybe StakingCredential +mStCred -> TxOut -out {txOutAddress :: Address +out {txOutAddress :: Address Pl.txOutAddress = (TxOut -> Address Pl.txOutAddress TxOut -out) {addressStakingCredential :: Maybe StakingCredential +out) {addressStakingCredential :: Maybe StakingCredential Pl.addressStakingCredential = Maybe StakingCredential -mStCred}} +mStCred}} ) - outputValueL :: Lens' TxOut (ValueType TxOut) -outputValueL = LensVL TxOut TxOut Value Value -> Lens TxOut TxOut Value Value + outputValueL :: Lens' TxOut (ValueType TxOut) +outputValueL = LensVL TxOut TxOut Value Value -> Lens TxOut TxOut Value Value forall s t a b. LensVL s t a b -> Lens s t a b lensVL LensVL TxOut TxOut Value Value Pl.outValue - outputReferenceScriptL :: Lens' TxOut (Maybe (ReferenceScriptType TxOut)) -outputReferenceScriptL = LensVL TxOut TxOut (Maybe ScriptHash) (Maybe ScriptHash) + outputReferenceScriptL :: Lens' TxOut (Maybe (ReferenceScriptType TxOut)) +outputReferenceScriptL = LensVL TxOut TxOut (Maybe ScriptHash) (Maybe ScriptHash) -> Lens TxOut TxOut (Maybe ScriptHash) (Maybe ScriptHash) forall s t a b. LensVL s t a b -> Lens s t a b lensVL LensVL TxOut TxOut (Maybe ScriptHash) (Maybe ScriptHash) @@ -413,40 +413,40 @@ -- * A concrete type for outputs -- | A type constructed to be the most general instance of 'IsAbstractOutput'. -data ConcreteOutput ownerType datumType valueType referenceScriptType where - ConcreteOutput :: +data ConcreteOutput ownerType datumType valueType referenceScriptType where + ConcreteOutput :: { ConcreteOutput ownerType datumType valueType referenceScriptType -> ownerType -concreteOutputOwner :: ownerType, +concreteOutputOwner :: ownerType, ConcreteOutput ownerType datumType valueType referenceScriptType -> Maybe StakingCredential concreteOutputStakingCredential :: Maybe Pl.StakingCredential, ConcreteOutput ownerType datumType valueType referenceScriptType -> valueType -concreteOutputValue :: valueType, +concreteOutputValue :: valueType, ConcreteOutput ownerType datumType valueType referenceScriptType -> datumType -concreteOutputDatum :: datumType, +concreteOutputDatum :: datumType, ConcreteOutput ownerType datumType valueType referenceScriptType -> Maybe referenceScriptType -concreteOutputReferenceScript :: Maybe referenceScriptType +concreteOutputReferenceScript :: Maybe referenceScriptType } -> - ConcreteOutput ownerType datumType valueType referenceScriptType + ConcreteOutput ownerType datumType valueType referenceScriptType -deriving instance (Show ownerType, Show datumType, Show valueType, Show referenceScriptType) => Show (ConcreteOutput ownerType datumType valueType referenceScriptType) +deriving instance (Show ownerType, Show datumType, Show valueType, Show referenceScriptType) => Show (ConcreteOutput ownerType datumType valueType referenceScriptType) -deriving instance (Eq ownerType, Eq datumType, Eq valueType, Eq referenceScriptType) => Eq (ConcreteOutput ownerType datumType valueType referenceScriptType) +deriving instance (Eq ownerType, Eq datumType, Eq valueType, Eq referenceScriptType) => Eq (ConcreteOutput ownerType datumType valueType referenceScriptType) -instance IsAbstractOutput (ConcreteOutput ownerType datumType valueType referenceScriptType) where - type OwnerType (ConcreteOutput ownerType datumType valueType referenceScriptType) = ownerType - type DatumType (ConcreteOutput ownerType datumType valueType referenceScriptType) = datumType - type ValueType (ConcreteOutput ownerType datumType valueType referenceScriptType) = valueType - type ReferenceScriptType (ConcreteOutput ownerType datumType valueType referenceScriptType) = referenceScriptType - outputOwnerL :: Lens' +instance IsAbstractOutput (ConcreteOutput ownerType datumType valueType referenceScriptType) where + type OwnerType (ConcreteOutput ownerType datumType valueType referenceScriptType) = ownerType + type DatumType (ConcreteOutput ownerType datumType valueType referenceScriptType) = datumType + type ValueType (ConcreteOutput ownerType datumType valueType referenceScriptType) = valueType + type ReferenceScriptType (ConcreteOutput ownerType datumType valueType referenceScriptType) = referenceScriptType + outputOwnerL :: Lens' (ConcreteOutput ownerType datumType valueType referenceScriptType) (OwnerType (ConcreteOutput ownerType datumType valueType referenceScriptType)) -outputOwnerL = (ConcreteOutput ownerType datumType valueType referenceScriptType +outputOwnerL = (ConcreteOutput ownerType datumType valueType referenceScriptType -> ownerType) -> (ConcreteOutput ownerType datumType valueType referenceScriptType @@ -464,16 +464,16 @@ forall ownerType datumType valueType referenceScriptType. ConcreteOutput ownerType datumType valueType referenceScriptType -> ownerType -concreteOutputOwner (\ConcreteOutput ownerType datumType valueType referenceScriptType -out ownerType -owner -> ConcreteOutput ownerType datumType valueType referenceScriptType -out {concreteOutputOwner :: ownerType +concreteOutputOwner (\ConcreteOutput ownerType datumType valueType referenceScriptType +out ownerType +owner -> ConcreteOutput ownerType datumType valueType referenceScriptType +out {concreteOutputOwner :: ownerType concreteOutputOwner = ownerType -owner}) - outputStakingCredentialL :: Lens' +owner}) + outputStakingCredentialL :: Lens' (ConcreteOutput ownerType datumType valueType referenceScriptType) (Maybe StakingCredential) -outputStakingCredentialL = (ConcreteOutput ownerType datumType valueType referenceScriptType +outputStakingCredentialL = (ConcreteOutput ownerType datumType valueType referenceScriptType -> Maybe StakingCredential) -> (ConcreteOutput ownerType datumType valueType referenceScriptType @@ -489,17 +489,17 @@ forall ownerType datumType valueType referenceScriptType. ConcreteOutput ownerType datumType valueType referenceScriptType -> Maybe StakingCredential -concreteOutputStakingCredential (\ConcreteOutput ownerType datumType valueType referenceScriptType -out Maybe StakingCredential -mStCred -> ConcreteOutput ownerType datumType valueType referenceScriptType -out {concreteOutputStakingCredential :: Maybe StakingCredential +concreteOutputStakingCredential (\ConcreteOutput ownerType datumType valueType referenceScriptType +out Maybe StakingCredential +mStCred -> ConcreteOutput ownerType datumType valueType referenceScriptType +out {concreteOutputStakingCredential :: Maybe StakingCredential concreteOutputStakingCredential = Maybe StakingCredential -mStCred}) - outputDatumL :: Lens' +mStCred}) + outputDatumL :: Lens' (ConcreteOutput ownerType datumType valueType referenceScriptType) (DatumType (ConcreteOutput ownerType datumType valueType referenceScriptType)) -outputDatumL = (ConcreteOutput ownerType datumType valueType referenceScriptType +outputDatumL = (ConcreteOutput ownerType datumType valueType referenceScriptType -> datumType) -> (ConcreteOutput ownerType datumType valueType referenceScriptType @@ -517,17 +517,17 @@ forall ownerType datumType valueType referenceScriptType. ConcreteOutput ownerType datumType valueType referenceScriptType -> datumType -concreteOutputDatum (\ConcreteOutput ownerType datumType valueType referenceScriptType -out datumType -datum -> ConcreteOutput ownerType datumType valueType referenceScriptType -out {concreteOutputDatum :: datumType +concreteOutputDatum (\ConcreteOutput ownerType datumType valueType referenceScriptType +out datumType +datum -> ConcreteOutput ownerType datumType valueType referenceScriptType +out {concreteOutputDatum :: datumType concreteOutputDatum = datumType -datum}) - outputValueL :: Lens' +datum}) + outputValueL :: Lens' (ConcreteOutput ownerType datumType valueType referenceScriptType) (ValueType (ConcreteOutput ownerType datumType valueType referenceScriptType)) -outputValueL = (ConcreteOutput ownerType datumType valueType referenceScriptType +outputValueL = (ConcreteOutput ownerType datumType valueType referenceScriptType -> valueType) -> (ConcreteOutput ownerType datumType valueType referenceScriptType @@ -545,19 +545,19 @@ forall ownerType datumType valueType referenceScriptType. ConcreteOutput ownerType datumType valueType referenceScriptType -> valueType -concreteOutputValue (\ConcreteOutput ownerType datumType valueType referenceScriptType -out valueType -value -> ConcreteOutput ownerType datumType valueType referenceScriptType -out {concreteOutputValue :: valueType +concreteOutputValue (\ConcreteOutput ownerType datumType valueType referenceScriptType +out valueType +value -> ConcreteOutput ownerType datumType valueType referenceScriptType +out {concreteOutputValue :: valueType concreteOutputValue = valueType -value}) - outputReferenceScriptL :: Lens' +value}) + outputReferenceScriptL :: Lens' (ConcreteOutput ownerType datumType valueType referenceScriptType) (Maybe (ReferenceScriptType (ConcreteOutput ownerType datumType valueType referenceScriptType))) -outputReferenceScriptL = (ConcreteOutput ownerType datumType valueType referenceScriptType +outputReferenceScriptL = (ConcreteOutput ownerType datumType valueType referenceScriptType -> Maybe referenceScriptType) -> (ConcreteOutput ownerType datumType valueType referenceScriptType @@ -575,22 +575,22 @@ forall ownerType datumType valueType referenceScriptType. ConcreteOutput ownerType datumType valueType referenceScriptType -> Maybe referenceScriptType -concreteOutputReferenceScript (\ConcreteOutput ownerType datumType valueType referenceScriptType -out Maybe referenceScriptType -mRefScript -> ConcreteOutput ownerType datumType valueType referenceScriptType -out {concreteOutputReferenceScript :: Maybe referenceScriptType +concreteOutputReferenceScript (\ConcreteOutput ownerType datumType valueType referenceScriptType +out Maybe referenceScriptType +mRefScript -> ConcreteOutput ownerType datumType valueType referenceScriptType +out {concreteOutputReferenceScript :: Maybe referenceScriptType concreteOutputReferenceScript = Maybe referenceScriptType -mRefScript}) +mRefScript}) -- * Functions to translate between different output types -- ** Filtering on the datum -- | Test if there is no datum on an output. -isOutputWithoutDatum :: - IsTxInfoOutput output => - output -> - Maybe (ConcreteOutput (OwnerType output) () (ValueType output) (ReferenceScriptType output)) +isOutputWithoutDatum :: + IsTxInfoOutput output => + output -> + Maybe (ConcreteOutput (OwnerType output) () (ValueType output) (ReferenceScriptType output)) isOutputWithoutDatum :: output -> Maybe (ConcreteOutput @@ -598,13 +598,13 @@ () (ValueType output) (ReferenceScriptType output)) -isOutputWithoutDatum output -out = case output -> OutputDatum +isOutputWithoutDatum output +out = case output -> OutputDatum forall o. (IsAbstractOutput o, ToOutputDatum (DatumType o)) => o -> OutputDatum outputOutputDatum output -out of +out of OutputDatum Pl.NoOutputDatum -> ConcreteOutput @@ -662,7 +662,7 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput (output -out output +out output -> Optic' A_Lens NoIx output (OwnerType output) -> OwnerType output forall k s (is :: IxList) a. Is k A_Getter => @@ -671,7 +671,7 @@ forall o. IsAbstractOutput o => Lens' o (OwnerType o) outputOwnerL) (output -out output +out output -> Optic' A_Lens NoIx output (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -681,7 +681,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) (output -out output +out output -> Optic' A_Lens NoIx output (ValueType output) -> ValueType output forall k s (is :: IxList) a. Is k A_Getter => @@ -691,7 +691,7 @@ outputValueL) () (output -out output +out output -> Optic' A_Lens NoIx output (Maybe (ReferenceScriptType output)) -> Maybe (ReferenceScriptType output) forall k s (is :: IxList) a. @@ -714,10 +714,10 @@ -- | Test if the output carries some inlined datum that can be parsed from -- builtin data on to something of a specific type. -isOutputWithInlineDatumOfType :: - (Pl.FromData a, IsTxInfoOutput output) => - output -> - Maybe (ConcreteOutput (OwnerType output) a (ValueType output) (ReferenceScriptType output)) +isOutputWithInlineDatumOfType :: + (Pl.FromData a, IsTxInfoOutput output) => + output -> + Maybe (ConcreteOutput (OwnerType output) a (ValueType output) (ReferenceScriptType output)) isOutputWithInlineDatumOfType :: output -> Maybe (ConcreteOutput @@ -725,16 +725,16 @@ a (ValueType output) (ReferenceScriptType output)) -isOutputWithInlineDatumOfType output -out = +isOutputWithInlineDatumOfType output +out = case output -> OutputDatum forall o. (IsAbstractOutput o, ToOutputDatum (DatumType o)) => o -> OutputDatum outputOutputDatum output -out of - Pl.OutputDatum (Pl.Datum BuiltinData -datum) -> +out of + Pl.OutputDatum (Pl.Datum BuiltinData +datum) -> OwnerType output -> Maybe StakingCredential -> ValueType output @@ -754,7 +754,7 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput (output -out output +out output -> Optic' A_Lens NoIx output (OwnerType output) -> OwnerType output forall k s (is :: IxList) a. Is k A_Getter => @@ -763,7 +763,7 @@ forall o. IsAbstractOutput o => Lens' o (OwnerType o) outputOwnerL) (output -out output +out output -> Optic' A_Lens NoIx output (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -773,7 +773,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) (output -out output +out output -> Optic' A_Lens NoIx output (ValueType output) -> ValueType output forall k s (is :: IxList) a. Is k A_Getter => @@ -800,7 +800,7 @@ <$> BuiltinData -> Maybe a forall a. FromData a => BuiltinData -> Maybe a Pl.fromBuiltinData BuiltinData -datum +datum Maybe (Maybe (ReferenceScriptType output) -> ConcreteOutput @@ -820,7 +820,7 @@ -> Maybe (Maybe (ReferenceScriptType output)) forall a. a -> Maybe a Just (output -out output +out output -> Optic' A_Lens NoIx output (Maybe (ReferenceScriptType output)) -> Maybe (ReferenceScriptType output) forall k s (is :: IxList) a. @@ -842,10 +842,10 @@ Nothing -- | Test if the output carries some inlined datum. -isOutputWithInlineDatum :: - IsTxInfoOutput output => - output -> - Maybe (ConcreteOutput (OwnerType output) Pl.Datum (ValueType output) (ReferenceScriptType output)) +isOutputWithInlineDatum :: + IsTxInfoOutput output => + output -> + Maybe (ConcreteOutput (OwnerType output) Pl.Datum (ValueType output) (ReferenceScriptType output)) isOutputWithInlineDatum :: output -> Maybe (ConcreteOutput @@ -853,16 +853,16 @@ Datum (ValueType output) (ReferenceScriptType output)) -isOutputWithInlineDatum output -out = +isOutputWithInlineDatum output +out = case output -> OutputDatum forall o. (IsAbstractOutput o, ToOutputDatum (DatumType o)) => o -> OutputDatum outputOutputDatum output -out of - Pl.OutputDatum datum :: Datum -datum@(Pl.Datum BuiltinData +out of + Pl.OutputDatum datum :: Datum +datum@(Pl.Datum BuiltinData _) -> ConcreteOutput (OwnerType output) @@ -919,7 +919,7 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput (output -out output +out output -> Optic' A_Lens NoIx output (OwnerType output) -> OwnerType output forall k s (is :: IxList) a. Is k A_Getter => @@ -928,7 +928,7 @@ forall o. IsAbstractOutput o => Lens' o (OwnerType o) outputOwnerL) (output -out output +out output -> Optic' A_Lens NoIx output (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -938,7 +938,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) (output -out output +out output -> Optic' A_Lens NoIx output (ValueType output) -> ValueType output forall k s (is :: IxList) a. Is k A_Getter => @@ -947,9 +947,9 @@ forall o. IsAbstractOutput o => Lens' o (ValueType o) outputValueL) Datum -datum +datum (output -out output +out output -> Optic' A_Lens NoIx output (Maybe (ReferenceScriptType output)) -> Maybe (ReferenceScriptType output) forall k s (is :: IxList) a. @@ -971,10 +971,10 @@ Nothing -- | Test if the output carries some datum hash. -isOutputWithDatumHash :: - IsTxInfoOutput output => - output -> - Maybe (ConcreteOutput (OwnerType output) Pl.DatumHash (ValueType output) (ReferenceScriptType output)) +isOutputWithDatumHash :: + IsTxInfoOutput output => + output -> + Maybe (ConcreteOutput (OwnerType output) Pl.DatumHash (ValueType output) (ReferenceScriptType output)) isOutputWithDatumHash :: output -> Maybe (ConcreteOutput @@ -982,16 +982,16 @@ DatumHash (ValueType output) (ReferenceScriptType output)) -isOutputWithDatumHash output -out = +isOutputWithDatumHash output +out = case output -> OutputDatum forall o. (IsAbstractOutput o, ToOutputDatum (DatumType o)) => o -> OutputDatum outputOutputDatum output -out of - Pl.OutputDatumHash DatumHash -hash -> +out of + Pl.OutputDatumHash DatumHash +hash -> ConcreteOutput (OwnerType output) DatumHash @@ -1047,7 +1047,7 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput (output -out output +out output -> Optic' A_Lens NoIx output (OwnerType output) -> OwnerType output forall k s (is :: IxList) a. Is k A_Getter => @@ -1067,9 +1067,9 @@ -> output -> Maybe StakingCredential forall a b. (a -> b) -> a -> b $ output -out) +out) (output -out output +out output -> Optic' A_Lens NoIx output (ValueType output) -> ValueType output forall k s (is :: IxList) a. Is k A_Getter => @@ -1078,9 +1078,9 @@ forall o. IsAbstractOutput o => Lens' o (ValueType o) outputValueL) DatumHash -hash +hash (output -out output +out output -> Optic' A_Lens NoIx output (Maybe (ReferenceScriptType output)) -> Maybe (ReferenceScriptType output) forall k s (is :: IxList) a. @@ -1105,11 +1105,11 @@ -- | Test if the owner of an output is a specific typed validator. If it is, -- return an output with the validator type as its 'OwnerType'. -isScriptOutputFrom :: - IsTxInfoOutput output => - Pl.TypedValidator a -> - output -> - Maybe (ConcreteOutput (Pl.TypedValidator a) (DatumType output) (ValueType output) (ReferenceScriptType output)) +isScriptOutputFrom :: + IsTxInfoOutput output => + Pl.TypedValidator a -> + output -> + Maybe (ConcreteOutput (Pl.TypedValidator a) (DatumType output) (ValueType output) (ReferenceScriptType output)) isScriptOutputFrom :: TypedValidator a -> output -> Maybe @@ -1118,25 +1118,25 @@ (DatumType output) (ValueType output) (ReferenceScriptType output)) -isScriptOutputFrom TypedValidator a -validator output -out = +isScriptOutputFrom TypedValidator a +validator output +out = case output -> Address forall o. (IsAbstractOutput o, ToCredential (OwnerType o)) => o -> Address outputAddress output -out of - Pl.Address (Pl.ScriptCredential ValidatorHash -scriptHash) Maybe StakingCredential -mStCred -> +out of + Pl.Address (Pl.ScriptCredential ValidatorHash +scriptHash) Maybe StakingCredential +mStCred -> if ValidatorHash -scriptHash ValidatorHash -> ValidatorHash -> Bool +scriptHash ValidatorHash -> ValidatorHash -> Bool forall a. Eq a => a -> a -> Bool == TypedValidator a -> ValidatorHash forall a. TypedValidator a -> ValidatorHash Pl.validatorHash TypedValidator a -validator +validator then ConcreteOutput (TypedValidator a) @@ -1193,11 +1193,11 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput TypedValidator a -validator +validator Maybe StakingCredential -mStCred +mStCred (output -out output +out output -> Optic' A_Lens NoIx output (ValueType output) -> ValueType output forall k s (is :: IxList) a. Is k A_Getter => @@ -1206,7 +1206,7 @@ forall o. IsAbstractOutput o => Lens' o (ValueType o) outputValueL) (output -out output +out output -> Optic' A_Lens NoIx output (DatumType output) -> DatumType output forall k s (is :: IxList) a. Is k A_Getter => @@ -1215,7 +1215,7 @@ forall o. IsAbstractOutput o => Lens' o (DatumType o) outputDatumL) (output -out output +out output -> Optic' A_Lens NoIx output (Maybe (ReferenceScriptType output)) -> Maybe (ReferenceScriptType output) forall k s (is :: IxList) a. @@ -1247,11 +1247,11 @@ -- | Test if the owner of an output is a specific public key. If it is, return -- an output of the same 'DatumType', but with 'Pl.PubKeyHash' as its -- 'OwnerType'. -isPKOutputFrom :: - IsTxInfoOutput output => +isPKOutputFrom :: + IsTxInfoOutput output => Pl.PubKeyHash -> - output -> - Maybe (ConcreteOutput Pl.PubKeyHash (DatumType output) (ValueType output) (ReferenceScriptType output)) + output -> + Maybe (ConcreteOutput Pl.PubKeyHash (DatumType output) (ValueType output) (ReferenceScriptType output)) isPKOutputFrom :: PubKeyHash -> output -> Maybe @@ -1260,22 +1260,22 @@ (DatumType output) (ValueType output) (ReferenceScriptType output)) -isPKOutputFrom PubKeyHash -pkh output -out = case output -> Address +isPKOutputFrom PubKeyHash +pkh output +out = case output -> Address forall o. (IsAbstractOutput o, ToCredential (OwnerType o)) => o -> Address outputAddress output -out of - Pl.Address (Pl.PubKeyCredential PubKeyHash -pkh') Maybe StakingCredential -_mStCred -> +out of + Pl.Address (Pl.PubKeyCredential PubKeyHash +pkh') Maybe StakingCredential +_mStCred -> if PubKeyHash -pkh PubKeyHash -> PubKeyHash -> Bool +pkh PubKeyHash -> PubKeyHash -> Bool forall a. Eq a => a -> a -> Bool == PubKeyHash -pkh' +pkh' then ConcreteOutput PubKeyHash @@ -1332,9 +1332,9 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput PubKeyHash -pkh +pkh (output -out output +out output -> Optic' A_Lens NoIx output (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -1344,7 +1344,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) (output -out output +out output -> Optic' A_Lens NoIx output (ValueType output) -> ValueType output forall k s (is :: IxList) a. Is k A_Getter => @@ -1353,7 +1353,7 @@ forall o. IsAbstractOutput o => Lens' o (ValueType o) outputValueL) (output -out output +out output -> Optic' A_Lens NoIx output (DatumType output) -> DatumType output forall k s (is :: IxList) a. Is k A_Getter => @@ -1362,7 +1362,7 @@ forall o. IsAbstractOutput o => Lens' o (DatumType o) outputDatumL) (output -out output +out output -> Optic' A_Lens NoIx output (Maybe (ReferenceScriptType output)) -> Maybe (ReferenceScriptType output) forall k s (is :: IxList) a. @@ -1394,10 +1394,10 @@ -- ** Filtering on the value -- | Test if the value on an output contains only Ada. -isOnlyAdaOutput :: - IsTxInfoOutput output => - output -> - Maybe (ConcreteOutput (OwnerType output) (DatumType output) Pl.Ada (ReferenceScriptType output)) +isOnlyAdaOutput :: + IsTxInfoOutput output => + output -> + Maybe (ConcreteOutput (OwnerType output) (DatumType output) Pl.Ada (ReferenceScriptType output)) isOnlyAdaOutput :: output -> Maybe (ConcreteOutput @@ -1405,13 +1405,13 @@ (DatumType output) Ada (ReferenceScriptType output)) -isOnlyAdaOutput output -out = +isOnlyAdaOutput output +out = if Value -> Bool Pl.isAdaOnlyValue (output -> Value forall o. (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value outputValue output -out) +out) then ConcreteOutput (OwnerType output) @@ -1468,7 +1468,7 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput (output -out output +out output -> Optic' A_Lens NoIx output (OwnerType output) -> OwnerType output forall k s (is :: IxList) a. Is k A_Getter => @@ -1477,7 +1477,7 @@ forall o. IsAbstractOutput o => Lens' o (OwnerType o) outputOwnerL) (output -out output +out output -> Optic' A_Lens NoIx output (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -1492,9 +1492,9 @@ $ output -> Value forall o. (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value outputValue output -out) +out) (output -out output +out output -> Optic' A_Lens NoIx output (DatumType output) -> DatumType output forall k s (is :: IxList) a. Is k A_Getter => @@ -1503,7 +1503,7 @@ forall o. IsAbstractOutput o => Lens' o (DatumType o) outputDatumL) (output -out output +out output -> Optic' A_Lens NoIx output (Maybe (ReferenceScriptType output)) -> Maybe (ReferenceScriptType output) forall k s (is :: IxList) a. @@ -1526,15 +1526,15 @@ -- ** Filtering on the reference script -- | Convert the reference script type on the output to 'Pl.ScriptHash'. -toOutputWithReferenceScriptHash :: - (IsAbstractOutput output, ToScriptHash (ReferenceScriptType output)) => - output -> - ConcreteOutput (OwnerType output) (DatumType output) (ValueType output) Pl.ScriptHash +toOutputWithReferenceScriptHash :: + (IsAbstractOutput output, ToScriptHash (ReferenceScriptType output)) => + output -> + ConcreteOutput (OwnerType output) (DatumType output) (ValueType output) Pl.ScriptHash toOutputWithReferenceScriptHash :: output -> ConcreteOutput (OwnerType output) (DatumType output) (ValueType output) ScriptHash -toOutputWithReferenceScriptHash output -out = +toOutputWithReferenceScriptHash output +out = OwnerType output -> Maybe StakingCredential -> ValueType output @@ -1551,7 +1551,7 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput (output -out output +out output -> Optic' A_Lens NoIx output (OwnerType output) -> OwnerType output forall k s (is :: IxList) a. Is k A_Getter => @@ -1560,7 +1560,7 @@ forall o. IsAbstractOutput o => Lens' o (OwnerType o) outputOwnerL) (output -out output +out output -> Optic' A_Lens NoIx output (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -1570,7 +1570,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) (output -out output +out output -> Optic' A_Lens NoIx output (ValueType output) -> ValueType output forall k s (is :: IxList) a. Is k A_Getter => @@ -1579,7 +1579,7 @@ forall o. IsAbstractOutput o => Lens' o (ValueType o) outputValueL) (output -out output +out output -> Optic' A_Lens NoIx output (DatumType output) -> DatumType output forall k s (is :: IxList) a. Is k A_Getter => @@ -1593,7 +1593,7 @@ -> Maybe (ReferenceScriptType output) -> Maybe ScriptHash forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> output -out output +out output -> Optic' A_Lens NoIx output (Maybe (ReferenceScriptType output)) -> Maybe (ReferenceScriptType output) forall k s (is :: IxList) a. diff --git a/src/Cooked.Pretty.Class.html b/src/Cooked.Pretty.Class.html index 9427f06e2..443ecc189 100644 --- a/src/Cooked.Pretty.Class.html +++ b/src/Cooked.Pretty.Class.html @@ -29,15 +29,15 @@ import qualified Prettyprinter as PP import qualified Prettyprinter.Render.Text as PP -class PrettyCooked a where - prettyCooked :: a -> DocCooked - prettyCooked = PrettyCookedOpts -> a -> DocCooked +class PrettyCooked a where + prettyCooked :: a -> DocCooked + prettyCooked = PrettyCookedOpts -> a -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts forall a. Default a => a def - prettyCookedOpt :: PrettyCookedOpts -> a -> DocCooked - prettyCookedOpt PrettyCookedOpts + prettyCookedOpt :: PrettyCookedOpts -> a -> DocCooked + prettyCookedOpt PrettyCookedOpts _ = a -> DocCooked forall a. PrettyCooked a => a -> DocCooked prettyCooked @@ -46,26 +46,26 @@ -- when dealing with pretty-printable cooked values. -- -- For example, @printCookedOpt def runMockChain i0 foo@ -printCookedOpt :: PrettyCooked a => PrettyCookedOpts -> a -> IO () +printCookedOpt :: PrettyCooked a => PrettyCookedOpts -> a -> IO () printCookedOpt :: PrettyCookedOpts -> a -> IO () -printCookedOpt PrettyCookedOpts -opts a -e = DocCooked -> IO () +printCookedOpt PrettyCookedOpts +opts a +e = DocCooked -> IO () forall ann. Doc ann -> IO () PP.putDoc (DocCooked -> IO ()) -> DocCooked -> IO () forall a b. (a -> b) -> a -> b $ PrettyCookedOpts -> a -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts a -e DocCooked -> DocCooked -> DocCooked +opts a +e DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> DocCooked forall ann. Doc ann PP.line -- | Version of 'printCookedOpt' that uses default pretty printing options. -printCooked :: PrettyCooked a => a -> IO () +printCooked :: PrettyCooked a => a -> IO () printCooked :: a -> IO () printCooked = PrettyCookedOpts -> a -> IO () forall a. PrettyCooked a => PrettyCookedOpts -> a -> IO () @@ -73,27 +73,27 @@ forall a. Default a => a def -instance PrettyCooked Pl.TxId where - prettyCookedOpt :: PrettyCookedOpts -> TxId -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts = Int -> TxId -> DocCooked +instance PrettyCooked Pl.TxId where + prettyCookedOpt :: PrettyCookedOpts -> TxId -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts = Int -> TxId -> DocCooked forall a. Show a => Int -> a -> DocCooked prettyHash (PrettyCookedOpts -> Int pcOptPrintedHashLength PrettyCookedOpts -opts) +opts) -instance PrettyCooked Pl.TxOutRef where - prettyCookedOpt :: PrettyCookedOpts -> TxOutRef -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts (Pl.TxOutRef TxId -txId Integer -index) = +instance PrettyCooked Pl.TxOutRef where + prettyCookedOpt :: PrettyCookedOpts -> TxOutRef -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts (Pl.TxOutRef TxId +txId Integer +index) = Int -> TxId -> DocCooked forall a. Show a => Int -> a -> DocCooked prettyHash (PrettyCookedOpts -> Int pcOptPrintedHashLength PrettyCookedOpts -opts) TxId -txId DocCooked -> DocCooked -> DocCooked +opts) TxId +txId DocCooked -> DocCooked -> DocCooked forall a. Semigroup a => a -> a -> a <> DocCooked "!" DocCooked -> DocCooked -> DocCooked @@ -101,17 +101,17 @@ <> PrettyCookedOpts -> Integer -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Integer -index +opts Integer +index -instance PrettyCooked (Pl.Versioned Pl.MintingPolicy) where - prettyCookedOpt :: PrettyCookedOpts -> Versioned MintingPolicy -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts = Int -> MintingPolicyHash -> DocCooked +instance PrettyCooked (Pl.Versioned Pl.MintingPolicy) where + prettyCookedOpt :: PrettyCookedOpts -> Versioned MintingPolicy -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts = Int -> MintingPolicyHash -> DocCooked forall a. Show a => Int -> a -> DocCooked prettyHash (PrettyCookedOpts -> Int pcOptPrintedHashLength PrettyCookedOpts -opts) (MintingPolicyHash -> DocCooked) +opts) (MintingPolicyHash -> DocCooked) -> (Versioned MintingPolicy -> MintingPolicyHash) -> Versioned MintingPolicy -> DocCooked @@ -119,25 +119,25 @@ . Versioned MintingPolicy -> MintingPolicyHash Pl.mintingPolicyHash -instance PrettyCooked Pl.Address where - prettyCookedOpt :: PrettyCookedOpts -> Address -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts (Pl.Address Credential -addrCr Maybe StakingCredential +instance PrettyCooked Pl.Address where + prettyCookedOpt :: PrettyCookedOpts -> Address -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts (Pl.Address Credential +addrCr Maybe StakingCredential Nothing) = PrettyCookedOpts -> Credential -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Credential -addrCr - prettyCookedOpt PrettyCookedOpts -opts (Pl.Address Credential -addrCr (Just (Pl.StakingHash Credential -stakCr))) = +opts Credential +addrCr + prettyCookedOpt PrettyCookedOpts +opts (Pl.Address Credential +addrCr (Just (Pl.StakingHash Credential +stakCr))) = PrettyCookedOpts -> Credential -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Credential -addrCr DocCooked -> DocCooked -> DocCooked +opts Credential +addrCr DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann @@ -147,19 +147,19 @@ <+> PrettyCookedOpts -> Credential -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Credential -stakCr) - prettyCookedOpt PrettyCookedOpts -opts (Pl.Address Credential -addrCr (Just (Pl.StakingPtr Integer -p1 Integer -p2 Integer -p3))) = +opts Credential +stakCr) + prettyCookedOpt PrettyCookedOpts +opts (Pl.Address Credential +addrCr (Just (Pl.StakingPtr Integer +p1 Integer +p2 Integer +p3))) = PrettyCookedOpts -> Credential -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Credential -addrCr DocCooked -> DocCooked -> DocCooked +opts Credential +addrCr DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann @@ -169,39 +169,39 @@ <+> (Integer, Integer, Integer) -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty (Integer -p1, Integer -p2, Integer -p3)) +p1, Integer +p2, Integer +p3)) -instance PrettyCooked Pl.PubKeyHash where +instance PrettyCooked Pl.PubKeyHash where -- If the pubkey is a known wallet -- #abcdef (wallet 3) -- -- Otherwise -- #123456 -- - prettyCookedOpt :: PrettyCookedOpts -> PubKeyHash -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts PubKeyHash -pkh = + prettyCookedOpt :: PrettyCookedOpts -> PubKeyHash -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts PubKeyHash +pkh = case PubKeyHash -> Maybe Int walletPKHashToId PubKeyHash -pkh of +pkh of Maybe Int Nothing -> Int -> PubKeyHash -> DocCooked forall a. Show a => Int -> a -> DocCooked prettyHash (PrettyCookedOpts -> Int pcOptPrintedHashLength PrettyCookedOpts -opts) PubKeyHash -pkh - Just Int -walletId -> +opts) PubKeyHash +pkh + Just Int +walletId -> Int -> PubKeyHash -> DocCooked forall a. Show a => Int -> a -> DocCooked prettyHash (PrettyCookedOpts -> Int pcOptPrintedHashLength PrettyCookedOpts -opts) PubKeyHash -pkh +opts) PubKeyHash +pkh DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> DocCooked -> DocCooked @@ -212,33 +212,33 @@ <+> Int -> DocCooked forall a ann. Show a => a -> Doc ann PP.viaShow Int -walletId) +walletId) -instance PrettyCooked Pl.Credential where - prettyCookedOpt :: PrettyCookedOpts -> Credential -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts (Pl.ScriptCredential ValidatorHash -vh) = DocCooked +instance PrettyCooked Pl.Credential where + prettyCookedOpt :: PrettyCookedOpts -> Credential -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts (Pl.ScriptCredential ValidatorHash +vh) = DocCooked "script" DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> Int -> ValidatorHash -> DocCooked forall a. Show a => Int -> a -> DocCooked prettyHash (PrettyCookedOpts -> Int pcOptPrintedHashLength PrettyCookedOpts -opts) ValidatorHash -vh - prettyCookedOpt PrettyCookedOpts -opts (Pl.PubKeyCredential PubKeyHash -pkh) = DocCooked +opts) ValidatorHash +vh + prettyCookedOpt PrettyCookedOpts +opts (Pl.PubKeyCredential PubKeyHash +pkh) = DocCooked "pubkey" DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> PrettyCookedOpts -> PubKeyHash -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts PubKeyHash -pkh +opts PubKeyHash +pkh -instance PrettyCooked Pl.Value where +instance PrettyCooked Pl.Value where -- Example output: -- -- > Value: @@ -248,11 +248,11 @@ -- -- In case of an empty value (even though not an empty map): -- > Empty value - prettyCookedOpt :: PrettyCookedOpts -> Value -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts = + prettyCookedOpt :: PrettyCookedOpts -> Value -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts = [DocCooked] -> DocCooked -prettySingletons +prettySingletons ([DocCooked] -> DocCooked) -> (Value -> [DocCooked]) -> Value -> DocCooked forall b c a. (b -> c) -> (a -> b) -> a -> c @@ -260,7 +260,7 @@ -> [(CurrencySymbol, TokenName, Integer)] -> [DocCooked] forall a b. (a -> b) -> [a] -> [b] map (CurrencySymbol, TokenName, Integer) -> DocCooked -prettySingletonValue +prettySingletonValue ([(CurrencySymbol, TokenName, Integer)] -> [DocCooked]) -> (Value -> [(CurrencySymbol, TokenName, Integer)]) -> Value @@ -272,9 +272,9 @@ forall a. (a -> Bool) -> [a] -> [a] filter (\(CurrencySymbol _, TokenName -_, Integer -n) -> Integer -n Integer -> Integer -> Bool +_, Integer +n) -> Integer +n Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool /= Integer 0) @@ -287,32 +287,32 @@ . Value -> [(CurrencySymbol, TokenName, Integer)] Pl.flattenValue where - prettySingletons :: [DocCooked] -> DocCooked - prettySingletons :: [DocCooked] -> DocCooked -prettySingletons [] = DocCooked + prettySingletons :: [DocCooked] -> DocCooked + prettySingletons :: [DocCooked] -> DocCooked +prettySingletons [] = DocCooked "Empty value" - prettySingletons [DocCooked -doc] = DocCooked -doc - prettySingletons [DocCooked] -docs = DocCooked -> DocCooked -> [DocCooked] -> DocCooked + prettySingletons [DocCooked +doc] = DocCooked +doc + prettySingletons [DocCooked] +docs = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked "Value:" DocCooked "-" [DocCooked] -docs - prettySingletonValue :: (Pl.CurrencySymbol, Pl.TokenName, Integer) -> DocCooked - prettySingletonValue :: (CurrencySymbol, TokenName, Integer) -> DocCooked -prettySingletonValue (CurrencySymbol -symbol, TokenName -name, Integer -amount) = +docs + prettySingletonValue :: (Pl.CurrencySymbol, Pl.TokenName, Integer) -> DocCooked + prettySingletonValue :: (CurrencySymbol, TokenName, Integer) -> DocCooked +prettySingletonValue (CurrencySymbol +symbol, TokenName +name, Integer +amount) = PrettyCookedOpts -> AssetClass -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts ((CurrencySymbol, TokenName) -> AssetClass +opts ((CurrencySymbol, TokenName) -> AssetClass Pl.AssetClass (CurrencySymbol -symbol, TokenName -name)) DocCooked -> DocCooked -> DocCooked +symbol, TokenName +name)) DocCooked -> DocCooked -> DocCooked forall a. Semigroup a => a -> a -> a <> DocCooked ":" DocCooked -> DocCooked -> DocCooked @@ -320,29 +320,29 @@ <+> PrettyCookedOpts -> Integer -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Integer -amount +opts Integer +amount -instance PrettyCooked Pl.CurrencySymbol where - prettyCookedOpt :: PrettyCookedOpts -> CurrencySymbol -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts CurrencySymbol -symbol +instance PrettyCooked Pl.CurrencySymbol where + prettyCookedOpt :: PrettyCookedOpts -> CurrencySymbol -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts CurrencySymbol +symbol | CurrencySymbol -symbol CurrencySymbol -> CurrencySymbol -> Bool +symbol CurrencySymbol -> CurrencySymbol -> Bool forall a. Eq a => a -> a -> Bool == BuiltinByteString -> CurrencySymbol Pl.CurrencySymbol BuiltinByteString "" = DocCooked "Lovelace" | CurrencySymbol -symbol CurrencySymbol -> CurrencySymbol -> Bool +symbol CurrencySymbol -> CurrencySymbol -> Bool forall a. Eq a => a -> a -> Bool == CurrencySymbol quickCurrencySymbol = DocCooked "Quick" | CurrencySymbol -symbol CurrencySymbol -> CurrencySymbol -> Bool +symbol CurrencySymbol -> CurrencySymbol -> Bool forall a. Eq a => a -> a -> Bool == CurrencySymbol permanentCurrencySymbol = DocCooked @@ -352,31 +352,31 @@ forall a. Show a => Int -> a -> DocCooked prettyHash (PrettyCookedOpts -> Int pcOptPrintedHashLength PrettyCookedOpts -opts) CurrencySymbol -symbol +opts) CurrencySymbol +symbol -instance PrettyCooked Pl.TokenName where - prettyCookedOpt :: PrettyCookedOpts -> TokenName -> DocCooked -prettyCookedOpt PrettyCookedOpts +instance PrettyCooked Pl.TokenName where + prettyCookedOpt :: PrettyCookedOpts -> TokenName -> DocCooked +prettyCookedOpt PrettyCookedOpts _ = TokenName -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty -instance PrettyCooked Pl.AssetClass where - prettyCookedOpt :: PrettyCookedOpts -> AssetClass -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts (Pl.AssetClass (CurrencySymbol -symbol, TokenName -name)) = +instance PrettyCooked Pl.AssetClass where + prettyCookedOpt :: PrettyCookedOpts -> AssetClass -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts (Pl.AssetClass (CurrencySymbol +symbol, TokenName +name)) = PrettyCookedOpts -> CurrencySymbol -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts CurrencySymbol -symbol +opts CurrencySymbol +symbol DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> if CurrencySymbol -symbol CurrencySymbol -> CurrencySymbol -> Bool +symbol CurrencySymbol -> CurrencySymbol -> Bool forall a. Eq a => a -> a -> Bool /= BuiltinByteString -> CurrencySymbol Pl.CurrencySymbol BuiltinByteString @@ -384,48 +384,48 @@ then PrettyCookedOpts -> TokenName -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts TokenName -name +opts TokenName +name else DocCooked forall a. Monoid a => a mempty -instance PrettyCooked Pl.ValidationErrorInPhase where +instance PrettyCooked Pl.ValidationErrorInPhase where -- In Plutus V2, most errors no longer have dedicated constructors we can -- pattern match on, they are mostly wrapped as text which makes it difficult -- to improve upon default printing. - prettyCookedOpt :: PrettyCookedOpts -> ValidationErrorInPhase -> DocCooked -prettyCookedOpt PrettyCookedOpts + prettyCookedOpt :: PrettyCookedOpts -> ValidationErrorInPhase -> DocCooked +prettyCookedOpt PrettyCookedOpts _ = ValidationErrorInPhase -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty -instance PrettyCooked Pl.POSIXTime where - prettyCookedOpt :: PrettyCookedOpts -> POSIXTime -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts (Pl.POSIXTime Integer -n) = DocCooked +instance PrettyCooked Pl.POSIXTime where + prettyCookedOpt :: PrettyCookedOpts -> POSIXTime -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts (Pl.POSIXTime Integer +n) = DocCooked "POSIXTime" DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> PrettyCookedOpts -> Integer -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Integer -n +opts Integer +n -instance PrettyCooked Pl.ScriptHash where - prettyCookedOpt :: PrettyCookedOpts -> ScriptHash -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts = Int -> ScriptHash -> DocCooked +instance PrettyCooked Pl.ScriptHash where + prettyCookedOpt :: PrettyCookedOpts -> ScriptHash -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts = Int -> ScriptHash -> DocCooked forall a. Show a => Int -> a -> DocCooked prettyHash (PrettyCookedOpts -> Int pcOptPrintedHashLength PrettyCookedOpts -opts) +opts) -instance PrettyCooked a => PrettyCooked [a] where - prettyCookedOpt :: PrettyCookedOpts -> [a] -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts = DocCooked -> [DocCooked] -> DocCooked +instance PrettyCooked a => PrettyCooked [a] where + prettyCookedOpt :: PrettyCookedOpts -> [a] -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts = DocCooked -> [DocCooked] -> DocCooked prettyItemizeNoTitle DocCooked "-" ([DocCooked] -> DocCooked) -> ([a] -> [DocCooked]) -> [a] -> DocCooked @@ -435,74 +435,74 @@ map (PrettyCookedOpts -> a -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts) +opts) -instance PrettyCooked Int where - prettyCookedOpt :: PrettyCookedOpts -> Int -> DocCooked -prettyCookedOpt PrettyCookedOpts +instance PrettyCooked Int where + prettyCookedOpt :: PrettyCookedOpts -> Int -> DocCooked +prettyCookedOpt PrettyCookedOpts _ = Int -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty -instance PrettyCooked Integer where - prettyCookedOpt :: PrettyCookedOpts -> Integer -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts = +instance PrettyCooked Integer where + prettyCookedOpt :: PrettyCookedOpts -> Integer -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts = if PrettyCookedOpts -> Bool pcOptNumericUnderscores PrettyCookedOpts -opts +opts then Integer -> DocCooked -prettyNumericUnderscore +prettyNumericUnderscore else Integer -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty where -- prettyNumericUnderscore 23798423723 -- 23_798_423_723 - prettyNumericUnderscore :: Integer -> DocCooked - prettyNumericUnderscore :: Integer -> DocCooked -prettyNumericUnderscore Integer -i + prettyNumericUnderscore :: Integer -> DocCooked + prettyNumericUnderscore :: Integer -> DocCooked +prettyNumericUnderscore Integer +i | Integer 0 Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer -i = DocCooked +i = DocCooked "0" | Integer -i Integer -> Integer -> Bool +i Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool > Integer 0 = DocCooked -> Integer -> Integer -> DocCooked -psnTerm DocCooked +psnTerm DocCooked "" Integer 0 Integer -i +i | Bool otherwise = DocCooked "-" DocCooked -> DocCooked -> DocCooked forall a. Semigroup a => a -> a -> a <> DocCooked -> Integer -> Integer -> DocCooked -psnTerm DocCooked +psnTerm DocCooked "" Integer 0 (-Integer -i) +i) where - psnTerm :: DocCooked -> Integer -> Integer -> DocCooked - psnTerm :: DocCooked -> Integer -> Integer -> DocCooked -psnTerm DocCooked -acc Integer + psnTerm :: DocCooked -> Integer -> Integer -> DocCooked + psnTerm :: DocCooked -> Integer -> Integer -> DocCooked +psnTerm DocCooked +acc Integer _ Integer 0 = DocCooked -acc - psnTerm DocCooked -acc Integer -3 Integer -nb = DocCooked -> Integer -> Integer -> DocCooked -psnTerm (Integer -> DocCooked +acc + psnTerm DocCooked +acc Integer +3 Integer +nb = DocCooked -> Integer -> Integer -> DocCooked +psnTerm (Integer -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty (Integer -nb Integer -> Integer -> Integer +nb Integer -> Integer -> Integer forall a. Integral a => a -> a -> a `mod` Integer 10) DocCooked -> DocCooked -> DocCooked @@ -511,52 +511,52 @@ "_" DocCooked -> DocCooked -> DocCooked forall a. Semigroup a => a -> a -> a <> DocCooked -acc) Integer +acc) Integer 1 (Integer -nb Integer -> Integer -> Integer +nb Integer -> Integer -> Integer forall a. Integral a => a -> a -> a `div` Integer 10) - psnTerm DocCooked -acc Integer -n Integer -nb = DocCooked -> Integer -> Integer -> DocCooked -psnTerm (Integer -> DocCooked + psnTerm DocCooked +acc Integer +n Integer +nb = DocCooked -> Integer -> Integer -> DocCooked +psnTerm (Integer -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty (Integer -nb Integer -> Integer -> Integer +nb Integer -> Integer -> Integer forall a. Integral a => a -> a -> a `mod` Integer 10) DocCooked -> DocCooked -> DocCooked forall a. Semigroup a => a -> a -> a <> DocCooked -acc) (Integer -n Integer -> Integer -> Integer +acc) (Integer +n Integer -> Integer -> Integer forall a. Num a => a -> a -> a + Integer 1) (Integer -nb Integer -> Integer -> Integer +nb Integer -> Integer -> Integer forall a. Integral a => a -> a -> a `div` Integer 10) -instance PrettyCooked Bool where - prettyCookedOpt :: PrettyCookedOpts -> Bool -> DocCooked -prettyCookedOpt PrettyCookedOpts +instance PrettyCooked Bool where + prettyCookedOpt :: PrettyCookedOpts -> Bool -> DocCooked +prettyCookedOpt PrettyCookedOpts _ = Bool -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty -instance PrettyCooked () where - prettyCookedOpt :: PrettyCookedOpts -> () -> DocCooked -prettyCookedOpt PrettyCookedOpts +instance PrettyCooked () where + prettyCookedOpt :: PrettyCookedOpts -> () -> DocCooked +prettyCookedOpt PrettyCookedOpts _ = () -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty -instance PrettyCooked Pl.BuiltinData where - prettyCookedOpt :: PrettyCookedOpts -> BuiltinData -> DocCooked -prettyCookedOpt PrettyCookedOpts +instance PrettyCooked Pl.BuiltinData where + prettyCookedOpt :: PrettyCookedOpts -> BuiltinData -> DocCooked +prettyCookedOpt PrettyCookedOpts _ = BuiltinData -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty diff --git a/src/Cooked.Pretty.Common.html b/src/Cooked.Pretty.Common.html index 3aa1c4d35..13e746caf 100644 --- a/src/Cooked.Pretty.Common.html +++ b/src/Cooked.Pretty.Common.html @@ -21,10 +21,10 @@ -- | Use this to convert a pretty-printer to a regular show function using -- default layout options. This is used in "Testing" because Tasty uses -- strings. -renderString :: (a -> DocCooked) -> a -> String +renderString :: (a -> DocCooked) -> a -> String renderString :: (a -> DocCooked) -> a -> String -renderString a -> DocCooked -printer = SimpleDocStream () -> String +renderString a -> DocCooked +printer = SimpleDocStream () -> String forall ann. SimpleDocStream ann -> String PP.renderString (SimpleDocStream () -> String) -> (a -> SimpleDocStream ()) -> a -> String @@ -36,7 +36,7 @@ -> (a -> DocCooked) -> a -> SimpleDocStream () forall b c a. (b -> c) -> (a -> b) -> a -> c . a -> DocCooked -printer +printer -- | Print an item list with a title. -- @@ -47,15 +47,15 @@ -- - bar3 prettyItemize :: DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize :: DocCooked -> DocCooked -> [DocCooked] -> DocCooked -prettyItemize DocCooked -title DocCooked -bullet [DocCooked] -items = +prettyItemize DocCooked +title DocCooked +bullet [DocCooked] +items = [DocCooked] -> DocCooked forall ann. [Doc ann] -> Doc ann PP.vsep [ DocCooked -title, +title, Int -> DocCooked -> DocCooked forall ann. Int -> Doc ann -> Doc ann PP.indent Int @@ -64,16 +64,16 @@ forall b c a. (b -> c) -> (a -> b) -> a -> c . DocCooked -> [DocCooked] -> DocCooked prettyItemizeNoTitle DocCooked -bullet ([DocCooked] -> DocCooked) -> [DocCooked] -> DocCooked +bullet ([DocCooked] -> DocCooked) -> [DocCooked] -> DocCooked forall a b. (a -> b) -> a -> b $ [DocCooked] -items +items ] prettyItemizeNoTitle :: DocCooked -> [DocCooked] -> DocCooked prettyItemizeNoTitle :: DocCooked -> [DocCooked] -> DocCooked -prettyItemizeNoTitle DocCooked -bullet = [DocCooked] -> DocCooked +prettyItemizeNoTitle DocCooked +bullet = [DocCooked] -> DocCooked forall ann. [Doc ann] -> Doc ann PP.vsep ([DocCooked] -> DocCooked) -> ([DocCooked] -> [DocCooked]) -> [DocCooked] -> DocCooked @@ -81,7 +81,7 @@ . (DocCooked -> DocCooked) -> [DocCooked] -> [DocCooked] forall a b. (a -> b) -> [a] -> [b] map (DocCooked -bullet DocCooked -> DocCooked -> DocCooked +bullet DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+>) @@ -92,30 +92,30 @@ _ [] = Maybe DocCooked forall a. Maybe a Nothing -prettyItemizeNonEmpty DocCooked -title DocCooked -bullet [DocCooked] -items = DocCooked -> Maybe DocCooked +prettyItemizeNonEmpty DocCooked +title DocCooked +bullet [DocCooked] +items = DocCooked -> Maybe DocCooked forall a. a -> Maybe a Just (DocCooked -> Maybe DocCooked) -> DocCooked -> Maybe DocCooked forall a b. (a -> b) -> a -> b $ DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked -title DocCooked -bullet [DocCooked] -items +title DocCooked +bullet [DocCooked] +items prettyEnumerate :: DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyEnumerate :: DocCooked -> DocCooked -> [DocCooked] -> DocCooked -prettyEnumerate DocCooked -title DocCooked -bullet [DocCooked] -items = +prettyEnumerate DocCooked +title DocCooked +bullet [DocCooked] +items = [DocCooked] -> DocCooked forall ann. [Doc ann] -> Doc ann PP.vsep [ DocCooked -title, +title, Int -> DocCooked -> DocCooked forall ann. Int -> Doc ann -> Doc ann PP.indent Int @@ -130,29 +130,29 @@ (Int -> DocCooked -> DocCooked) -> [Int] -> [DocCooked] -> [DocCooked] forall a b c. (a -> b -> c) -> [a] -> [b] -> [c] -zipWith (\Int -index DocCooked -item -> Int -> DocCooked +zipWith (\Int +index DocCooked +item -> Int -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty Int -index DocCooked -> DocCooked -> DocCooked +index DocCooked -> DocCooked -> DocCooked forall a. Semigroup a => a -> a -> a <> DocCooked -bullet DocCooked -> DocCooked -> DocCooked +bullet DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann PP.align DocCooked -item) [Int +item) [Int 1 :: Int ..] [DocCooked] -items +items ] -- | Pretty print a prefix of a hash with a given length. -prettyHash :: (Show a) => Int -> a -> DocCooked +prettyHash :: (Show a) => Int -> a -> DocCooked prettyHash :: Int -> a -> DocCooked -prettyHash Int -printedLength = String -> DocCooked +prettyHash Int +printedLength = String -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty (String -> DocCooked) -> (a -> String) -> a -> DocCooked forall b c a. (b -> c) -> (a -> b) -> a -> c @@ -164,7 +164,7 @@ . Int -> String -> String forall a. Int -> [a] -> [a] take Int -printedLength (String -> String) -> (a -> String) -> a -> String +printedLength (String -> String) -> (a -> String) -> a -> String forall b c a. (b -> c) -> (a -> b) -> a -> c . a -> String forall a. Show a => a -> String diff --git a/src/Cooked.Pretty.Cooked.html b/src/Cooked.Pretty.Cooked.html index 4578c58f3..0ee8f76db 100644 --- a/src/Cooked.Pretty.Cooked.html +++ b/src/Cooked.Pretty.Cooked.html @@ -60,40 +60,40 @@ -- | The 'PrettyCooked' instance for 'TxSkelOutDatum' prints the datum it -- contains according to its own 'PrettyCooked' instance. -instance PrettyCooked TxSkelOutDatum where - prettyCookedOpt :: PrettyCookedOpts -> TxSkelOutDatum -> DocCooked +instance PrettyCooked TxSkelOutDatum where + prettyCookedOpt :: PrettyCookedOpts -> TxSkelOutDatum -> DocCooked prettyCookedOpt PrettyCookedOpts _ TxSkelOutDatum TxSkelOutNoDatum = DocCooked forall a. Monoid a => a mempty - prettyCookedOpt PrettyCookedOpts -opts (TxSkelOutDatumHash a -datum) = PrettyCookedOpts -> a -> DocCooked + prettyCookedOpt PrettyCookedOpts +opts (TxSkelOutDatumHash a +datum) = PrettyCookedOpts -> a -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts a -datum - prettyCookedOpt PrettyCookedOpts -opts (TxSkelOutDatum a -datum) = PrettyCookedOpts -> a -> DocCooked +opts a +datum + prettyCookedOpt PrettyCookedOpts +opts (TxSkelOutDatum a +datum) = PrettyCookedOpts -> a -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts a -datum - prettyCookedOpt PrettyCookedOpts -opts (TxSkelOutInlineDatum a -datum) = PrettyCookedOpts -> a -> DocCooked +opts a +datum + prettyCookedOpt PrettyCookedOpts +opts (TxSkelOutInlineDatum a +datum) = PrettyCookedOpts -> a -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts a -datum +opts a +datum -instance PrettyCooked MockChainError where - prettyCookedOpt :: PrettyCookedOpts -> MockChainError -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts (MCEValidationError ValidationErrorInPhase -plutusError) = +instance PrettyCooked MockChainError where + prettyCookedOpt :: PrettyCookedOpts -> MockChainError -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts (MCEValidationError ValidationErrorInPhase +plutusError) = [DocCooked] -> DocCooked forall ann. [Doc ann] -> Doc ann PP.vsep [DocCooked @@ -103,14 +103,14 @@ 2 (PrettyCookedOpts -> ValidationErrorInPhase -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts ValidationErrorInPhase -plutusError)] +opts ValidationErrorInPhase +plutusError)] -- Here we don't print the skel because we lack its context and this error is -- printed alongside the skeleton when a test fails - prettyCookedOpt PrettyCookedOpts -opts (MCEUnbalanceable (MCEUnbalNotEnoughFunds Wallet -balWallet Value -targetValue) TxSkel + prettyCookedOpt PrettyCookedOpts +opts (MCEUnbalanceable (MCEUnbalNotEnoughFunds Wallet +balWallet Value +targetValue) TxSkel _) = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize @@ -121,9 +121,9 @@ [ PrettyCookedOpts -> PubKeyHash -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (Wallet -> PubKeyHash +opts (Wallet -> PubKeyHash walletPKHash Wallet -balWallet) DocCooked -> DocCooked -> DocCooked +balWallet) DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> DocCooked "has not enough funds", @@ -133,16 +133,16 @@ <+> PrettyCookedOpts -> Value -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Value -targetValue +opts Value +targetValue ] - prettyCookedOpt PrettyCookedOpts -opts (MCEUnbalanceable (MCEUnbalNotEnoughReturning (Value -spentValue, [TxOutRef] -spentTxOuts) (Value -remainingValue, [TxOutRef] -remainingTxOuts) Value -returnValue) TxSkel + prettyCookedOpt PrettyCookedOpts +opts (MCEUnbalanceable (MCEUnbalNotEnoughReturning (Value +spentValue, [TxOutRef] +spentTxOuts) (Value +remainingValue, [TxOutRef] +remainingTxOuts) Value +returnValue) TxSkel _) = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize @@ -157,8 +157,8 @@ <+> PrettyCookedOpts -> Value -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Value -returnValue, +opts Value +returnValue, DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked @@ -168,8 +168,8 @@ [ PrettyCookedOpts -> Value -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Value -spentValue, +opts Value +spentValue, DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked @@ -179,10 +179,10 @@ (PrettyCookedOpts -> TxOutRef -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (TxOutRef -> DocCooked) -> [TxOutRef] -> [DocCooked] +opts (TxOutRef -> DocCooked) -> [TxOutRef] -> [DocCooked] forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> [TxOutRef] -spentTxOuts) +spentTxOuts) ], DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize @@ -193,8 +193,8 @@ [ PrettyCookedOpts -> Value -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Value -remainingValue, +opts Value +remainingValue, DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked @@ -204,10 +204,10 @@ (PrettyCookedOpts -> TxOutRef -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (TxOutRef -> DocCooked) -> [TxOutRef] -> [DocCooked] +opts (TxOutRef -> DocCooked) -> [TxOutRef] -> [DocCooked] forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> [TxOutRef] -remainingTxOuts) +remainingTxOuts) ] ] prettyCookedOpt PrettyCookedOpts @@ -216,9 +216,9 @@ DocCooked "No suitable collateral" prettyCookedOpt PrettyCookedOpts -_ (MCEGenerationError (ToCardanoError String -msg ToCardanoError -cardanoError)) = +_ (MCEGenerationError (ToCardanoError String +msg ToCardanoError +cardanoError)) = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked @@ -228,13 +228,13 @@ [String -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty String -msg, ToCardanoError -> DocCooked +msg, ToCardanoError -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty ToCardanoError -cardanoError] +cardanoError] prettyCookedOpt PrettyCookedOpts -_ (MCEGenerationError (GenerateTxErrorGeneral String -msg)) = +_ (MCEGenerationError (GenerateTxErrorGeneral String +msg)) = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked @@ -244,11 +244,11 @@ [String -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty String -msg] +msg] prettyCookedOpt PrettyCookedOpts -_ (MCEGenerationError (TxBodyError String -msg TxBodyError -err)) = +_ (MCEGenerationError (TxBodyError String +msg TxBodyError +err)) = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked @@ -258,13 +258,13 @@ [String -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty String -msg, TxBodyError -> DocCooked +msg, TxBodyError -> DocCooked forall a ann. Show a => a -> Doc ann PP.viaShow TxBodyError -err] - prettyCookedOpt PrettyCookedOpts -opts (MCECalcFee MockChainError -err) = +err] + prettyCookedOpt PrettyCookedOpts +opts (MCECalcFee MockChainError +err) = [DocCooked] -> DocCooked forall ann. [Doc ann] -> Doc ann PP.vsep [DocCooked @@ -274,12 +274,12 @@ 2 (PrettyCookedOpts -> MockChainError -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts MockChainError -err)] - prettyCookedOpt PrettyCookedOpts -opts (MCEUnknownOutRefError String -msg TxOutRef -txOutRef) = +opts MockChainError +err)] + prettyCookedOpt PrettyCookedOpts +opts (MCEUnknownOutRefError String +msg TxOutRef +txOutRef) = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked @@ -289,25 +289,25 @@ [String -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty String -msg, PrettyCookedOpts -> TxOutRef -> DocCooked +msg, PrettyCookedOpts -> TxOutRef -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts TxOutRef -txOutRef] +opts TxOutRef +txOutRef] prettyCookedOpt PrettyCookedOpts -_ (FailWith String -msg) = +_ (FailWith String +msg) = DocCooked "Failed with:" DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> String -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty String -msg - prettyCookedOpt PrettyCookedOpts -opts (MCEUnknownValidator String -msg ValidatorHash -valHash) = +msg + prettyCookedOpt PrettyCookedOpts +opts (MCEUnknownValidator String +msg ValidatorHash +valHash) = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked @@ -317,19 +317,19 @@ [String -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty String -msg, DocCooked +msg, DocCooked "hash:" DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> Int -> ValidatorHash -> DocCooked forall a. Show a => Int -> a -> DocCooked prettyHash (PrettyCookedOpts -> Int pcOptPrintedHashLength PrettyCookedOpts -opts) ValidatorHash -valHash] - prettyCookedOpt PrettyCookedOpts -opts (MCEUnknownDatum String -msg DatumHash -dHash) = +opts) ValidatorHash +valHash] + prettyCookedOpt PrettyCookedOpts +opts (MCEUnknownDatum String +msg DatumHash +dHash) = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked @@ -339,18 +339,18 @@ [String -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty String -msg, DocCooked +msg, DocCooked "hash:" DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> Int -> DatumHash -> DocCooked forall a. Show a => Int -> a -> DocCooked prettyHash (PrettyCookedOpts -> Int pcOptPrintedHashLength PrettyCookedOpts -opts) DatumHash -dHash] +opts) DatumHash +dHash] prettyCookedOpt PrettyCookedOpts -_ (OtherMockChainError err -err) = +_ (OtherMockChainError err +err) = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked @@ -360,14 +360,14 @@ [err -> DocCooked forall a ann. Show a => a -> Doc ann PP.viaShow err -err] +err] -instance Show a => PrettyCooked (a, UtxoState) where - prettyCookedOpt :: PrettyCookedOpts -> (a, UtxoState) -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts (a -res, UtxoState -state) = +instance Show a => PrettyCooked (a, UtxoState) where + prettyCookedOpt :: PrettyCookedOpts -> (a, UtxoState) -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts (a +res, UtxoState +state) = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked @@ -380,43 +380,43 @@ <+> a -> DocCooked forall a ann. Show a => a -> Doc ann PP.viaShow a -res, PrettyCookedOpts -> UtxoState -> DocCooked +res, PrettyCookedOpts -> UtxoState -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts UtxoState -state] +opts UtxoState +state] -instance Show a => PrettyCooked (Either MockChainError (a, UtxoState)) where - prettyCookedOpt :: PrettyCookedOpts +instance Show a => PrettyCooked (Either MockChainError (a, UtxoState)) where + prettyCookedOpt :: PrettyCookedOpts -> Either MockChainError (a, UtxoState) -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts (Left MockChainError -err) = DocCooked +prettyCookedOpt PrettyCookedOpts +opts (Left MockChainError +err) = DocCooked "🔴" DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> PrettyCookedOpts -> MockChainError -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts MockChainError -err - prettyCookedOpt PrettyCookedOpts -opts (Right (a, UtxoState) -endState) = DocCooked +opts MockChainError +err + prettyCookedOpt PrettyCookedOpts +opts (Right (a, UtxoState) +endState) = DocCooked "🟢" DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> PrettyCookedOpts -> (a, UtxoState) -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (a, UtxoState) -endState +opts (a, UtxoState) +endState -- | This pretty prints a 'MockChainLog' that usually consists of the list of -- validated or submitted transactions. In the log, we know a transaction has -- been validated if the 'MCLogSubmittedTxSkel' is followed by a 'MCLogNewTx'. -instance PrettyCooked MockChainLog where - prettyCookedOpt :: PrettyCookedOpts -> MockChainLog -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts = +instance PrettyCooked MockChainLog where + prettyCookedOpt :: PrettyCookedOpts -> MockChainLog -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyEnumerate DocCooked "MockChain run:" DocCooked @@ -425,7 +425,7 @@ -> (MockChainLog -> [DocCooked]) -> MockChainLog -> DocCooked forall b c a. (b -> c) -> (a -> b) -> a -> c . [DocCooked] -> [MockChainLogEntry] -> [DocCooked] -go [] +go [] ([MockChainLogEntry] -> [DocCooked]) -> (MockChainLog -> [MockChainLogEntry]) -> MockChainLog @@ -437,24 +437,24 @@ -- In order to avoid printing 'MockChainLogValidateTxSkel' then -- 'MockChainLogNewTx' as two different items, we combine them into one -- single 'DocCooked' - go :: [DocCooked] -> [MockChainLogEntry] -> [DocCooked] - go :: [DocCooked] -> [MockChainLogEntry] -> [DocCooked] -go - [DocCooked] -acc - ( MCLogSubmittedTxSkel SkelContext -skelContext TxSkel -skel - : MCLogNewTx TxId -txId - : [MockChainLogEntry] -entries + go :: [DocCooked] -> [MockChainLogEntry] -> [DocCooked] + go :: [DocCooked] -> [MockChainLogEntry] -> [DocCooked] +go + [DocCooked] +acc + ( MCLogSubmittedTxSkel SkelContext +skelContext TxSkel +skel + : MCLogNewTx TxId +txId + : [MockChainLogEntry] +entries ) | PrettyCookedOpts -> Bool pcOptPrintTxHashes PrettyCookedOpts -opts = +opts = [DocCooked] -> [MockChainLogEntry] -> [DocCooked] -go +go ( DocCooked "Validated" DocCooked -> DocCooked -> DocCooked @@ -467,112 +467,112 @@ <+> PrettyCookedOpts -> TxId -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts TxId -txId) +opts TxId +txId) DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> PrettyCookedOpts -> SkelContext -> TxSkel -> DocCooked prettyTxSkel PrettyCookedOpts -opts SkelContext -skelContext TxSkel -skel +opts SkelContext +skelContext TxSkel +skel DocCooked -> [DocCooked] -> [DocCooked] forall a. a -> [a] -> [a] : [DocCooked] -acc +acc ) [MockChainLogEntry] -entries +entries | Bool otherwise = [DocCooked] -> [MockChainLogEntry] -> [DocCooked] -go (DocCooked +go (DocCooked "Validated" DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> PrettyCookedOpts -> SkelContext -> TxSkel -> DocCooked prettyTxSkel PrettyCookedOpts -opts SkelContext -skelContext TxSkel -skel DocCooked -> [DocCooked] -> [DocCooked] +opts SkelContext +skelContext TxSkel +skel DocCooked -> [DocCooked] -> [DocCooked] forall a. a -> [a] -> [a] : [DocCooked] -acc) [MockChainLogEntry] -entries - go - [DocCooked] -acc - ( MCLogSubmittedTxSkel SkelContext -skelContext TxSkel -skel - : [MockChainLogEntry] -entries +acc) [MockChainLogEntry] +entries + go + [DocCooked] +acc + ( MCLogSubmittedTxSkel SkelContext +skelContext TxSkel +skel + : [MockChainLogEntry] +entries ) = [DocCooked] -> [MockChainLogEntry] -> [DocCooked] -go (DocCooked +go (DocCooked "Submitted" DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> PrettyCookedOpts -> SkelContext -> TxSkel -> DocCooked prettyTxSkel PrettyCookedOpts -opts SkelContext -skelContext TxSkel -skel DocCooked -> [DocCooked] -> [DocCooked] +opts SkelContext +skelContext TxSkel +skel DocCooked -> [DocCooked] -> [DocCooked] forall a. a -> [a] -> [a] : [DocCooked] -acc) [MockChainLogEntry] -entries - go [DocCooked] -acc (MCLogFail String -msg : [MockChainLogEntry] -entries) = +acc) [MockChainLogEntry] +entries + go [DocCooked] +acc (MCLogFail String +msg : [MockChainLogEntry] +entries) = [DocCooked] -> [MockChainLogEntry] -> [DocCooked] -go (DocCooked +go (DocCooked "Fail:" DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> String -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty String -msg DocCooked -> [DocCooked] -> [DocCooked] +msg DocCooked -> [DocCooked] -> [DocCooked] forall a. a -> [a] -> [a] : [DocCooked] -acc) [MockChainLogEntry] -entries +acc) [MockChainLogEntry] +entries -- This case is not supposed to occur because it should follow a -- 'MCLogSubmittedTxSkel' - go [DocCooked] -acc (MCLogNewTx TxId -txId : [MockChainLogEntry] -entries) = + go [DocCooked] +acc (MCLogNewTx TxId +txId : [MockChainLogEntry] +entries) = [DocCooked] -> [MockChainLogEntry] -> [DocCooked] -go (DocCooked +go (DocCooked "New transaction:" DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> PrettyCookedOpts -> TxId -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts TxId -txId DocCooked -> [DocCooked] -> [DocCooked] +opts TxId +txId DocCooked -> [DocCooked] -> [DocCooked] forall a. a -> [a] -> [a] : [DocCooked] -acc) [MockChainLogEntry] -entries - go [DocCooked] -acc [] = [DocCooked] -> [DocCooked] +acc) [MockChainLogEntry] +entries + go [DocCooked] +acc [] = [DocCooked] -> [DocCooked] forall a. [a] -> [a] reverse [DocCooked] -acc +acc prettyTxSkel :: PrettyCookedOpts -> SkelContext -> TxSkel -> DocCooked prettyTxSkel :: PrettyCookedOpts -> SkelContext -> TxSkel -> DocCooked -prettyTxSkel PrettyCookedOpts -opts SkelContext -skelContext (TxSkel Set TxLabel -lbl TxOpts -txopts TxSkelMints -mints [Wallet] -signers SlotRange -validityRange Map TxOutRef TxSkelRedeemer -ins Set TxOutRef -insReference [TxSkelOut] -outs) = +prettyTxSkel PrettyCookedOpts +opts SkelContext +skelContext (TxSkel Set TxLabel +lbl TxOpts +txopts TxSkelMints +mints [Wallet] +signers SlotRange +validityRange Map TxOutRef TxSkelRedeemer +ins Set TxOutRef +insReference [TxSkelOut] +outs) = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked @@ -592,11 +592,11 @@ <$> Set TxLabel -> [TxLabel] forall a. Set a -> [a] Set.toList Set TxLabel -lbl), +lbl), PrettyCookedOpts -> TxOpts -> Maybe DocCooked mPrettyTxOpts PrettyCookedOpts -opts TxOpts -txopts, +opts TxOpts +txopts, DocCooked -> DocCooked -> [DocCooked] -> Maybe DocCooked prettyItemizeNonEmpty DocCooked "Mints:" DocCooked @@ -604,7 +604,7 @@ -> (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> DocCooked prettyMints PrettyCookedOpts -opts ((Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) +opts ((Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> DocCooked) -> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -> [DocCooked] @@ -612,7 +612,7 @@ <$> TxSkelMints -> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] txSkelMintsToList TxSkelMints -mints), +mints), DocCooked -> Maybe DocCooked forall a. a -> Maybe a Just (DocCooked -> Maybe DocCooked) -> DocCooked -> Maybe DocCooked @@ -623,29 +623,29 @@ <+> SlotRange -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty SlotRange -validityRange, +validityRange, DocCooked -> DocCooked -> [DocCooked] -> Maybe DocCooked prettyItemizeNonEmpty DocCooked "Signers:" DocCooked "-" (PrettyCookedOpts -> TxOpts -> [Wallet] -> [DocCooked] prettySigners PrettyCookedOpts -opts TxOpts -txopts [Wallet] -signers), +opts TxOpts +txopts [Wallet] +signers), DocCooked -> DocCooked -> [DocCooked] -> Maybe DocCooked prettyItemizeNonEmpty DocCooked "Inputs:" DocCooked "-" (PrettyCookedOpts -> SkelContext -> (TxOutRef, TxSkelRedeemer) -> DocCooked prettyTxSkelIn PrettyCookedOpts -opts SkelContext -skelContext ((TxOutRef, TxSkelRedeemer) -> DocCooked) +opts SkelContext +skelContext ((TxOutRef, TxSkelRedeemer) -> DocCooked) -> [(TxOutRef, TxSkelRedeemer)] -> [DocCooked] forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Map TxOutRef TxSkelRedeemer -> [(TxOutRef, TxSkelRedeemer)] forall k a. Map k a -> [(k, a)] Map.toList Map TxOutRef TxSkelRedeemer -ins), +ins), DocCooked -> DocCooked -> [DocCooked] -> Maybe DocCooked prettyItemizeNonEmpty DocCooked "Reference inputs:" DocCooked @@ -653,22 +653,22 @@ forall a b. (a -> Maybe b) -> [a] -> [b] mapMaybe (PrettyCookedOpts -> SkelContext -> TxOutRef -> Maybe DocCooked prettyTxSkelInReference PrettyCookedOpts -opts SkelContext -skelContext) ([TxOutRef] -> [DocCooked]) -> [TxOutRef] -> [DocCooked] +opts SkelContext +skelContext) ([TxOutRef] -> [DocCooked]) -> [TxOutRef] -> [DocCooked] forall a b. (a -> b) -> a -> b $ Set TxOutRef -> [TxOutRef] forall a. Set a -> [a] Set.toList Set TxOutRef -insReference), +insReference), DocCooked -> DocCooked -> [DocCooked] -> Maybe DocCooked prettyItemizeNonEmpty DocCooked "Outputs:" DocCooked "-" (PrettyCookedOpts -> TxSkelOut -> DocCooked prettyTxSkelOut PrettyCookedOpts -opts (TxSkelOut -> DocCooked) -> [TxSkelOut] -> [DocCooked] +opts (TxSkelOut -> DocCooked) -> [TxSkelOut] -> [DocCooked] forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> [TxSkelOut] -outs) +outs) ] ) @@ -676,15 +676,15 @@ -- this is the balancing wallet prettyBalancingWallet :: PrettyCookedOpts -> Wallet -> DocCooked prettyBalancingWallet :: PrettyCookedOpts -> Wallet -> DocCooked -prettyBalancingWallet PrettyCookedOpts -opts Wallet -w = +prettyBalancingWallet PrettyCookedOpts +opts Wallet +w = PrettyCookedOpts -> PubKeyHash -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (Wallet -> PubKeyHash +opts (Wallet -> PubKeyHash walletPKHash Wallet -w) DocCooked -> DocCooked -> DocCooked +w) DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> DocCooked "[Balancing]" @@ -692,66 +692,66 @@ -- | Prints a list of pubkeys with a flag next to the balancing wallet prettySigners :: PrettyCookedOpts -> TxOpts -> [Wallet] -> [DocCooked] prettySigners :: PrettyCookedOpts -> TxOpts -> [Wallet] -> [DocCooked] -prettySigners PrettyCookedOpts -opts TxOpts {txOptBalanceWallet :: TxOpts -> BalancingWallet +prettySigners PrettyCookedOpts +opts TxOpts {txOptBalanceWallet :: TxOpts -> BalancingWallet txOptBalanceWallet = BalancingWallet -BalanceWithFirstSigner} (Wallet -firstSigner : [Wallet] -signers) = +BalanceWithFirstSigner} (Wallet +firstSigner : [Wallet] +signers) = PrettyCookedOpts -> Wallet -> DocCooked prettyBalancingWallet PrettyCookedOpts -opts Wallet -firstSigner DocCooked -> [DocCooked] -> [DocCooked] +opts Wallet +firstSigner DocCooked -> [DocCooked] -> [DocCooked] forall a. a -> [a] -> [a] : (PrettyCookedOpts -> PubKeyHash -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (PubKeyHash -> DocCooked) +opts (PubKeyHash -> DocCooked) -> (Wallet -> PubKeyHash) -> Wallet -> DocCooked forall b c a. (b -> c) -> (a -> b) -> a -> c . Wallet -> PubKeyHash walletPKHash (Wallet -> DocCooked) -> [Wallet] -> [DocCooked] forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> [Wallet] -signers) -prettySigners PrettyCookedOpts -opts TxOpts {txOptBalanceWallet :: TxOpts -> BalancingWallet -txOptBalanceWallet = BalanceWith Wallet -balancingWallet} [Wallet] -signers = +signers) +prettySigners PrettyCookedOpts +opts TxOpts {txOptBalanceWallet :: TxOpts -> BalancingWallet +txOptBalanceWallet = BalanceWith Wallet +balancingWallet} [Wallet] +signers = [Wallet] -> [DocCooked] -aux [Wallet] -signers +aux [Wallet] +signers where - aux :: [Wallet] -> [DocCooked] - aux :: [Wallet] -> [DocCooked] -aux [] = [] - aux (Wallet -s : [Wallet] -ss) + aux :: [Wallet] -> [DocCooked] + aux :: [Wallet] -> [DocCooked] +aux [] = [] + aux (Wallet +s : [Wallet] +ss) | Wallet -s Wallet -> Wallet -> Bool +s Wallet -> Wallet -> Bool forall a. Eq a => a -> a -> Bool == Wallet -balancingWallet = PrettyCookedOpts -> Wallet -> DocCooked +balancingWallet = PrettyCookedOpts -> Wallet -> DocCooked prettyBalancingWallet PrettyCookedOpts -opts Wallet -balancingWallet DocCooked -> [DocCooked] -> [DocCooked] +opts Wallet +balancingWallet DocCooked -> [DocCooked] -> [DocCooked] forall a. a -> [a] -> [a] : [Wallet] -> [DocCooked] -aux [Wallet] -ss +aux [Wallet] +ss | Bool otherwise = PrettyCookedOpts -> PubKeyHash -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (Wallet -> PubKeyHash +opts (Wallet -> PubKeyHash walletPKHash Wallet -s) DocCooked -> [DocCooked] -> [DocCooked] +s) DocCooked -> [DocCooked] -> [DocCooked] forall a. a -> [a] -> [a] : [Wallet] -> [DocCooked] -aux [Wallet] -ss +aux [Wallet] +ss -- The following case should never happen for real transactions, but if the list -- of signers is empty, this will lead to no signers being printed. prettySigners PrettyCookedOpts @@ -767,23 +767,23 @@ prettyMints :: PrettyCookedOpts -> (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> DocCooked -prettyMints PrettyCookedOpts -opts (Versioned MintingPolicy -policy, MintsRedeemer -NoMintsRedeemer, TokenName -tokenName, Integer -amount) = +prettyMints PrettyCookedOpts +opts (Versioned MintingPolicy +policy, MintsRedeemer +NoMintsRedeemer, TokenName +tokenName, Integer +amount) = PrettyCookedOpts -> Versioned MintingPolicy -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Versioned MintingPolicy -policy +opts Versioned MintingPolicy +policy DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> TokenName -> DocCooked forall a ann. Show a => a -> Doc ann PP.viaShow TokenName -tokenName +tokenName DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> DocCooked @@ -793,24 +793,24 @@ <+> Integer -> DocCooked forall a ann. Show a => a -> Doc ann PP.viaShow Integer -amount -prettyMints PrettyCookedOpts -opts (Versioned MintingPolicy -policy, SomeMintsRedeemer redeemer -redeemer, TokenName -tokenName, Integer -amount) = +amount +prettyMints PrettyCookedOpts +opts (Versioned MintingPolicy +policy, SomeMintsRedeemer redeemer +redeemer, TokenName +tokenName, Integer +amount) = PrettyCookedOpts -> Versioned MintingPolicy -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Versioned MintingPolicy -policy +opts Versioned MintingPolicy +policy DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> TokenName -> DocCooked forall a ann. Show a => a -> Doc ann PP.viaShow TokenName -tokenName +tokenName DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> DocCooked @@ -820,8 +820,8 @@ <+> PrettyCookedOpts -> redeemer -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts redeemer -redeemer +opts redeemer +redeemer DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> DocCooked @@ -831,13 +831,13 @@ <+> Integer -> DocCooked forall a ann. Show a => a -> Doc ann PP.viaShow Integer -amount +amount prettyTxSkelOut :: PrettyCookedOpts -> TxSkelOut -> DocCooked prettyTxSkelOut :: PrettyCookedOpts -> TxSkelOut -> DocCooked -prettyTxSkelOut PrettyCookedOpts -opts (Pays o -output) = +prettyTxSkelOut PrettyCookedOpts +opts (Pays o +output) = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize (DocCooked @@ -846,21 +846,21 @@ <+> PrettyCookedOpts -> Address -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (o -> Address +opts (o -> Address forall o. (IsAbstractOutput o, ToCredential (OwnerType o)) => o -> Address outputAddress o -output)) +output)) DocCooked "-" ( PrettyCookedOpts -> Value -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (o -> Value +opts (o -> Value forall o. (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value outputValue o -output) +output) DocCooked -> [DocCooked] -> [DocCooked] forall a. a -> [a] -> [a] : [Maybe DocCooked] -> [DocCooked] @@ -871,9 +871,9 @@ (IsAbstractOutput o, ToOutputDatum (DatumType o)) => o -> OutputDatum outputOutputDatum o -output of - Pl.OutputDatum Datum -_datum -> +output of + Pl.OutputDatum Datum +_datum -> DocCooked -> Maybe DocCooked forall a. a -> Maybe a Just (DocCooked -> Maybe DocCooked) -> DocCooked -> Maybe DocCooked @@ -891,17 +891,17 @@ . PrettyCookedOpts -> TxSkelOutDatum -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts) +opts) (o -output o -> Optic' A_Lens NoIx o TxSkelOutDatum -> TxSkelOutDatum +output o -> Optic' A_Lens NoIx o TxSkelOutDatum -> TxSkelOutDatum forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a ^. Optic' A_Lens NoIx o TxSkelOutDatum forall o. IsAbstractOutput o => Lens' o (DatumType o) outputDatumL) - Pl.OutputDatumHash DatumHash -_datum -> + Pl.OutputDatumHash DatumHash +_datum -> DocCooked -> Maybe DocCooked forall a. a -> Maybe a Just (DocCooked -> Maybe DocCooked) -> DocCooked -> Maybe DocCooked @@ -919,9 +919,9 @@ . PrettyCookedOpts -> TxSkelOutDatum -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts) +opts) (o -output o -> Optic' A_Lens NoIx o TxSkelOutDatum -> TxSkelOutDatum +output o -> Optic' A_Lens NoIx o TxSkelOutDatum -> TxSkelOutDatum forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -938,8 +938,8 @@ ToScriptHash (ReferenceScriptType output)) => PrettyCookedOpts -> output -> Maybe DocCooked getReferenceScriptDoc PrettyCookedOpts -opts o -output +opts o +output ] ) @@ -950,9 +950,9 @@ TxSkelOutNoDatum = Maybe DocCooked forall a. Maybe a Nothing -prettyTxSkelOutDatumMaybe PrettyCookedOpts -opts txSkelOutDatum :: TxSkelOutDatum -txSkelOutDatum@(TxSkelOutInlineDatum a +prettyTxSkelOutDatumMaybe PrettyCookedOpts +opts txSkelOutDatum :: TxSkelOutDatum +txSkelOutDatum@(TxSkelOutInlineDatum a _) = DocCooked -> Maybe DocCooked forall a. a -> Maybe a @@ -968,11 +968,11 @@ PP.align (PrettyCookedOpts -> TxSkelOutDatum -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts TxSkelOutDatum -txSkelOutDatum) -prettyTxSkelOutDatumMaybe PrettyCookedOpts -opts TxSkelOutDatum -txSkelOutDatum = +opts TxSkelOutDatum +txSkelOutDatum) +prettyTxSkelOutDatumMaybe PrettyCookedOpts +opts TxSkelOutDatum +txSkelOutDatum = DocCooked -> Maybe DocCooked forall a. a -> Maybe a Just (DocCooked -> Maybe DocCooked) -> DocCooked -> Maybe DocCooked @@ -987,21 +987,21 @@ PP.align (PrettyCookedOpts -> TxSkelOutDatum -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts TxSkelOutDatum -txSkelOutDatum) +opts TxSkelOutDatum +txSkelOutDatum) prettyTxSkelIn :: PrettyCookedOpts -> SkelContext -> (Pl.TxOutRef, TxSkelRedeemer) -> DocCooked prettyTxSkelIn :: PrettyCookedOpts -> SkelContext -> (TxOutRef, TxSkelRedeemer) -> DocCooked -prettyTxSkelIn PrettyCookedOpts -opts SkelContext -skelContext (TxOutRef -txOutRef, TxSkelRedeemer -txSkelRedeemer) = do +prettyTxSkelIn PrettyCookedOpts +opts SkelContext +skelContext (TxOutRef +txOutRef, TxSkelRedeemer +txSkelRedeemer) = do case SkelContext -> TxOutRef -> Maybe (TxOut, TxSkelOutDatum) lookupOutput SkelContext -skelContext TxOutRef -txOutRef of +skelContext TxOutRef +txOutRef of Maybe (TxOut, TxSkelOutDatum) Nothing -> DocCooked "Spends" DocCooked -> DocCooked -> DocCooked @@ -1009,21 +1009,21 @@ <+> PrettyCookedOpts -> TxOutRef -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts TxOutRef -txOutRef DocCooked -> DocCooked -> DocCooked +opts TxOutRef +txOutRef DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> DocCooked "(non resolved)" - Just (TxOut -output, TxSkelOutDatum -txSkelOutDatum) -> - let (Maybe DocCooked -redeemerDoc, DocCooked -ownerDoc) = + Just (TxOut +output, TxSkelOutDatum +txSkelOutDatum) -> + let (Maybe DocCooked +redeemerDoc, DocCooked +ownerDoc) = case TxSkelRedeemer -txSkelRedeemer of - TxSkelRedeemerForScript redeemer -redeemer -> +txSkelRedeemer of + TxSkelRedeemerForScript redeemer +redeemer -> ( DocCooked -> Maybe DocCooked forall a. a -> Maybe a Just (DocCooked @@ -1032,21 +1032,21 @@ <+> PrettyCookedOpts -> redeemer -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts redeemer -redeemer), +opts redeemer +redeemer), PrettyCookedOpts -> Address -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (TxOut -> Address +opts (TxOut -> Address forall o. (IsAbstractOutput o, ToCredential (OwnerType o)) => o -> Address outputAddress TxOut -output) +output) ) - TxSkelRedeemerForReferencedScript TxOutRef -refScriptOref redeemer -redeemer -> + TxSkelRedeemerForReferencedScript TxOutRef +refScriptOref redeemer +redeemer -> ( DocCooked -> Maybe DocCooked forall a. a -> Maybe a Just (DocCooked @@ -1055,17 +1055,17 @@ <+> PrettyCookedOpts -> redeemer -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts redeemer -redeemer), +opts redeemer +redeemer), PrettyCookedOpts -> Address -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (TxOut -> Address +opts (TxOut -> Address forall o. (IsAbstractOutput o, ToCredential (OwnerType o)) => o -> Address outputAddress TxOut -output) +output) DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> DocCooked -> DocCooked @@ -1076,8 +1076,8 @@ <+> PrettyCookedOpts -> TxOutRef -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts TxOutRef -refScriptOref) +opts TxOutRef +refScriptOref) ) TxSkelRedeemer TxSkelNoRedeemerForPK -> (Maybe DocCooked @@ -1085,62 +1085,62 @@ Nothing, PrettyCookedOpts -> Address -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (TxOut -> Address +opts (TxOut -> Address forall o. (IsAbstractOutput o, ToCredential (OwnerType o)) => o -> Address outputAddress TxOut -output)) +output)) in DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize (DocCooked "Spends from" DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> DocCooked -ownerDoc) +ownerDoc) DocCooked "-" ( PrettyCookedOpts -> Value -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (TxOut -> Value +opts (TxOut -> Value forall o. (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value outputValue TxOut -output) +output) DocCooked -> [DocCooked] -> [DocCooked] forall a. a -> [a] -> [a] : [Maybe DocCooked] -> [DocCooked] forall a. [Maybe a] -> [a] catMaybes [ Maybe DocCooked -redeemerDoc, +redeemerDoc, PrettyCookedOpts -> TxSkelOutDatum -> Maybe DocCooked prettyTxSkelOutDatumMaybe PrettyCookedOpts -opts TxSkelOutDatum -txSkelOutDatum, +opts TxSkelOutDatum +txSkelOutDatum, PrettyCookedOpts -> TxOut -> Maybe DocCooked forall output. (IsAbstractOutput output, ToScriptHash (ReferenceScriptType output)) => PrettyCookedOpts -> output -> Maybe DocCooked getReferenceScriptDoc PrettyCookedOpts -opts TxOut -output +opts TxOut +output ] ) prettyTxSkelInReference :: PrettyCookedOpts -> SkelContext -> Pl.TxOutRef -> Maybe DocCooked prettyTxSkelInReference :: PrettyCookedOpts -> SkelContext -> TxOutRef -> Maybe DocCooked -prettyTxSkelInReference PrettyCookedOpts -opts SkelContext -skelContext TxOutRef -txOutRef = do - (TxOut -output, TxSkelOutDatum -txSkelOutDatum) <- SkelContext -> TxOutRef -> Maybe (TxOut, TxSkelOutDatum) +prettyTxSkelInReference PrettyCookedOpts +opts SkelContext +skelContext TxOutRef +txOutRef = do + (TxOut +output, TxSkelOutDatum +txSkelOutDatum) <- SkelContext -> TxOutRef -> Maybe (TxOut, TxSkelOutDatum) lookupOutput SkelContext -skelContext TxOutRef -txOutRef +skelContext TxOutRef +txOutRef DocCooked -> Maybe DocCooked forall (m :: * -> *) a. Monad m => a -> m a return (DocCooked -> Maybe DocCooked) -> DocCooked -> Maybe DocCooked @@ -1154,21 +1154,21 @@ <+> PrettyCookedOpts -> Address -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (TxOut -> Address +opts (TxOut -> Address forall o. (IsAbstractOutput o, ToCredential (OwnerType o)) => o -> Address outputAddress TxOut -output)) +output)) DocCooked "-" ( PrettyCookedOpts -> Value -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (TxOut -> Value +opts (TxOut -> Value forall o. (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value outputValue TxOut -output) +output) DocCooked -> [DocCooked] -> [DocCooked] forall a. a -> [a] -> [a] : [Maybe DocCooked] -> [DocCooked] @@ -1176,26 +1176,26 @@ catMaybes [ PrettyCookedOpts -> TxSkelOutDatum -> Maybe DocCooked prettyTxSkelOutDatumMaybe PrettyCookedOpts -opts TxSkelOutDatum -txSkelOutDatum, +opts TxSkelOutDatum +txSkelOutDatum, PrettyCookedOpts -> TxOut -> Maybe DocCooked forall output. (IsAbstractOutput output, ToScriptHash (ReferenceScriptType output)) => PrettyCookedOpts -> output -> Maybe DocCooked getReferenceScriptDoc PrettyCookedOpts -opts TxOut -output +opts TxOut +output ] ) -getReferenceScriptDoc :: (IsAbstractOutput output, ToScriptHash (ReferenceScriptType output)) => PrettyCookedOpts -> output -> Maybe DocCooked +getReferenceScriptDoc :: (IsAbstractOutput output, ToScriptHash (ReferenceScriptType output)) => PrettyCookedOpts -> output -> Maybe DocCooked getReferenceScriptDoc :: PrettyCookedOpts -> output -> Maybe DocCooked -getReferenceScriptDoc PrettyCookedOpts -opts output -output = +getReferenceScriptDoc PrettyCookedOpts +opts output +output = case output -output output +output output -> Optic' A_Lens NoIx output (Maybe (ReferenceScriptType output)) -> Maybe (ReferenceScriptType output) forall k s (is :: IxList) a. @@ -1210,8 +1210,8 @@ Nothing -> Maybe DocCooked forall a. Maybe a Nothing - Just ReferenceScriptType output -refScript -> DocCooked -> Maybe DocCooked + Just ReferenceScriptType output +refScript -> DocCooked -> Maybe DocCooked forall a. a -> Maybe a Just (DocCooked -> Maybe DocCooked) -> DocCooked -> Maybe DocCooked forall a b. (a -> b) -> a -> b @@ -1222,60 +1222,60 @@ forall a. Show a => Int -> a -> DocCooked prettyHash (PrettyCookedOpts -> Int pcOptPrintedHashLength PrettyCookedOpts -opts) (ReferenceScriptType output -> ScriptHash +opts) (ReferenceScriptType output -> ScriptHash forall a. ToScriptHash a => a -> ScriptHash toScriptHash ReferenceScriptType output -refScript) +refScript) lookupOutput :: SkelContext -> Pl.TxOutRef -> Maybe (Pl.TxOut, TxSkelOutDatum) lookupOutput :: SkelContext -> TxOutRef -> Maybe (TxOut, TxSkelOutDatum) -lookupOutput (SkelContext Map TxOutRef TxOut -managedTxOuts Map DatumHash TxSkelOutDatum -managedTxSkelOutDatums) TxOutRef -txOutRef = do - TxOut -output <- TxOutRef -> Map TxOutRef TxOut -> Maybe TxOut +lookupOutput (SkelContext Map TxOutRef TxOut +managedTxOuts Map DatumHash TxSkelOutDatum +managedTxSkelOutDatums) TxOutRef +txOutRef = do + TxOut +output <- TxOutRef -> Map TxOutRef TxOut -> Maybe TxOut forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup TxOutRef -txOutRef Map TxOutRef TxOut -managedTxOuts - DatumHash -datumHash <- +txOutRef Map TxOutRef TxOut +managedTxOuts + DatumHash +datumHash <- case TxOut -> OutputDatum forall o. (IsAbstractOutput o, ToOutputDatum (DatumType o)) => o -> OutputDatum outputOutputDatum TxOut -output of - Pl.OutputDatum Datum -datum -> DatumHash -> Maybe DatumHash +output of + Pl.OutputDatum Datum +datum -> DatumHash -> Maybe DatumHash forall (m :: * -> *) a. Monad m => a -> m a return (Datum -> DatumHash Pl.datumHash Datum -datum) - Pl.OutputDatumHash DatumHash -datumHash -> DatumHash -> Maybe DatumHash +datum) + Pl.OutputDatumHash DatumHash +datumHash -> DatumHash -> Maybe DatumHash forall (m :: * -> *) a. Monad m => a -> m a return DatumHash -datumHash +datumHash OutputDatum Pl.NoOutputDatum -> Maybe DatumHash forall a. Maybe a Nothing - TxSkelOutDatum -txSkelOutDatum <- DatumHash -> Map DatumHash TxSkelOutDatum -> Maybe TxSkelOutDatum + TxSkelOutDatum +txSkelOutDatum <- DatumHash -> Map DatumHash TxSkelOutDatum -> Maybe TxSkelOutDatum forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup DatumHash -datumHash Map DatumHash TxSkelOutDatum -managedTxSkelOutDatums +datumHash Map DatumHash TxSkelOutDatum +managedTxSkelOutDatums (TxOut, TxSkelOutDatum) -> Maybe (TxOut, TxSkelOutDatum) forall (m :: * -> *) a. Monad m => a -> m a return (TxOut -output, TxSkelOutDatum -txSkelOutDatum) +output, TxSkelOutDatum +txSkelOutDatum) -- | Pretty-print a list of transaction skeleton options, only printing an -- option if its value is non-default. If no non-default options are in the @@ -1283,38 +1283,38 @@ mPrettyTxOpts :: PrettyCookedOpts -> TxOpts -> Maybe DocCooked mPrettyTxOpts :: PrettyCookedOpts -> TxOpts -> Maybe DocCooked mPrettyTxOpts - PrettyCookedOpts -opts + PrettyCookedOpts +opts TxOpts - { Bool + { Bool txOptEnsureMinAda :: TxOpts -> Bool txOptEnsureMinAda :: Bool txOptEnsureMinAda, - Bool + Bool txOptAutoSlotIncrease :: TxOpts -> Bool txOptAutoSlotIncrease :: Bool txOptAutoSlotIncrease, - [RawModTx] + [RawModTx] txOptUnsafeModTx :: TxOpts -> [RawModTx] txOptUnsafeModTx :: [RawModTx] txOptUnsafeModTx, - Bool + Bool txOptBalance :: TxOpts -> Bool txOptBalance :: Bool txOptBalance, - BalanceOutputPolicy + BalanceOutputPolicy txOptBalanceOutputPolicy :: TxOpts -> BalanceOutputPolicy txOptBalanceOutputPolicy :: BalanceOutputPolicy txOptBalanceOutputPolicy, - BalancingWallet + BalancingWallet txOptBalanceWallet :: BalancingWallet txOptBalanceWallet :: TxOpts -> BalancingWallet -txOptBalanceWallet, - BalancingUtxos +txOptBalanceWallet, + BalancingUtxos txOptBalancingUtxos :: TxOpts -> BalancingUtxos txOptBalancingUtxos :: BalancingUtxos txOptBalancingUtxos, - Maybe EmulatorParamsModification + Maybe EmulatorParamsModification txOptEmulatorParamsModification :: TxOpts -> Maybe EmulatorParamsModification txOptEmulatorParamsModification :: Maybe EmulatorParamsModification txOptEmulatorParamsModification @@ -1330,86 +1330,86 @@ catMaybes [ Bool -> (Bool -> DocCooked) -> Bool -> Maybe DocCooked forall a. Eq a => a -> (a -> DocCooked) -> a -> Maybe DocCooked -prettyIfNot Bool +prettyIfNot Bool forall a. Default a => a def Bool -> DocCooked -prettyEnsureMinAda Bool -txOptEnsureMinAda, +prettyEnsureMinAda Bool +txOptEnsureMinAda, Bool -> (Bool -> DocCooked) -> Bool -> Maybe DocCooked forall a. Eq a => a -> (a -> DocCooked) -> a -> Maybe DocCooked -prettyIfNot Bool +prettyIfNot Bool True Bool -> DocCooked -prettyAutoSlotIncrease Bool -txOptAutoSlotIncrease, +prettyAutoSlotIncrease Bool +txOptAutoSlotIncrease, Bool -> (Bool -> DocCooked) -> Bool -> Maybe DocCooked forall a. Eq a => a -> (a -> DocCooked) -> a -> Maybe DocCooked -prettyIfNot Bool +prettyIfNot Bool True Bool -> DocCooked -prettyBalance Bool -txOptBalance, +prettyBalance Bool +txOptBalance, BalanceOutputPolicy -> (BalanceOutputPolicy -> DocCooked) -> BalanceOutputPolicy -> Maybe DocCooked forall a. Eq a => a -> (a -> DocCooked) -> a -> Maybe DocCooked -prettyIfNot BalanceOutputPolicy +prettyIfNot BalanceOutputPolicy forall a. Default a => a def BalanceOutputPolicy -> DocCooked -prettyBalanceOutputPolicy BalanceOutputPolicy -txOptBalanceOutputPolicy, +prettyBalanceOutputPolicy BalanceOutputPolicy +txOptBalanceOutputPolicy, BalancingWallet -> (BalancingWallet -> DocCooked) -> BalancingWallet -> Maybe DocCooked forall a. Eq a => a -> (a -> DocCooked) -> a -> Maybe DocCooked -prettyIfNot BalancingWallet +prettyIfNot BalancingWallet forall a. Default a => a def BalancingWallet -> DocCooked -prettyBalanceWallet BalancingWallet -txOptBalanceWallet, +prettyBalanceWallet BalancingWallet +txOptBalanceWallet, BalancingUtxos -> (BalancingUtxos -> DocCooked) -> BalancingUtxos -> Maybe DocCooked forall a. Eq a => a -> (a -> DocCooked) -> a -> Maybe DocCooked -prettyIfNot BalancingUtxos +prettyIfNot BalancingUtxos forall a. Default a => a def BalancingUtxos -> DocCooked -prettyBalancingUtxos BalancingUtxos -txOptBalancingUtxos, +prettyBalancingUtxos BalancingUtxos +txOptBalancingUtxos, [RawModTx] -> ([RawModTx] -> DocCooked) -> [RawModTx] -> Maybe DocCooked forall a. Eq a => a -> (a -> DocCooked) -> a -> Maybe DocCooked -prettyIfNot [] [RawModTx] -> DocCooked -prettyUnsafeModTx [RawModTx] -txOptUnsafeModTx, +prettyIfNot [] [RawModTx] -> DocCooked +prettyUnsafeModTx [RawModTx] +txOptUnsafeModTx, Maybe EmulatorParamsModification -> (Maybe EmulatorParamsModification -> DocCooked) -> Maybe EmulatorParamsModification -> Maybe DocCooked forall a. Eq a => a -> (a -> DocCooked) -> a -> Maybe DocCooked -prettyIfNot Maybe EmulatorParamsModification +prettyIfNot Maybe EmulatorParamsModification forall a. Default a => a def Maybe EmulatorParamsModification -> DocCooked -prettyEmulatorParamsModification Maybe EmulatorParamsModification -txOptEmulatorParamsModification +prettyEmulatorParamsModification Maybe EmulatorParamsModification +txOptEmulatorParamsModification ] where - prettyIfNot :: Eq a => a -> (a -> DocCooked) -> a -> Maybe DocCooked - prettyIfNot :: a -> (a -> DocCooked) -> a -> Maybe DocCooked -prettyIfNot a -defaultValue a -> DocCooked -f a -x + prettyIfNot :: Eq a => a -> (a -> DocCooked) -> a -> Maybe DocCooked + prettyIfNot :: a -> (a -> DocCooked) -> a -> Maybe DocCooked +prettyIfNot a +defaultValue a -> DocCooked +f a +x | a -x a -> a -> Bool +x a -> a -> Bool forall a. Eq a => a -> a -> Bool == a -defaultValue Bool -> Bool -> Bool +defaultValue Bool -> Bool -> Bool && Bool -> Bool not (PrettyCookedOpts -> Bool pcOptPrintDefaultTxOpts PrettyCookedOpts -opts) = Maybe DocCooked +opts) = Maybe DocCooked forall a. Maybe a Nothing | Bool @@ -1418,70 +1418,70 @@ Just (DocCooked -> Maybe DocCooked) -> DocCooked -> Maybe DocCooked forall a b. (a -> b) -> a -> b $ a -> DocCooked -f a -x - prettyEnsureMinAda :: Bool -> DocCooked - prettyEnsureMinAda :: Bool -> DocCooked -prettyEnsureMinAda Bool +f a +x + prettyEnsureMinAda :: Bool -> DocCooked + prettyEnsureMinAda :: Bool -> DocCooked +prettyEnsureMinAda Bool True = DocCooked "Ensure min Ada per transaction" - prettyEnsureMinAda Bool + prettyEnsureMinAda Bool False = DocCooked "Do not ensure min Ada per transaction" - prettyAutoSlotIncrease :: Bool -> DocCooked - prettyAutoSlotIncrease :: Bool -> DocCooked -prettyAutoSlotIncrease Bool + prettyAutoSlotIncrease :: Bool -> DocCooked + prettyAutoSlotIncrease :: Bool -> DocCooked +prettyAutoSlotIncrease Bool True = DocCooked "Automatic slot increase" - prettyAutoSlotIncrease Bool + prettyAutoSlotIncrease Bool False = DocCooked "No automatic slot increase" - prettyBalance :: Bool -> DocCooked - prettyBalance :: Bool -> DocCooked -prettyBalance Bool + prettyBalance :: Bool -> DocCooked + prettyBalance :: Bool -> DocCooked +prettyBalance Bool True = DocCooked "Automatic balancing" - prettyBalance Bool + prettyBalance Bool False = DocCooked "No automatic balancing" - prettyBalanceOutputPolicy :: BalanceOutputPolicy -> DocCooked - prettyBalanceOutputPolicy :: BalanceOutputPolicy -> DocCooked -prettyBalanceOutputPolicy BalanceOutputPolicy + prettyBalanceOutputPolicy :: BalanceOutputPolicy -> DocCooked + prettyBalanceOutputPolicy :: BalanceOutputPolicy -> DocCooked +prettyBalanceOutputPolicy BalanceOutputPolicy AdjustExistingOutput = DocCooked "Balance policy: Adjust existing outputs" - prettyBalanceOutputPolicy BalanceOutputPolicy + prettyBalanceOutputPolicy BalanceOutputPolicy DontAdjustExistingOutput = DocCooked "Balance policy: Don't adjust existing outputs" - prettyBalanceWallet :: BalancingWallet -> DocCooked - prettyBalanceWallet :: BalancingWallet -> DocCooked -prettyBalanceWallet BalancingWallet + prettyBalanceWallet :: BalancingWallet -> DocCooked + prettyBalanceWallet :: BalancingWallet -> DocCooked +prettyBalanceWallet BalancingWallet BalanceWithFirstSigner = DocCooked "Balance with first signer" - prettyBalanceWallet (BalanceWith Wallet -w) = DocCooked + prettyBalanceWallet (BalanceWith Wallet +w) = DocCooked "Balance with" DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> PrettyCookedOpts -> PubKeyHash -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (Wallet -> PubKeyHash +opts (Wallet -> PubKeyHash walletPKHash Wallet -w) - prettyUnsafeModTx :: [RawModTx] -> DocCooked - prettyUnsafeModTx :: [RawModTx] -> DocCooked -prettyUnsafeModTx [] = DocCooked +w) + prettyUnsafeModTx :: [RawModTx] -> DocCooked + prettyUnsafeModTx :: [RawModTx] -> DocCooked +prettyUnsafeModTx [] = DocCooked "No transaction modifications" - prettyUnsafeModTx [RawModTx] -xs = - let n :: Int -n = [RawModTx] -> Int + prettyUnsafeModTx [RawModTx] +xs = + let n :: Int +n = [RawModTx] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int length [RawModTx] -xs +xs in Int -> DocCooked forall a ann. Pretty a => a -> Doc ann PP.pretty Int -n +n DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+> DocCooked @@ -1495,55 +1495,55 @@ PP.plural DocCooked "modification" DocCooked "modifications" Int -n - prettyEmulatorParamsModification :: Maybe EmulatorParamsModification -> DocCooked - prettyEmulatorParamsModification :: Maybe EmulatorParamsModification -> DocCooked -prettyEmulatorParamsModification Maybe EmulatorParamsModification +n + prettyEmulatorParamsModification :: Maybe EmulatorParamsModification -> DocCooked + prettyEmulatorParamsModification :: Maybe EmulatorParamsModification -> DocCooked +prettyEmulatorParamsModification Maybe EmulatorParamsModification Nothing = DocCooked "No modifications of protocol paramters" - prettyEmulatorParamsModification Just {} = DocCooked + prettyEmulatorParamsModification Just {} = DocCooked "With modifications of protocol parameters" - prettyBalancingUtxos :: BalancingUtxos -> DocCooked - prettyBalancingUtxos :: BalancingUtxos -> DocCooked -prettyBalancingUtxos BalancingUtxos + prettyBalancingUtxos :: BalancingUtxos -> DocCooked + prettyBalancingUtxos :: BalancingUtxos -> DocCooked +prettyBalancingUtxos BalancingUtxos BalancingUtxosAll = DocCooked "Balance with all UTxOs of the balancing wallet" - prettyBalancingUtxos BalancingUtxos + prettyBalancingUtxos BalancingUtxos BalancingUtxosDatumless = DocCooked "Balance with datumless UTxOs of the balancing wallet" - prettyBalancingUtxos (BalancingUtxosAllowlist [TxOutRef] -txOutRefs) = + prettyBalancingUtxos (BalancingUtxosAllowlist [TxOutRef] +txOutRefs) = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked "Only balance with UTxOs of the balancing wallet among:" DocCooked "-" (PrettyCookedOpts -> TxOutRef -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (TxOutRef -> DocCooked) -> [TxOutRef] -> [DocCooked] +opts (TxOutRef -> DocCooked) -> [TxOutRef] -> [DocCooked] forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> [TxOutRef] -txOutRefs) - prettyBalancingUtxos (BalancingUtxosBlocklist [TxOutRef] -txOutRefs) = +txOutRefs) + prettyBalancingUtxos (BalancingUtxosBlocklist [TxOutRef] +txOutRefs) = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked "Do not balance with UTxOs among:" DocCooked "-" (PrettyCookedOpts -> TxOutRef -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts (TxOutRef -> DocCooked) -> [TxOutRef] -> [DocCooked] +opts (TxOutRef -> DocCooked) -> [TxOutRef] -> [DocCooked] forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> [TxOutRef] -txOutRefs) +txOutRefs) -- * Pretty-printing -- | Pretty print a 'UtxoState'. Print the known wallets first, then unknown -- pubkeys, then scripts. -instance PrettyCooked UtxoState where - prettyCookedOpt :: PrettyCookedOpts -> UtxoState -> DocCooked -prettyCookedOpt PrettyCookedOpts -opts = +instance PrettyCooked UtxoState where + prettyCookedOpt :: PrettyCookedOpts -> UtxoState -> DocCooked +prettyCookedOpt PrettyCookedOpts +opts = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize DocCooked "UTxO state:" DocCooked @@ -1559,7 +1559,7 @@ forall a b c. (a -> b -> c) -> (a, b) -> c uncurry (PrettyCookedOpts -> Address -> UtxoPayloadSet -> DocCooked prettyAddressState PrettyCookedOpts -opts)) +opts)) ([(Address, UtxoPayloadSet)] -> [DocCooked]) -> (UtxoState -> [(Address, UtxoPayloadSet)]) -> UtxoState @@ -1571,7 +1571,7 @@ forall a. (a -> a -> Ordering) -> [a] -> [a] List.sortBy (Address, UtxoPayloadSet) -> (Address, UtxoPayloadSet) -> Ordering forall a. (Address, a) -> (Address, a) -> Ordering -addressOrdering +addressOrdering ([(Address, UtxoPayloadSet)] -> [(Address, UtxoPayloadSet)]) -> (UtxoState -> [(Address, UtxoPayloadSet)]) -> UtxoState @@ -1588,31 +1588,31 @@ . UtxoState -> Map Address UtxoPayloadSet utxoState where - addressOrdering :: (Pl.Address, a) -> (Pl.Address, a) -> Ordering - addressOrdering :: (Address, a) -> (Address, a) -> Ordering -addressOrdering - (a1 :: Address -a1@(Pl.Address (Pl.PubKeyCredential PubKeyHash -pkh1) Maybe StakingCredential + addressOrdering :: (Pl.Address, a) -> (Pl.Address, a) -> Ordering + addressOrdering :: (Address, a) -> (Address, a) -> Ordering +addressOrdering + (a1 :: Address +a1@(Pl.Address (Pl.PubKeyCredential PubKeyHash +pkh1) Maybe StakingCredential _), a _) - (a2 :: Address -a2@(Pl.Address (Pl.PubKeyCredential PubKeyHash -pkh2) Maybe StakingCredential + (a2 :: Address +a2@(Pl.Address (Pl.PubKeyCredential PubKeyHash +pkh2) Maybe StakingCredential _), a _) = case (PubKeyHash -> Maybe Int walletPKHashToId PubKeyHash -pkh1, PubKeyHash -> Maybe Int +pkh1, PubKeyHash -> Maybe Int walletPKHashToId PubKeyHash -pkh2) of - (Just Int -i, Just Int -j) -> Int -> Int -> Ordering +pkh2) of + (Just Int +i, Just Int +j) -> Int -> Int -> Ordering forall a. Ord a => a -> a -> Ordering compare Int -i Int -j +i Int +j (Just Int _, Maybe Int Nothing) -> Ordering @@ -1626,9 +1626,9 @@ Nothing) -> Address -> Address -> Ordering forall a. Ord a => a -> a -> Ordering compare Address -a1 Address -a2 - addressOrdering +a1 Address +a2 + addressOrdering (Pl.Address (Pl.PubKeyCredential PubKeyHash _) Maybe StakingCredential _, a @@ -1638,31 +1638,31 @@ _, a _) = Ordering LT - addressOrdering (Address -a1, a -_) (Address -a2, a + addressOrdering (Address +a1, a +_) (Address +a2, a _) = Address -> Address -> Ordering forall a. Ord a => a -> a -> Ordering compare Address -a1 Address -a2 +a1 Address +a2 -- | Pretty prints the state of an address, that is the list of UTxOs -- (including value and datum), grouped prettyAddressState :: PrettyCookedOpts -> Pl.Address -> UtxoPayloadSet -> DocCooked prettyAddressState :: PrettyCookedOpts -> Address -> UtxoPayloadSet -> DocCooked -prettyAddressState PrettyCookedOpts -opts Address -address UtxoPayloadSet -payloadSet = +prettyAddressState PrettyCookedOpts +opts Address +address UtxoPayloadSet +payloadSet = DocCooked -> DocCooked -> [DocCooked] -> DocCooked prettyItemize (PrettyCookedOpts -> Address -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Address -address) +opts Address +address) DocCooked "-" ( ([UtxoPayload] -> Maybe DocCooked) @@ -1670,14 +1670,14 @@ forall a b. (a -> Maybe b) -> [a] -> [b] mapMaybe (PrettyCookedOpts -> [UtxoPayload] -> Maybe DocCooked prettyPayloadGrouped PrettyCookedOpts -opts) +opts) ([[UtxoPayload]] -> [DocCooked]) -> (UtxoPayloadSet -> [[UtxoPayload]]) -> UtxoPayloadSet -> [DocCooked] forall b c a. (b -> c) -> (a -> b) -> a -> c . [UtxoPayload] -> [[UtxoPayload]] -group +group ([UtxoPayload] -> [[UtxoPayload]]) -> (UtxoPayloadSet -> [UtxoPayload]) -> UtxoPayloadSet @@ -1706,45 +1706,45 @@ (UtxoPayloadSet -> [DocCooked]) -> UtxoPayloadSet -> [DocCooked] forall a b. (a -> b) -> a -> b $ UtxoPayloadSet -payloadSet +payloadSet ) where - similar :: UtxoPayload -> UtxoPayload -> Bool - similar :: UtxoPayload -> UtxoPayload -> Bool -similar + similar :: UtxoPayload -> UtxoPayload -> Bool + similar :: UtxoPayload -> UtxoPayload -> Bool +similar (UtxoPayload TxOutRef -_ Value -value1 TxSkelOutDatum -skelOutDatum1 Maybe ScriptHash -refScript1) +_ Value +value1 TxSkelOutDatum +skelOutDatum1 Maybe ScriptHash +refScript1) (UtxoPayload TxOutRef -_ Value -value2 TxSkelOutDatum -skelOutDatum2 Maybe ScriptHash -refScript2) = +_ Value +value2 TxSkelOutDatum +skelOutDatum2 Maybe ScriptHash +refScript2) = Value -value1 Value -> Value -> Bool +value1 Value -> Value -> Bool forall a. Eq a => a -> a -> Bool == Value -value2 +value2 Bool -> Bool -> Bool && TxSkelOutDatum -skelOutDatum1 TxSkelOutDatum -> TxSkelOutDatum -> Bool +skelOutDatum1 TxSkelOutDatum -> TxSkelOutDatum -> Bool forall a. Eq a => a -> a -> Bool == TxSkelOutDatum -skelOutDatum2 +skelOutDatum2 Bool -> Bool -> Bool && Maybe ScriptHash -refScript1 Maybe ScriptHash -> Maybe ScriptHash -> Bool +refScript1 Maybe ScriptHash -> Maybe ScriptHash -> Bool forall a. Eq a => a -> a -> Bool == Maybe ScriptHash -refScript2 - group :: [UtxoPayload] -> [[UtxoPayload]] - group :: [UtxoPayload] -> [[UtxoPayload]] -group = +refScript2 + group :: [UtxoPayload] -> [[UtxoPayload]] + group :: [UtxoPayload] -> [[UtxoPayload]] +group = case PrettyCookedOpts -> PCOptTxOutRefs pcOptPrintTxOutRefs PrettyCookedOpts -opts of +opts of PCOptTxOutRefs PCOptTxOutRefsFull -> (UtxoPayload -> [UtxoPayload]) -> [UtxoPayload] -> [[UtxoPayload]] forall a b. (a -> b) -> [a] -> [b] @@ -1756,7 +1756,7 @@ -> [UtxoPayload] -> [[UtxoPayload]] forall a. (a -> a -> Bool) -> [a] -> [[a]] List.groupBy UtxoPayload -> UtxoPayload -> Bool -similar +similar -- | Pretty prints payloads (datum and value corresponding to 1 UTxO) that have -- been grouped together when they carry same value and datum @@ -1766,33 +1766,33 @@ _ [] = Maybe DocCooked forall a. Maybe a Nothing -prettyPayloadGrouped PrettyCookedOpts -opts [UtxoPayload -payload] = +prettyPayloadGrouped PrettyCookedOpts +opts [UtxoPayload +payload] = PrettyCookedOpts -> Bool -> UtxoPayload -> Maybe DocCooked prettyPayload PrettyCookedOpts -opts +opts (PrettyCookedOpts -> PCOptTxOutRefs pcOptPrintTxOutRefs PrettyCookedOpts -opts PCOptTxOutRefs -> PCOptTxOutRefs -> Bool +opts PCOptTxOutRefs -> PCOptTxOutRefs -> Bool forall a. Eq a => a -> a -> Bool /= PCOptTxOutRefs PCOptTxOutRefsHidden) UtxoPayload -payload -prettyPayloadGrouped PrettyCookedOpts -opts (UtxoPayload -payload : [UtxoPayload] -rest) = - let cardinality :: Int -cardinality = Int +payload +prettyPayloadGrouped PrettyCookedOpts +opts (UtxoPayload +payload : [UtxoPayload] +rest) = + let cardinality :: Int +cardinality = Int 1 Int -> Int -> Int forall a. Num a => a -> a -> a + [UtxoPayload] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int length [UtxoPayload] -rest +rest in (DocCooked -> DocCooked forall ann. Doc ann -> Doc ann PP.parens (DocCooked @@ -1801,39 +1801,39 @@ <> PrettyCookedOpts -> Int -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Int -cardinality) DocCooked -> DocCooked -> DocCooked +opts Int +cardinality) DocCooked -> DocCooked -> DocCooked forall ann. Doc ann -> Doc ann -> Doc ann <+>) (DocCooked -> DocCooked) -> Maybe DocCooked -> Maybe DocCooked forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> PrettyCookedOpts -> Bool -> UtxoPayload -> Maybe DocCooked prettyPayload PrettyCookedOpts -opts Bool +opts Bool False UtxoPayload -payload +payload prettyPayload :: PrettyCookedOpts -> Bool -> UtxoPayload -> Maybe DocCooked prettyPayload :: PrettyCookedOpts -> Bool -> UtxoPayload -> Maybe DocCooked prettyPayload - PrettyCookedOpts -opts - Bool -showTxOutRef + PrettyCookedOpts +opts + Bool +showTxOutRef ( UtxoPayload - { TxOutRef + { TxOutRef utxoPayloadTxOutRef :: UtxoPayload -> TxOutRef utxoPayloadTxOutRef :: TxOutRef utxoPayloadTxOutRef, - Value + Value utxoPayloadValue :: Value utxoPayloadValue :: UtxoPayload -> Value -utxoPayloadValue, - TxSkelOutDatum +utxoPayloadValue, + TxSkelOutDatum utxoPayloadSkelOutDatum :: UtxoPayload -> TxSkelOutDatum utxoPayloadSkelOutDatum :: TxSkelOutDatum utxoPayloadSkelOutDatum, - Maybe ScriptHash + Maybe ScriptHash utxoPayloadReferenceScript :: UtxoPayload -> Maybe ScriptHash utxoPayloadReferenceScript :: Maybe ScriptHash utxoPayloadReferenceScript @@ -1843,7 +1843,7 @@ forall a. [Maybe a] -> [a] catMaybes [ if Bool -showTxOutRef +showTxOutRef then DocCooked -> Maybe DocCooked forall a. a -> Maybe a Just (DocCooked -> Maybe DocCooked) -> DocCooked -> Maybe DocCooked @@ -1851,8 +1851,8 @@ $ PrettyCookedOpts -> TxOutRef -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts TxOutRef -utxoPayloadTxOutRef +opts TxOutRef +utxoPayloadTxOutRef else Maybe DocCooked forall a. Maybe a Nothing, @@ -1861,33 +1861,33 @@ Just (PrettyCookedOpts -> Value -> DocCooked forall a. PrettyCooked a => PrettyCookedOpts -> a -> DocCooked prettyCookedOpt PrettyCookedOpts -opts Value -utxoPayloadValue), +opts Value +utxoPayloadValue), PrettyCookedOpts -> TxSkelOutDatum -> Maybe DocCooked prettyTxSkelOutDatumMaybe PrettyCookedOpts -opts TxSkelOutDatum -utxoPayloadSkelOutDatum, +opts TxSkelOutDatum +utxoPayloadSkelOutDatum, PrettyCookedOpts -> ScriptHash -> DocCooked prettyReferenceScriptHash PrettyCookedOpts -opts (ScriptHash -> DocCooked) -> Maybe ScriptHash -> Maybe DocCooked +opts (ScriptHash -> DocCooked) -> Maybe ScriptHash -> Maybe DocCooked forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Maybe ScriptHash -utxoPayloadReferenceScript +utxoPayloadReferenceScript ] of [] -> Maybe DocCooked forall a. Maybe a Nothing - [DocCooked -doc] -> DocCooked -> Maybe DocCooked + [DocCooked +doc] -> DocCooked -> Maybe DocCooked forall a. a -> Maybe a Just (DocCooked -> Maybe DocCooked) -> DocCooked -> Maybe DocCooked forall a b. (a -> b) -> a -> b $ DocCooked -> DocCooked forall ann. Doc ann -> Doc ann PP.align DocCooked -doc - [DocCooked] -docs -> DocCooked -> Maybe DocCooked +doc + [DocCooked] +docs -> DocCooked -> Maybe DocCooked forall a. a -> Maybe a Just (DocCooked -> Maybe DocCooked) -> ([DocCooked] -> DocCooked) -> [DocCooked] -> Maybe DocCooked @@ -1902,13 +1902,13 @@ PP.vsep ([DocCooked] -> Maybe DocCooked) -> [DocCooked] -> Maybe DocCooked forall a b. (a -> b) -> a -> b $ [DocCooked] -docs +docs prettyReferenceScriptHash :: PrettyCookedOpts -> Pl.ScriptHash -> DocCooked prettyReferenceScriptHash :: PrettyCookedOpts -> ScriptHash -> DocCooked -prettyReferenceScriptHash PrettyCookedOpts -opts ScriptHash -scriptHash = +prettyReferenceScriptHash PrettyCookedOpts +opts ScriptHash +scriptHash = DocCooked "Reference script hash:" DocCooked -> DocCooked -> DocCooked @@ -1917,6 +1917,6 @@ forall a. Show a => Int -> a -> DocCooked prettyHash (PrettyCookedOpts -> Int pcOptPrintedHashLength PrettyCookedOpts -opts) ScriptHash -scriptHash +opts) ScriptHash +scriptHash \ No newline at end of file diff --git a/src/Cooked.Pretty.Options.html b/src/Cooked.Pretty.Options.html index d1e99d14f..e49a88f45 100644 --- a/src/Cooked.Pretty.Options.html +++ b/src/Cooked.Pretty.Options.html @@ -31,7 +31,7 @@ PrettyCookedOpts -> Bool pcOptNumericUnderscores :: Bool } - deriving (PrettyCookedOpts -> PrettyCookedOpts -> Bool + deriving (PrettyCookedOpts -> PrettyCookedOpts -> Bool (PrettyCookedOpts -> PrettyCookedOpts -> Bool) -> (PrettyCookedOpts -> PrettyCookedOpts -> Bool) -> Eq PrettyCookedOpts @@ -40,7 +40,7 @@ $c/= :: PrettyCookedOpts -> PrettyCookedOpts -> Bool == :: PrettyCookedOpts -> PrettyCookedOpts -> Bool $c== :: PrettyCookedOpts -> PrettyCookedOpts -> Bool -Eq, Int -> PrettyCookedOpts -> ShowS +Eq, Int -> PrettyCookedOpts -> ShowS [PrettyCookedOpts] -> ShowS PrettyCookedOpts -> String (Int -> PrettyCookedOpts -> ShowS) @@ -69,7 +69,7 @@ -- This avoids the downside of 'PCOptTxOutRefsFull' which disables printing -- UTxOs as a group. PCOptTxOutRefsPartial - deriving (PCOptTxOutRefs -> PCOptTxOutRefs -> Bool + deriving (PCOptTxOutRefs -> PCOptTxOutRefs -> Bool (PCOptTxOutRefs -> PCOptTxOutRefs -> Bool) -> (PCOptTxOutRefs -> PCOptTxOutRefs -> Bool) -> Eq PCOptTxOutRefs forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a @@ -77,7 +77,7 @@ $c/= :: PCOptTxOutRefs -> PCOptTxOutRefs -> Bool == :: PCOptTxOutRefs -> PCOptTxOutRefs -> Bool $c== :: PCOptTxOutRefs -> PCOptTxOutRefs -> Bool -Eq, Int -> PCOptTxOutRefs -> ShowS +Eq, Int -> PCOptTxOutRefs -> ShowS [PCOptTxOutRefs] -> ShowS PCOptTxOutRefs -> String (Int -> PCOptTxOutRefs -> ShowS) @@ -95,7 +95,7 @@ Show) instance Default PrettyCookedOpts where - def :: PrettyCookedOpts + def :: PrettyCookedOpts def = PrettyCookedOpts :: Bool -> PCOptTxOutRefs -> Bool -> Int -> Bool -> PrettyCookedOpts PrettyCookedOpts diff --git a/src/Cooked.RawUPLC.html b/src/Cooked.RawUPLC.html index 86d943134..df85c6baf 100644 --- a/src/Cooked.RawUPLC.html +++ b/src/Cooked.RawUPLC.html @@ -23,9 +23,9 @@ -- ensuring that the type variable @a@, below, gets instantiated -- to the correct type. unsafeTypedValidatorFromUPLC :: - forall a. + forall a. UPLC.Program UPLC.NamedDeBruijn UPLC.DefaultUni UPLC.DefaultFun () -> - TScripts.TypedValidator a + TScripts.TypedValidator a unsafeTypedValidatorFromUPLC :: Program NamedDeBruijn DefaultUni DefaultFun () -> TypedValidator a unsafeTypedValidatorFromUPLC = TypedValidator Any -> TypedValidator a forall a b. a -> b @@ -73,24 +73,24 @@ -> Validator forall b c a. (b -> c) -> (a -> b) -> a -> c . Program NamedDeBruijn DefaultUni DefaultFun () -> Script -fromPlc +fromPlc where -- copied from: github.com/input-output-hk/plutus/blob/1f31e640e8a258185db01fa899da63f9018c0e85/plutus-ledger-api/src/Plutus/V1/Ledger/Scripts.hs#L169 - fromPlc :: UPLC.Program UPLC.NamedDeBruijn UPLC.DefaultUni UPLC.DefaultFun () -> Script - fromPlc :: Program NamedDeBruijn DefaultUni DefaultFun () -> Script -fromPlc (UPLC.Program () -a Version () -v Term NamedDeBruijn DefaultUni DefaultFun () -t) = - let nameless :: Term DeBruijn DefaultUni DefaultFun () -nameless = (NamedDeBruijn -> DeBruijn) + fromPlc :: UPLC.Program UPLC.NamedDeBruijn UPLC.DefaultUni UPLC.DefaultFun () -> Script + fromPlc :: Program NamedDeBruijn DefaultUni DefaultFun () -> Script +fromPlc (UPLC.Program () +a Version () +v Term NamedDeBruijn DefaultUni DefaultFun () +t) = + let nameless :: Term DeBruijn DefaultUni DefaultFun () +nameless = (NamedDeBruijn -> DeBruijn) -> Term NamedDeBruijn DefaultUni DefaultFun () -> Term DeBruijn DefaultUni DefaultFun () forall name name' (uni :: * -> *) fun ann. (name -> name') -> Term name uni fun ann -> Term name' uni fun ann UPLC.termMapNames NamedDeBruijn -> DeBruijn UPLC.unNameDeBruijn Term NamedDeBruijn DefaultUni DefaultFun () -t +t in Program DeBruijn DefaultUni DefaultFun () -> Script Script (Program DeBruijn DefaultUni DefaultFun () -> Script) -> Program DeBruijn DefaultUni DefaultFun () -> Script @@ -103,15 +103,15 @@ ann -> Version ann -> Term name uni fun ann -> Program name uni fun ann UPLC.Program () -a Version () -v Term DeBruijn DefaultUni DefaultFun () -nameless +a Version () +v Term DeBruijn DefaultUni DefaultFun () +nameless -- | Loads a typed validator from a bytestring that was produced by 'Flat.flat' the outputs -- of [getPlc](https://github.com/input-output-hk/plutus/blob/master/plutus-tx/src/PlutusTx/Code.hs#L84) -- applied to a 'TScripts.mkTypedValidator'. If the compiled validator was /not/ wrapped, -- stick to 'typedValidatorFromBS'. -unsafeTypedValidatorFromBS :: forall a. BS.ByteString -> Either String (TScripts.TypedValidator a) +unsafeTypedValidatorFromBS :: forall a. BS.ByteString -> Either String (TScripts.TypedValidator a) unsafeTypedValidatorFromBS :: ByteString -> Either String (TypedValidator a) unsafeTypedValidatorFromBS = (DecodeException -> Either String (TypedValidator a)) -> (Program NamedDeBruijn DefaultUni DefaultFun () diff --git a/src/Cooked.ShowBS.html b/src/Cooked.ShowBS.html index 35919cde3..f7ab974de 100644 --- a/src/Cooked.ShowBS.html +++ b/src/Cooked.ShowBS.html @@ -24,37 +24,37 @@ import PlutusTx.Prelude -- | analogue of Haskell's 'Show' class for use in Plutus scripts. -class ShowBS a where +class ShowBS a where -- | analogue of 'show' {-# INLINEABLE showBS #-} - showBS :: a -> BuiltinString - showBS a -x = Integer -> a -> BuiltinString -> BuiltinString + showBS :: a -> BuiltinString + showBS a +x = Integer -> a -> BuiltinString -> BuiltinString forall a. ShowBS a => Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer 0 a -x BuiltinString +x BuiltinString "" -- | analogue of 'showsPrec' {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> a -> BuiltinString -> BuiltinString - showBSsPrec Integer -_ a -x BuiltinString -s = a -> BuiltinString + showBSsPrec :: Integer -> a -> BuiltinString -> BuiltinString + showBSsPrec Integer +_ a +x BuiltinString +s = a -> BuiltinString forall a. ShowBS a => a -> BuiltinString showBS a -x BuiltinString -> BuiltinString -> BuiltinString +x BuiltinString -> BuiltinString -> BuiltinString forall a. Semigroup a => a -> a -> a <> BuiltinString -s +s -- | analogue of 'shows' {-# INLINEABLE showBSs #-} -showBSs :: ShowBS a => a -> BuiltinString -> BuiltinString +showBSs :: ShowBS a => a -> BuiltinString -> BuiltinString showBSs :: a -> BuiltinString -> BuiltinString showBSs = Integer -> a -> BuiltinString -> BuiltinString forall a. @@ -83,18 +83,18 @@ cat [] = BuiltinString -> BuiltinString forall a. a -> a id -- we cannot use foldr here for some reason with the plutus compiler -cat (BuiltinString -x : [BuiltinString] -xs) = BuiltinString -> BuiltinString -> BuiltinString +cat (BuiltinString +x : [BuiltinString] +xs) = BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString -x (BuiltinString -> BuiltinString) +x (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString forall b c a. (b -> c) -> (a -> b) -> a -> c . [BuiltinString] -> BuiltinString -> BuiltinString cat [BuiltinString] -xs +xs -- | print with a surrounding parenthesis, if the boolean argument is true {-# INLINEABLE showBSParen #-} @@ -104,12 +104,12 @@ -> BuiltinString -> BuiltinString showBSParen Bool -False BuiltinString -> BuiltinString -s = BuiltinString -> BuiltinString -s +False BuiltinString -> BuiltinString +s = BuiltinString -> BuiltinString +s showBSParen Bool -True BuiltinString -> BuiltinString -s = BuiltinString -> BuiltinString -> BuiltinString +True BuiltinString -> BuiltinString +s = BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString "(" (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) @@ -117,7 +117,7 @@ -> BuiltinString forall b c a. (b -> c) -> (a -> b) -> a -> c . BuiltinString -> BuiltinString -s (BuiltinString -> BuiltinString) +s (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString @@ -128,12 +128,12 @@ -- | print an application of a constructor to an argument {-# INLINEABLE application1 #-} -application1 :: ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString +application1 :: ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 :: Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString -application1 Integer -prec BuiltinString -f a -x = Bool +application1 Integer +prec BuiltinString +f a +x = Bool -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString @@ -141,7 +141,7 @@ app_prec Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool <= Integer -prec) ((BuiltinString -> BuiltinString) +prec) ((BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -149,7 +149,7 @@ forall a b. (a -> b) -> a -> b $ BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString -f (BuiltinString -> BuiltinString) +f (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString @@ -167,18 +167,18 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec a -x +x -- | like 'application1' with two arguments {-# INLINEABLE application2 #-} -application2 :: (ShowBS a, ShowBS b) => Integer -> BuiltinString -> a -> b -> BuiltinString -> BuiltinString +application2 :: (ShowBS a, ShowBS b) => Integer -> BuiltinString -> a -> b -> BuiltinString -> BuiltinString application2 :: Integer -> BuiltinString -> a -> b -> BuiltinString -> BuiltinString -application2 Integer -prec BuiltinString -f a -x b -y = +application2 Integer +prec BuiltinString +f a +x b +y = Bool -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -187,7 +187,7 @@ app_prec Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool <= Integer -prec) ((BuiltinString -> BuiltinString) +prec) ((BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -196,7 +196,7 @@ $ BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString -f +f (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -216,7 +216,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec a -x +x (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -236,19 +236,19 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec b -y +y -- | like 'application1' with three arguments {-# INLINEABLE application3 #-} -application3 :: (ShowBS a, ShowBS b, ShowBS c) => Integer -> BuiltinString -> a -> b -> c -> BuiltinString -> BuiltinString +application3 :: (ShowBS a, ShowBS b, ShowBS c) => Integer -> BuiltinString -> a -> b -> c -> BuiltinString -> BuiltinString application3 :: Integer -> BuiltinString -> a -> b -> c -> BuiltinString -> BuiltinString -application3 Integer -prec BuiltinString -f a -x b -y c -z = +application3 Integer +prec BuiltinString +f a +x b +y c +z = Bool -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -257,7 +257,7 @@ app_prec Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool <= Integer -prec) ((BuiltinString -> BuiltinString) +prec) ((BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -266,7 +266,7 @@ $ BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString -f +f (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -286,7 +286,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec a -x +x (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -306,7 +306,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec b -y +y (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -326,11 +326,11 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec c -z +z -- | like 'application1' with four arguments {-# INLINEABLE application4 #-} -application4 :: (ShowBS a, ShowBS b, ShowBS c, ShowBS d) => Integer -> BuiltinString -> a -> b -> c -> d -> BuiltinString -> BuiltinString +application4 :: (ShowBS a, ShowBS b, ShowBS c, ShowBS d) => Integer -> BuiltinString -> a -> b -> c -> d -> BuiltinString -> BuiltinString application4 :: Integer -> BuiltinString -> a @@ -339,13 +339,13 @@ -> d -> BuiltinString -> BuiltinString -application4 Integer -prec BuiltinString -f a -x b -y c -z d -w = +application4 Integer +prec BuiltinString +f a +x b +y c +z d +w = Bool -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -354,7 +354,7 @@ app_prec Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool <= Integer -prec) ((BuiltinString -> BuiltinString) +prec) ((BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -363,7 +363,7 @@ $ BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString -f +f (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -383,7 +383,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec a -x +x (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -403,7 +403,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec b -y +y (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -423,7 +423,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec c -z +z (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -443,132 +443,132 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec d -w +w -instance ShowBS Integer where +instance ShowBS Integer where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> Integer -> BuiltinString -> BuiltinString -showBSsPrec Integer -_ Integer -i = [BuiltinString] -> BuiltinString -> BuiltinString + showBSsPrec :: Integer -> Integer -> BuiltinString -> BuiltinString +showBSsPrec Integer +_ Integer +i = [BuiltinString] -> BuiltinString -> BuiltinString cat (Integer -> [BuiltinString] integerToDigits Integer -i) +i) {-# INLINEABLE integerToDigits #-} integerToDigits :: Integer -> [BuiltinString] integerToDigits :: Integer -> [BuiltinString] -integerToDigits Integer -n +integerToDigits Integer +n | Integer -n Integer -> Integer -> Bool +n Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool < Integer 0 = BuiltinString "-" BuiltinString -> [BuiltinString] -> [BuiltinString] forall a. a -> [a] -> [a] : Integer -> [BuiltinString] -> [BuiltinString] -go (Integer -> Integer +go (Integer -> Integer forall a. AdditiveGroup a => a -> a negate Integer -n) [] +n) [] | Integer -n Integer -> Integer -> Bool +n Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 0 = [BuiltinString "0"] | Bool otherwise = Integer -> [BuiltinString] -> [BuiltinString] -go Integer -n [] +go Integer +n [] where - go :: Integer -> [BuiltinString] -> [BuiltinString] -go Integer -i [BuiltinString] -acc + go :: Integer -> [BuiltinString] -> [BuiltinString] +go Integer +i [BuiltinString] +acc | Integer -i Integer -> Integer -> Bool +i Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 0 = [BuiltinString] -acc +acc | Bool -otherwise = let (Integer -q, Integer -r) = Integer -> Integer -> (Integer, Integer) +otherwise = let (Integer +q, Integer +r) = Integer -> Integer -> (Integer, Integer) quotRem Integer -i Integer +i Integer 10 in Integer -> [BuiltinString] -> [BuiltinString] -go Integer -q (Integer -> BuiltinString +go Integer +q (Integer -> BuiltinString digitToBS Integer -r BuiltinString -> [BuiltinString] -> [BuiltinString] +r BuiltinString -> [BuiltinString] -> [BuiltinString] forall a. a -> [a] -> [a] : [BuiltinString] -acc) +acc) {-# INLINEABLE digitToBS #-} digitToBS :: Integer -> BuiltinString digitToBS :: Integer -> BuiltinString -digitToBS Integer -x +digitToBS Integer +x | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 0 = BuiltinString "0" | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 1 = BuiltinString "1" | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 2 = BuiltinString "2" | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 3 = BuiltinString "3" | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 4 = BuiltinString "4" | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 5 = BuiltinString "5" | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 6 = BuiltinString "6" | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 7 = BuiltinString "7" | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 8 = BuiltinString "8" | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 9 = BuiltinString @@ -577,10 +577,10 @@ otherwise = BuiltinString "?" -instance ShowBS a => ShowBS [a] where +instance ShowBS a => ShowBS [a] where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> [a] -> BuiltinString -> BuiltinString -showBSsPrec Integer + showBSsPrec :: Integer -> [a] -> BuiltinString -> BuiltinString +showBSsPrec Integer _ = BuiltinString -> BuiltinString -> BuiltinString @@ -604,7 +604,7 @@ showBSs {-# INLINEABLE catList #-} -catList :: BuiltinString -> BuiltinString -> BuiltinString -> (a -> BuiltinString -> BuiltinString) -> [a] -> BuiltinString -> BuiltinString +catList :: BuiltinString -> BuiltinString -> BuiltinString -> (a -> BuiltinString -> BuiltinString) -> [a] -> BuiltinString -> BuiltinString catList :: BuiltinString -> BuiltinString -> BuiltinString @@ -612,82 +612,82 @@ -> [a] -> BuiltinString -> BuiltinString -catList BuiltinString -open BuiltinString -_ BuiltinString -close a -> BuiltinString -> BuiltinString +catList BuiltinString +open BuiltinString +_ BuiltinString +close a -> BuiltinString -> BuiltinString _ [] = BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString -open (BuiltinString -> BuiltinString) +open (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString forall b c a. (b -> c) -> (a -> b) -> a -> c . BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString -close -catList BuiltinString -open BuiltinString -sep BuiltinString -close a -> BuiltinString -> BuiltinString -print (a -x : [a] -xs) = BuiltinString -> BuiltinString -> BuiltinString +close +catList BuiltinString +open BuiltinString +sep BuiltinString +close a -> BuiltinString -> BuiltinString +print (a +x : [a] +xs) = BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString -open (BuiltinString -> BuiltinString) +open (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString forall b c a. (b -> c) -> (a -> b) -> a -> c . a -> BuiltinString -> BuiltinString -print a -x (BuiltinString -> BuiltinString) +print a +x (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString forall b c a. (b -> c) -> (a -> b) -> a -> c . [a] -> BuiltinString -> BuiltinString -printSeparated [a] -xs (BuiltinString -> BuiltinString) +printSeparated [a] +xs (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString forall b c a. (b -> c) -> (a -> b) -> a -> c . BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString -close +close where - printSeparated :: [a] -> BuiltinString -> BuiltinString -printSeparated [] = BuiltinString -> BuiltinString + printSeparated :: [a] -> BuiltinString -> BuiltinString +printSeparated [] = BuiltinString -> BuiltinString forall a. a -> a id - printSeparated (a -y : [a] -ys) = BuiltinString -> BuiltinString -> BuiltinString + printSeparated (a +y : [a] +ys) = BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString -sep (BuiltinString -> BuiltinString) +sep (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString forall b c a. (b -> c) -> (a -> b) -> a -> c . a -> BuiltinString -> BuiltinString -print a -y (BuiltinString -> BuiltinString) +print a +y (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString forall b c a. (b -> c) -> (a -> b) -> a -> c . [a] -> BuiltinString -> BuiltinString -printSeparated [a] -ys +printSeparated [a] +ys -instance (ShowBS a, ShowBS b) => ShowBS (a, b) where +instance (ShowBS a, ShowBS b) => ShowBS (a, b) where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> (a, b) -> BuiltinString -> BuiltinString -showBSsPrec Integer -_ (a -x, b -y) = BuiltinString -> BuiltinString -> BuiltinString + showBSsPrec :: Integer -> (a, b) -> BuiltinString -> BuiltinString +showBSsPrec Integer +_ (a +x, b +y) = BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString "(" (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) @@ -697,7 +697,7 @@ . a -> BuiltinString -> BuiltinString forall a. ShowBS a => a -> BuiltinString -> BuiltinString showBSs a -x (BuiltinString -> BuiltinString) +x (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString @@ -712,7 +712,7 @@ . b -> BuiltinString -> BuiltinString forall a. ShowBS a => a -> BuiltinString -> BuiltinString showBSs b -y (BuiltinString -> BuiltinString) +y (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString @@ -721,10 +721,10 @@ literal BuiltinString ")" -instance ShowBS Bool where +instance ShowBS Bool where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> Bool -> BuiltinString -> BuiltinString -showBSsPrec Integer + showBSsPrec :: Integer -> Bool -> BuiltinString -> BuiltinString +showBSsPrec Integer _ Bool True = BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString @@ -735,49 +735,49 @@ literal BuiltinString "False" -instance ShowBS a => ShowBS (Maybe a) where +instance ShowBS a => ShowBS (Maybe a) where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> Maybe a -> BuiltinString -> BuiltinString -showBSsPrec Integer + showBSsPrec :: Integer -> Maybe a -> BuiltinString -> BuiltinString +showBSsPrec Integer _ Maybe a Nothing = BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString "Nothing" - showBSsPrec Integer -p (Just a -x) = Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString + showBSsPrec Integer +p (Just a +x) = Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString forall a. ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "Just" a -x +x -instance (ShowBS k, ShowBS v) => ShowBS (Map k v) where +instance (ShowBS k, ShowBS v) => ShowBS (Map k v) where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> Map k v -> BuiltinString -> BuiltinString -showBSsPrec Integer -p Map k v -m = Integer + showBSsPrec :: Integer -> Map k v -> BuiltinString -> BuiltinString +showBSsPrec Integer +p Map k v +m = Integer -> BuiltinString -> [(k, v)] -> BuiltinString -> BuiltinString forall a. ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "fromList" (Map k v -> [(k, v)] forall k v. Map k v -> [(k, v)] PlMap.toList Map k v -m) +m) -instance ShowBS BuiltinByteString where +instance ShowBS BuiltinByteString where -- base16 representation {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> BuiltinByteString -> BuiltinString -> BuiltinString -showBSsPrec Integer -_ BuiltinByteString -bs = BuiltinString -> BuiltinString -> BuiltinString + showBSsPrec :: Integer -> BuiltinByteString -> BuiltinString -> BuiltinString +showBSsPrec Integer +_ BuiltinByteString +bs = BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString "\"" (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) @@ -787,7 +787,7 @@ . [BuiltinString] -> BuiltinString -> BuiltinString cat (BuiltinByteString -> [BuiltinString] builtinByteStringCharacters BuiltinByteString -bs) (BuiltinString -> BuiltinString) +bs) (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString @@ -799,99 +799,99 @@ {-# INLINEABLE builtinByteStringCharacters #-} builtinByteStringCharacters :: BuiltinByteString -> [BuiltinString] builtinByteStringCharacters :: BuiltinByteString -> [BuiltinString] -builtinByteStringCharacters BuiltinByteString -s = Integer -> [BuiltinString] -> [BuiltinString] -go (Integer -len Integer -> Integer -> Integer +builtinByteStringCharacters BuiltinByteString +s = Integer -> [BuiltinString] -> [BuiltinString] +go (Integer +len Integer -> Integer -> Integer forall a. AdditiveGroup a => a -> a -> a - Integer 1) [] where - len :: Integer -len = BuiltinByteString -> Integer + len :: Integer +len = BuiltinByteString -> Integer lengthOfByteString BuiltinByteString -s +s - go :: Integer -> [BuiltinString] -> [BuiltinString] - go :: Integer -> [BuiltinString] -> [BuiltinString] -go Integer -i [BuiltinString] -acc + go :: Integer -> [BuiltinString] -> [BuiltinString] + go :: Integer -> [BuiltinString] -> [BuiltinString] +go Integer +i [BuiltinString] +acc | Integer -i Integer -> Integer -> Bool +i Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool >= Integer 0 = - let (Integer -highNibble, Integer -lowNibble) = Integer -> Integer -> (Integer, Integer) + let (Integer +highNibble, Integer +lowNibble) = Integer -> Integer -> (Integer, Integer) quotRem (BuiltinByteString -> Integer -> Integer indexByteString BuiltinByteString -s Integer -i) Integer +s Integer +i) Integer 16 in Integer -> [BuiltinString] -> [BuiltinString] -go (Integer -i Integer -> Integer -> Integer +go (Integer +i Integer -> Integer -> Integer forall a. AdditiveGroup a => a -> a -> a - Integer 1) (Integer -> BuiltinString -toHex Integer -highNibble BuiltinString -> [BuiltinString] -> [BuiltinString] +toHex Integer +highNibble BuiltinString -> [BuiltinString] -> [BuiltinString] forall a. a -> [a] -> [a] : Integer -> BuiltinString -toHex Integer -lowNibble BuiltinString -> [BuiltinString] -> [BuiltinString] +toHex Integer +lowNibble BuiltinString -> [BuiltinString] -> [BuiltinString] forall a. a -> [a] -> [a] : [BuiltinString] -acc) +acc) | Bool otherwise = [BuiltinString] -acc +acc - toHex :: Integer -> BuiltinString - toHex :: Integer -> BuiltinString -toHex Integer -x + toHex :: Integer -> BuiltinString + toHex :: Integer -> BuiltinString +toHex Integer +x | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool <= Integer 9 = Integer -> BuiltinString digitToBS Integer -x +x | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 10 = BuiltinString "a" | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 11 = BuiltinString "b" | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 12 = BuiltinString "c" | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 13 = BuiltinString "d" | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 14 = BuiltinString "e" | Integer -x Integer -> Integer -> Bool +x Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer 15 = BuiltinString @@ -900,12 +900,12 @@ otherwise = BuiltinString "?" -instance ShowBS TokenName where +instance ShowBS TokenName where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> TokenName -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (TokenName BuiltinByteString -x) = Integer + showBSsPrec :: Integer -> TokenName -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (TokenName BuiltinByteString +x) = Integer -> BuiltinString -> BuiltinByteString -> BuiltinString @@ -914,16 +914,16 @@ ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "TokenName" BuiltinByteString -x +x -instance ShowBS CurrencySymbol where +instance ShowBS CurrencySymbol where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> CurrencySymbol -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (CurrencySymbol BuiltinByteString -x) = Integer + showBSsPrec :: Integer -> CurrencySymbol -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (CurrencySymbol BuiltinByteString +x) = Integer -> BuiltinString -> BuiltinByteString -> BuiltinString @@ -932,16 +932,16 @@ ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "CurrencySymbol" BuiltinByteString -x +x -instance ShowBS Value where +instance ShowBS Value where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> Value -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (Value Map CurrencySymbol (Map TokenName Integer) -m) = Integer + showBSsPrec :: Integer -> Value -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (Value Map CurrencySymbol (Map TokenName Integer) +m) = Integer -> BuiltinString -> Map CurrencySymbol (Map TokenName Integer) -> BuiltinString @@ -950,16 +950,16 @@ ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "Value" Map CurrencySymbol (Map TokenName Integer) -m +m -instance ShowBS TxId where +instance ShowBS TxId where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> TxId -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (TxId BuiltinByteString -x) = Integer + showBSsPrec :: Integer -> TxId -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (TxId BuiltinByteString +x) = Integer -> BuiltinString -> BuiltinByteString -> BuiltinString @@ -968,17 +968,17 @@ ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "TxId" BuiltinByteString -x +x -instance ShowBS TxOutRef where +instance ShowBS TxOutRef where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> TxOutRef -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (TxOutRef TxId -txid Integer -i) = Integer + showBSsPrec :: Integer -> TxOutRef -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (TxOutRef TxId +txid Integer +i) = Integer -> BuiltinString -> TxId -> Integer @@ -989,17 +989,17 @@ Integer -> BuiltinString -> a -> b -> BuiltinString -> BuiltinString application2 Integer -p BuiltinString +p BuiltinString "TxOutRef" TxId -txid Integer -i +txid Integer +i -instance ShowBS ValidatorHash where +instance ShowBS ValidatorHash where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> ValidatorHash -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (ValidatorHash BuiltinByteString -h) = Integer + showBSsPrec :: Integer -> ValidatorHash -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (ValidatorHash BuiltinByteString +h) = Integer -> BuiltinString -> BuiltinByteString -> BuiltinString @@ -1008,16 +1008,16 @@ ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "ValidatorHash" BuiltinByteString -h +h -instance ShowBS PubKeyHash where +instance ShowBS PubKeyHash where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> PubKeyHash -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (PubKeyHash BuiltinByteString -h) = Integer + showBSsPrec :: Integer -> PubKeyHash -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (PubKeyHash BuiltinByteString +h) = Integer -> BuiltinString -> BuiltinByteString -> BuiltinString @@ -1026,55 +1026,55 @@ ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "PubKeyHash" BuiltinByteString -h +h -instance ShowBS Credential where +instance ShowBS Credential where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> Credential -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (ScriptCredential ValidatorHash -scriptHash) = Integer + showBSsPrec :: Integer -> Credential -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (ScriptCredential ValidatorHash +scriptHash) = Integer -> BuiltinString -> ValidatorHash -> BuiltinString -> BuiltinString forall a. ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "ScriptCredential" ValidatorHash -scriptHash - showBSsPrec Integer -p (PubKeyCredential PubKeyHash -pkh) = Integer +scriptHash + showBSsPrec Integer +p (PubKeyCredential PubKeyHash +pkh) = Integer -> BuiltinString -> PubKeyHash -> BuiltinString -> BuiltinString forall a. ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "PubKeyCredential" PubKeyHash -pkh +pkh -instance ShowBS StakingCredential where +instance ShowBS StakingCredential where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> StakingCredential -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (StakingHash Credential -cred) = Integer + showBSsPrec :: Integer -> StakingCredential -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (StakingHash Credential +cred) = Integer -> BuiltinString -> Credential -> BuiltinString -> BuiltinString forall a. ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "StakingCredential" Credential -cred - showBSsPrec Integer -p (StakingPtr Integer -i Integer -j Integer -k) = Integer +cred + showBSsPrec Integer +p (StakingPtr Integer +i Integer +j Integer +k) = Integer -> BuiltinString -> Integer -> Integer @@ -1086,19 +1086,19 @@ Integer -> BuiltinString -> a -> b -> c -> BuiltinString -> BuiltinString application3 Integer -p BuiltinString +p BuiltinString "StakingPtr" Integer -i Integer -j Integer -k +i Integer +j Integer +k -instance ShowBS Address where +instance ShowBS Address where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> Address -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (Address Credential -cred Maybe StakingCredential -mStCred) = Integer + showBSsPrec :: Integer -> Address -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (Address Credential +cred Maybe StakingCredential +mStCred) = Integer -> BuiltinString -> Credential -> Maybe StakingCredential @@ -1109,17 +1109,17 @@ Integer -> BuiltinString -> a -> b -> BuiltinString -> BuiltinString application2 Integer -p BuiltinString +p BuiltinString "Address" Credential -cred Maybe StakingCredential -mStCred +cred Maybe StakingCredential +mStCred -instance ShowBS DatumHash where +instance ShowBS DatumHash where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> DatumHash -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (DatumHash BuiltinByteString -h) = Integer + showBSsPrec :: Integer -> DatumHash -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (DatumHash BuiltinByteString +h) = Integer -> BuiltinString -> BuiltinByteString -> BuiltinString @@ -1128,16 +1128,16 @@ ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "DatumHash" BuiltinByteString -h +h -instance ShowBS BuiltinData where +instance ShowBS BuiltinData where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> BuiltinData -> BuiltinString -> BuiltinString -showBSsPrec Integer -p BuiltinData -d = Bool + showBSsPrec :: Integer -> BuiltinData -> BuiltinString -> BuiltinString +showBSsPrec Integer +p BuiltinData +d = Bool -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString @@ -1145,7 +1145,7 @@ app_prec Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool <= Integer -p) ((BuiltinString -> BuiltinString) +p) ((BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1161,14 +1161,14 @@ . Integer -> BuiltinData -> BuiltinString -> BuiltinString builtinDataShowBSsPrec Integer app_prec BuiltinData -d +d {-# INLINEABLE builtinDataShowBSsPrec #-} builtinDataShowBSsPrec :: Integer -> BuiltinData -> BuiltinString -> BuiltinString builtinDataShowBSsPrec :: Integer -> BuiltinData -> BuiltinString -> BuiltinString -builtinDataShowBSsPrec Integer -p BuiltinData -d = +builtinDataShowBSsPrec Integer +p BuiltinData +d = BuiltinData -> (Integer -> [BuiltinData] -> BuiltinString -> BuiltinString) -> ([(BuiltinData, BuiltinData)] -> BuiltinString -> BuiltinString) @@ -1187,10 +1187,10 @@ -> r matchData BuiltinData -d - ( \Integer -i [BuiltinData] -ds -> +d + ( \Integer +i [BuiltinData] +ds -> Bool -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1199,7 +1199,7 @@ app_prec Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool <= Integer -p) ((BuiltinString -> BuiltinString) +p) ((BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1217,7 +1217,7 @@ . Integer -> BuiltinString -> BuiltinString forall a. ShowBS a => a -> BuiltinString -> BuiltinString showBSs Integer -i +i (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1252,10 +1252,10 @@ "]" (Integer -> BuiltinData -> BuiltinString -> BuiltinString builtinDataShowBSsPrec Integer 0) [BuiltinData] -ds +ds ) - ( \[(BuiltinData, BuiltinData)] -alist -> + ( \[(BuiltinData, BuiltinData)] +alist -> Bool -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1264,7 +1264,7 @@ app_prec Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool <= Integer -p) ((BuiltinString -> BuiltinString) +p) ((BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1301,9 +1301,9 @@ "," BuiltinString "]" - (\(BuiltinData -a, BuiltinData -b) -> BuiltinString -> BuiltinString -> BuiltinString + (\(BuiltinData +a, BuiltinData +b) -> BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString "(" (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) @@ -1313,7 +1313,7 @@ . Integer -> BuiltinData -> BuiltinString -> BuiltinString builtinDataShowBSsPrec Integer 0 BuiltinData -a (BuiltinString -> BuiltinString) +a (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString @@ -1328,7 +1328,7 @@ . Integer -> BuiltinData -> BuiltinString -> BuiltinString builtinDataShowBSsPrec Integer 0 BuiltinData -b (BuiltinString -> BuiltinString) +b (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString @@ -1337,10 +1337,10 @@ literal BuiltinString ")") [(BuiltinData, BuiltinData)] -alist +alist ) - ( \[BuiltinData] -list -> + ( \[BuiltinData] +list -> Bool -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1349,7 +1349,7 @@ app_prec Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool <= Integer -p) ((BuiltinString -> BuiltinString) +p) ((BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1385,10 +1385,10 @@ "]" (Integer -> BuiltinData -> BuiltinString -> BuiltinString builtinDataShowBSsPrec Integer 0) [BuiltinData] -list +list ) - (\Integer -i -> Bool + (\Integer +i -> Bool -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString @@ -1396,7 +1396,7 @@ app_prec Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool <= Integer -p) ((BuiltinString -> BuiltinString) +p) ((BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1412,9 +1412,9 @@ . Integer -> BuiltinString -> BuiltinString forall a. ShowBS a => a -> BuiltinString -> BuiltinString showBSs Integer -i) - (\BuiltinByteString -bs -> Bool +i) + (\BuiltinByteString +bs -> Bool -> (BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString @@ -1422,7 +1422,7 @@ app_prec Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool <= Integer -p) ((BuiltinString -> BuiltinString) +p) ((BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1438,59 +1438,59 @@ . BuiltinByteString -> BuiltinString -> BuiltinString forall a. ShowBS a => a -> BuiltinString -> BuiltinString showBSs BuiltinByteString -bs) +bs) -instance ShowBS Datum where +instance ShowBS Datum where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> Datum -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (Datum BuiltinData -d) = Integer + showBSsPrec :: Integer -> Datum -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (Datum BuiltinData +d) = Integer -> BuiltinString -> BuiltinData -> BuiltinString -> BuiltinString forall a. ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "Datum" BuiltinData -d +d -instance ShowBS OutputDatum where +instance ShowBS OutputDatum where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> OutputDatum -> BuiltinString -> BuiltinString -showBSsPrec Integer + showBSsPrec :: Integer -> OutputDatum -> BuiltinString -> BuiltinString +showBSsPrec Integer _ OutputDatum NoOutputDatum = BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString "NoOutputDatum" - showBSsPrec Integer -p (OutputDatumHash DatumHash -h) = Integer + showBSsPrec Integer +p (OutputDatumHash DatumHash +h) = Integer -> BuiltinString -> DatumHash -> BuiltinString -> BuiltinString forall a. ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "OutputDatumHash" DatumHash -h - showBSsPrec Integer -p (OutputDatum Datum -d) = Integer -> BuiltinString -> Datum -> BuiltinString -> BuiltinString +h + showBSsPrec Integer +p (OutputDatum Datum +d) = Integer -> BuiltinString -> Datum -> BuiltinString -> BuiltinString forall a. ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "OutputDatum" Datum -d +d -instance ShowBS ScriptHash where +instance ShowBS ScriptHash where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> ScriptHash -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (ScriptHash BuiltinByteString -h) = Integer + showBSsPrec :: Integer -> ScriptHash -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (ScriptHash BuiltinByteString +h) = Integer -> BuiltinString -> BuiltinByteString -> BuiltinString @@ -1499,19 +1499,19 @@ ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "ScriptHash" BuiltinByteString -h +h -instance ShowBS TxOut where +instance ShowBS TxOut where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> TxOut -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (TxOut Address -address Value -value OutputDatum -datum Maybe ScriptHash -mRefScriptHash) = Integer + showBSsPrec :: Integer -> TxOut -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (TxOut Address +address Value +value OutputDatum +datum Maybe ScriptHash +mRefScriptHash) = Integer -> BuiltinString -> Address -> Value @@ -1530,20 +1530,20 @@ -> BuiltinString -> BuiltinString application4 Integer -p BuiltinString +p BuiltinString "TxOut" Address -address Value -value OutputDatum -datum Maybe ScriptHash -mRefScriptHash +address Value +value OutputDatum +datum Maybe ScriptHash +mRefScriptHash -instance ShowBS TxInInfo where +instance ShowBS TxInInfo where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> TxInInfo -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (TxInInfo TxOutRef -oref TxOut -out) = Integer + showBSsPrec :: Integer -> TxInInfo -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (TxInInfo TxOutRef +oref TxOut +out) = Integer -> BuiltinString -> TxOutRef -> TxOut @@ -1554,30 +1554,30 @@ Integer -> BuiltinString -> a -> b -> BuiltinString -> BuiltinString application2 Integer -p BuiltinString +p BuiltinString "TxInInfo" TxOutRef -oref TxOut -out +oref TxOut +out -instance ShowBS POSIXTime where +instance ShowBS POSIXTime where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> POSIXTime -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (POSIXTime Integer -t) = Integer + showBSsPrec :: Integer -> POSIXTime -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (POSIXTime Integer +t) = Integer -> BuiltinString -> Integer -> BuiltinString -> BuiltinString forall a. ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "POSIXTime" Integer -t +t -instance ShowBS a => ShowBS (Extended a) where +instance ShowBS a => ShowBS (Extended a) where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> Extended a -> BuiltinString -> BuiltinString -showBSsPrec Integer + showBSsPrec :: Integer -> Extended a -> BuiltinString -> BuiltinString +showBSsPrec Integer _ Extended a NegInf = BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString @@ -1587,24 +1587,24 @@ PosInf = BuiltinString -> BuiltinString -> BuiltinString literal BuiltinString "PosInf" - showBSsPrec Integer -p (Finite a -x) = Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString + showBSsPrec Integer +p (Finite a +x) = Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString forall a. ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "Finite" a -x +x -instance ShowBS a => ShowBS (LowerBound a) where +instance ShowBS a => ShowBS (LowerBound a) where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> LowerBound a -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (LowerBound Extended a -x Bool -closure) = Integer + showBSsPrec :: Integer -> LowerBound a -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (LowerBound Extended a +x Bool +closure) = Integer -> BuiltinString -> Extended a -> Bool @@ -1615,18 +1615,18 @@ Integer -> BuiltinString -> a -> b -> BuiltinString -> BuiltinString application2 Integer -p BuiltinString +p BuiltinString "LowerBound" Extended a -x Bool -closure +x Bool +closure -instance ShowBS a => ShowBS (UpperBound a) where +instance ShowBS a => ShowBS (UpperBound a) where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> UpperBound a -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (UpperBound Extended a -x Bool -closure) = Integer + showBSsPrec :: Integer -> UpperBound a -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (UpperBound Extended a +x Bool +closure) = Integer -> BuiltinString -> Extended a -> Bool @@ -1637,18 +1637,18 @@ Integer -> BuiltinString -> a -> b -> BuiltinString -> BuiltinString application2 Integer -p BuiltinString +p BuiltinString "UpperBound" Extended a -x Bool -closure +x Bool +closure -instance ShowBS a => ShowBS (Interval a) where +instance ShowBS a => ShowBS (Interval a) where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> Interval a -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (Interval LowerBound a -lb UpperBound a -ub) = Integer + showBSsPrec :: Integer -> Interval a -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (Interval LowerBound a +lb UpperBound a +ub) = Integer -> BuiltinString -> LowerBound a -> UpperBound a @@ -1659,17 +1659,17 @@ Integer -> BuiltinString -> a -> b -> BuiltinString -> BuiltinString application2 Integer -p BuiltinString +p BuiltinString "Interval" LowerBound a -lb UpperBound a -ub +lb UpperBound a +ub -instance ShowBS DCert where +instance ShowBS DCert where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> DCert -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (DCertDelegRegKey StakingCredential -stCred) = Integer + showBSsPrec :: Integer -> DCert -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (DCertDelegRegKey StakingCredential +stCred) = Integer -> BuiltinString -> StakingCredential -> BuiltinString @@ -1678,12 +1678,12 @@ ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "DCertDelegRegKey" StakingCredential -stCred - showBSsPrec Integer -p (DCertDelegDeRegKey StakingCredential -stCred) = Integer +stCred + showBSsPrec Integer +p (DCertDelegDeRegKey StakingCredential +stCred) = Integer -> BuiltinString -> StakingCredential -> BuiltinString @@ -1692,13 +1692,13 @@ ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "DCertDelegDeRegKey" StakingCredential -stCred - showBSsPrec Integer -p (DCertDelegDelegate StakingCredential -stCred PubKeyHash -pkh) = Integer +stCred + showBSsPrec Integer +p (DCertDelegDelegate StakingCredential +stCred PubKeyHash +pkh) = Integer -> BuiltinString -> StakingCredential -> PubKeyHash @@ -1709,14 +1709,14 @@ Integer -> BuiltinString -> a -> b -> BuiltinString -> BuiltinString application2 Integer -p BuiltinString +p BuiltinString "DCertDelegDelegate" StakingCredential -stCred PubKeyHash -pkh - showBSsPrec Integer -p (DCertPoolRegister PubKeyHash -stCred1 PubKeyHash -stCred2) = Integer +stCred PubKeyHash +pkh + showBSsPrec Integer +p (DCertPoolRegister PubKeyHash +stCred1 PubKeyHash +stCred2) = Integer -> BuiltinString -> PubKeyHash -> PubKeyHash @@ -1727,14 +1727,14 @@ Integer -> BuiltinString -> a -> b -> BuiltinString -> BuiltinString application2 Integer -p BuiltinString +p BuiltinString "DCertPoolRegister" PubKeyHash -stCred1 PubKeyHash -stCred2 - showBSsPrec Integer -p (DCertPoolRetire PubKeyHash -stCred Integer -i) = Integer +stCred1 PubKeyHash +stCred2 + showBSsPrec Integer +p (DCertPoolRetire PubKeyHash +stCred Integer +i) = Integer -> BuiltinString -> PubKeyHash -> Integer @@ -1745,10 +1745,10 @@ Integer -> BuiltinString -> a -> b -> BuiltinString -> BuiltinString application2 Integer -p BuiltinString +p BuiltinString "DCertPoolRetire" PubKeyHash -stCred Integer -i +stCred Integer +i showBSsPrec Integer _ DCert DCertGenesis = BuiltinString -> BuiltinString -> BuiltinString @@ -1760,12 +1760,12 @@ literal BuiltinString "DCertMir" -instance ShowBS ScriptPurpose where +instance ShowBS ScriptPurpose where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> ScriptPurpose -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (Minting CurrencySymbol -cs) = Integer + showBSsPrec :: Integer -> ScriptPurpose -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (Minting CurrencySymbol +cs) = Integer -> BuiltinString -> CurrencySymbol -> BuiltinString @@ -1774,23 +1774,23 @@ ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "Minting" CurrencySymbol -cs - showBSsPrec Integer -p (Spending TxOutRef -oref) = Integer +cs + showBSsPrec Integer +p (Spending TxOutRef +oref) = Integer -> BuiltinString -> TxOutRef -> BuiltinString -> BuiltinString forall a. ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "Spending" TxOutRef -oref - showBSsPrec Integer -p (Rewarding StakingCredential -stCred) = Integer +oref + showBSsPrec Integer +p (Rewarding StakingCredential +stCred) = Integer -> BuiltinString -> StakingCredential -> BuiltinString @@ -1799,40 +1799,40 @@ ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "Rewarding" StakingCredential -stCred - showBSsPrec Integer -p (Certifying DCert -dCert) = Integer -> BuiltinString -> DCert -> BuiltinString -> BuiltinString +stCred + showBSsPrec Integer +p (Certifying DCert +dCert) = Integer -> BuiltinString -> DCert -> BuiltinString -> BuiltinString forall a. ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "Certifying" DCert -dCert +dCert -instance ShowBS Redeemer where +instance ShowBS Redeemer where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> Redeemer -> BuiltinString -> BuiltinString -showBSsPrec Integer -p (Redeemer BuiltinData -builtinData) = Integer + showBSsPrec :: Integer -> Redeemer -> BuiltinString -> BuiltinString +showBSsPrec Integer +p (Redeemer BuiltinData +builtinData) = Integer -> BuiltinString -> BuiltinData -> BuiltinString -> BuiltinString forall a. ShowBS a => Integer -> BuiltinString -> a -> BuiltinString -> BuiltinString application1 Integer -p BuiltinString +p BuiltinString "Redeemer" BuiltinData -builtinData +builtinData -instance ShowBS TxInfo where +instance ShowBS TxInfo where {-# INLINEABLE showBSsPrec #-} - showBSsPrec :: Integer -> TxInfo -> BuiltinString -> BuiltinString -showBSsPrec Integer -p TxInfo {[PubKeyHash] + showBSsPrec :: Integer -> TxInfo -> BuiltinString -> BuiltinString +showBSsPrec Integer +p TxInfo {[PubKeyHash] [DCert] [TxInInfo] [TxOut] @@ -1875,7 +1875,7 @@ app_prec Integer -> Integer -> Bool forall a. Ord a => a -> a -> Bool <= Integer -p) ((BuiltinString -> BuiltinString) +p) ((BuiltinString -> BuiltinString) -> BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1896,7 +1896,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec [TxInInfo] -txInfoInputs +txInfoInputs (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1916,7 +1916,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec [TxInInfo] -txInfoReferenceInputs +txInfoReferenceInputs (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1936,7 +1936,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec [TxOut] -txInfoOutputs +txInfoOutputs (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1956,7 +1956,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec Value -txInfoFee +txInfoFee (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1976,7 +1976,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec Value -txInfoMint +txInfoMint (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -1996,7 +1996,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec [DCert] -txInfoDCert +txInfoDCert (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -2017,7 +2017,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec Map StakingCredential Integer -txInfoWdrl +txInfoWdrl (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -2037,7 +2037,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec POSIXTimeRange -txInfoValidRange +txInfoValidRange (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -2057,7 +2057,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec [PubKeyHash] -txInfoSignatories +txInfoSignatories (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -2078,7 +2078,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec Map ScriptPurpose Redeemer -txInfoRedeemers +txInfoRedeemers (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -2098,7 +2098,7 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec Map DatumHash Datum -txInfoData +txInfoData (BuiltinString -> BuiltinString) -> (BuiltinString -> BuiltinString) -> BuiltinString @@ -2118,5 +2118,5 @@ Integer -> a -> BuiltinString -> BuiltinString showBSsPrec Integer app_prec TxId -txInfoId +txInfoId \ No newline at end of file diff --git a/src/Cooked.Skeleton.html b/src/Cooked.Skeleton.html index 711551206..029f3366c 100644 --- a/src/Cooked.Skeleton.html +++ b/src/Cooked.Skeleton.html @@ -118,37 +118,37 @@ -- * Transaction labels -type LabelConstrs x = (Show x, Typeable x, Eq x, Ord x) +type LabelConstrs x = (Show x, Typeable x, Eq x, Ord x) data TxLabel where - TxLabel :: LabelConstrs x => x -> TxLabel + TxLabel :: LabelConstrs x => x -> TxLabel -instance Eq TxLabel where - TxLabel -a == :: TxLabel -> TxLabel -> Bool -== TxLabel -x = TxLabel -> TxLabel -> Ordering +instance Eq TxLabel where + TxLabel +a == :: TxLabel -> TxLabel -> Bool +== TxLabel +x = TxLabel -> TxLabel -> Ordering forall a. Ord a => a -> a -> Ordering compare TxLabel -a TxLabel -x Ordering -> Ordering -> Bool +a TxLabel +x Ordering -> Ordering -> Bool forall a. Eq a => a -> a -> Bool == Ordering EQ -instance Show TxLabel where - show :: TxLabel -> String -show (TxLabel x -x) = x -> String +instance Show TxLabel where + show :: TxLabel -> String +show (TxLabel x +x) = x -> String forall a. Show a => a -> String show x -x +x -instance Ord TxLabel where - compare :: TxLabel -> TxLabel -> Ordering -compare (TxLabel x -a) (TxLabel x -x) = +instance Ord TxLabel where + compare :: TxLabel -> TxLabel -> Ordering +compare (TxLabel x +a) (TxLabel x +x) = case SomeTypeRep -> SomeTypeRep -> Ordering forall a. Ord a => a -> a -> Ordering compare (TypeRep x -> SomeTypeRep @@ -156,12 +156,12 @@ SomeTypeRep (x -> TypeRep x forall a. Typeable a => a -> TypeRep a typeOf x -a)) (TypeRep x -> SomeTypeRep +a)) (TypeRep x -> SomeTypeRep forall k (a :: k). TypeRep a -> SomeTypeRep SomeTypeRep (x -> TypeRep x forall a. Typeable a => a -> TypeRep a typeOf x -x)) of +x)) of Ordering LT -> Ordering LT @@ -172,20 +172,20 @@ EQ -> case x -> TypeRep x forall a. Typeable a => a -> TypeRep a typeOf x -a TypeRep x -> TypeRep x -> Maybe (x :~~: x) +a TypeRep x -> TypeRep x -> Maybe (x :~~: x) forall k1 k2 (a :: k1) (b :: k2). TypeRep a -> TypeRep b -> Maybe (a :~~: b) `eqTypeRep` x -> TypeRep x forall a. Typeable a => a -> TypeRep a typeOf x -x of +x of Just x :~~: x HRefl -> x -> x -> Ordering forall a. Ord a => a -> a -> Ordering compare x -a x +a x x -x +x -- This can never happen, since 'eqTypeRep' is implemented in terms of -- '==' on the type representation: Maybe (x :~~: x) @@ -205,7 +205,7 @@ | -- | Do not change the existing outputs, always create a new change -- output. DontAdjustExistingOutput - deriving (BalanceOutputPolicy -> BalanceOutputPolicy -> Bool + deriving (BalanceOutputPolicy -> BalanceOutputPolicy -> Bool (BalanceOutputPolicy -> BalanceOutputPolicy -> Bool) -> (BalanceOutputPolicy -> BalanceOutputPolicy -> Bool) -> Eq BalanceOutputPolicy @@ -214,7 +214,7 @@ $c/= :: BalanceOutputPolicy -> BalanceOutputPolicy -> Bool == :: BalanceOutputPolicy -> BalanceOutputPolicy -> Bool $c== :: BalanceOutputPolicy -> BalanceOutputPolicy -> Bool -Eq, Eq BalanceOutputPolicy +Eq, Eq BalanceOutputPolicy Eq BalanceOutputPolicy -> (BalanceOutputPolicy -> BalanceOutputPolicy -> Ordering) -> (BalanceOutputPolicy -> BalanceOutputPolicy -> Bool) @@ -254,7 +254,7 @@ compare :: BalanceOutputPolicy -> BalanceOutputPolicy -> Ordering $ccompare :: BalanceOutputPolicy -> BalanceOutputPolicy -> Ordering $cp1Ord :: Eq BalanceOutputPolicy -Ord, Int -> BalanceOutputPolicy -> ShowS +Ord, Int -> BalanceOutputPolicy -> ShowS [BalanceOutputPolicy] -> ShowS BalanceOutputPolicy -> String (Int -> BalanceOutputPolicy -> ShowS) @@ -272,7 +272,7 @@ Show) instance Default BalanceOutputPolicy where - def :: BalanceOutputPolicy + def :: BalanceOutputPolicy def = BalanceOutputPolicy AdjustExistingOutput @@ -282,7 +282,7 @@ data BalancingWallet = BalanceWithFirstSigner | BalanceWith Wallet - deriving (BalancingWallet -> BalancingWallet -> Bool + deriving (BalancingWallet -> BalancingWallet -> Bool (BalancingWallet -> BalancingWallet -> Bool) -> (BalancingWallet -> BalancingWallet -> Bool) -> Eq BalancingWallet @@ -291,7 +291,7 @@ $c/= :: BalancingWallet -> BalancingWallet -> Bool == :: BalancingWallet -> BalancingWallet -> Bool $c== :: BalancingWallet -> BalancingWallet -> Bool -Eq, Eq BalancingWallet +Eq, Eq BalancingWallet Eq BalancingWallet -> (BalancingWallet -> BalancingWallet -> Ordering) -> (BalancingWallet -> BalancingWallet -> Bool) @@ -329,7 +329,7 @@ compare :: BalancingWallet -> BalancingWallet -> Ordering $ccompare :: BalancingWallet -> BalancingWallet -> Ordering $cp1Ord :: Eq BalancingWallet -Ord, Int -> BalancingWallet -> ShowS +Ord, Int -> BalancingWallet -> ShowS [BalancingWallet] -> ShowS BalancingWallet -> String (Int -> BalancingWallet -> ShowS) @@ -347,8 +347,8 @@ Show) instance Default BalancingWallet where - def :: BalancingWallet -def = BalancingWallet + def :: BalancingWallet +def = BalancingWallet BalanceWithFirstSigner -- | Wraps a function that will be applied to a transaction right before @@ -360,16 +360,16 @@ -- This instance always returns @False@, which is no problem, because 'Eq -- TxSkel' is only used for tests that never depend on this comparison -instance Eq RawModTx where +instance Eq RawModTx where RawModTx -_ == :: RawModTx -> RawModTx -> Bool +_ == :: RawModTx -> RawModTx -> Bool == RawModTx _ = Bool False -instance Show RawModTx where - show :: RawModTx -> String -show (RawModTxAfterBalancing Tx BabbageEra -> Tx BabbageEra +instance Show RawModTx where + show :: RawModTx -> String +show (RawModTxAfterBalancing Tx BabbageEra -> Tx BabbageEra _) = String "RawModTxAfterBalancing" @@ -380,17 +380,17 @@ applyRawModOnBalancedTx [] = Tx BabbageEra -> Tx BabbageEra forall a. a -> a id -applyRawModOnBalancedTx (RawModTxAfterBalancing Tx BabbageEra -> Tx BabbageEra -f : [RawModTx] -fs) = [RawModTx] -> Tx BabbageEra -> Tx BabbageEra +applyRawModOnBalancedTx (RawModTxAfterBalancing Tx BabbageEra -> Tx BabbageEra +f : [RawModTx] +fs) = [RawModTx] -> Tx BabbageEra -> Tx BabbageEra applyRawModOnBalancedTx [RawModTx] -fs (Tx BabbageEra -> Tx BabbageEra) +fs (Tx BabbageEra -> Tx BabbageEra) -> (Tx BabbageEra -> Tx BabbageEra) -> Tx BabbageEra -> Tx BabbageEra forall b c a. (b -> c) -> (a -> b) -> a -> c . Tx BabbageEra -> Tx BabbageEra -f +f -- | Wraps a function that will temporarily change the emulator parameters for -- the transaction's balancing and submission. @@ -398,23 +398,23 @@ -- This instance always returns @False@, which is no problem, because 'Eq -- TxSkel' is only used for tests that never depend on this comparison -instance Eq EmulatorParamsModification where +instance Eq EmulatorParamsModification where EmulatorParamsModification -_ == :: EmulatorParamsModification -> EmulatorParamsModification -> Bool +_ == :: EmulatorParamsModification -> EmulatorParamsModification -> Bool == EmulatorParamsModification _ = Bool False -instance Show EmulatorParamsModification where - show :: EmulatorParamsModification -> String -show EmulatorParamsModification {} = String +instance Show EmulatorParamsModification where + show :: EmulatorParamsModification -> String +show EmulatorParamsModification {} = String "EmulatorParamsModification <function>" applyEmulatorParamsModification :: Maybe EmulatorParamsModification -> Emulator.Params -> Emulator.Params applyEmulatorParamsModification :: Maybe EmulatorParamsModification -> Params -> Params -applyEmulatorParamsModification (Just (EmulatorParamsModification Params -> Params -f)) = Params -> Params -f +applyEmulatorParamsModification (Just (EmulatorParamsModification Params -> Params +f)) = Params -> Params +f applyEmulatorParamsModification Maybe EmulatorParamsModification Nothing = Params -> Params forall a. a -> a @@ -430,7 +430,7 @@ BalancingUtxosAllowlist [Pl2.TxOutRef] | -- | Do not use the provided UTxOs BalancingUtxosBlocklist [Pl2.TxOutRef] - deriving (BalancingUtxos -> BalancingUtxos -> Bool + deriving (BalancingUtxos -> BalancingUtxos -> Bool (BalancingUtxos -> BalancingUtxos -> Bool) -> (BalancingUtxos -> BalancingUtxos -> Bool) -> Eq BalancingUtxos forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a @@ -438,7 +438,7 @@ $c/= :: BalancingUtxos -> BalancingUtxos -> Bool == :: BalancingUtxos -> BalancingUtxos -> Bool $c== :: BalancingUtxos -> BalancingUtxos -> Bool -Eq, Eq BalancingUtxos +Eq, Eq BalancingUtxos Eq BalancingUtxos -> (BalancingUtxos -> BalancingUtxos -> Ordering) -> (BalancingUtxos -> BalancingUtxos -> Bool) @@ -476,7 +476,7 @@ compare :: BalancingUtxos -> BalancingUtxos -> Ordering $ccompare :: BalancingUtxos -> BalancingUtxos -> Ordering $cp1Ord :: Eq BalancingUtxos -Ord, Int -> BalancingUtxos -> ShowS +Ord, Int -> BalancingUtxos -> ShowS [BalancingUtxos] -> ShowS BalancingUtxos -> String (Int -> BalancingUtxos -> ShowS) @@ -494,8 +494,8 @@ Show) instance Default BalancingUtxos where - def :: BalancingUtxos -def = BalancingUtxos + def :: BalancingUtxos +def = BalancingUtxos BalancingUtxosAll -- | Set of options to modify the behavior of generating and validating some transaction. @@ -583,7 +583,7 @@ TxOpts -> Maybe EmulatorParamsModification txOptEmulatorParamsModification :: Maybe EmulatorParamsModification } - deriving (TxOpts -> TxOpts -> Bool + deriving (TxOpts -> TxOpts -> Bool (TxOpts -> TxOpts -> Bool) -> (TxOpts -> TxOpts -> Bool) -> Eq TxOpts forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a @@ -591,7 +591,7 @@ $c/= :: TxOpts -> TxOpts -> Bool == :: TxOpts -> TxOpts -> Bool $c== :: TxOpts -> TxOpts -> Bool -Eq, Int -> TxOpts -> ShowS +Eq, Int -> TxOpts -> ShowS [TxOpts] -> ShowS TxOpts -> String (Int -> TxOpts -> ShowS) @@ -620,8 +620,8 @@ ''TxOpts instance Default TxOpts where - def :: TxOpts -def = + def :: TxOpts +def = TxOpts :: Bool -> Bool -> Bool @@ -667,52 +667,52 @@ -- * Description of the Minting -type MintsConstrs redeemer = - ( Pl.ToData redeemer, - Show redeemer, - PrettyCooked redeemer, - Typeable redeemer +type MintsConstrs redeemer = + ( Pl.ToData redeemer, + Show redeemer, + PrettyCooked redeemer, + Typeable redeemer ) -- | Which redeemer to use for minting. Note that using 'NoMintsRedeemer' -- corresponds to the redeemer @()@ on-chain. data MintsRedeemer where NoMintsRedeemer :: MintsRedeemer - SomeMintsRedeemer :: MintsConstrs redeemer => redeemer -> MintsRedeemer + SomeMintsRedeemer :: MintsConstrs redeemer => redeemer -> MintsRedeemer -instance Show MintsRedeemer where - show :: MintsRedeemer -> String -show MintsRedeemer +instance Show MintsRedeemer where + show :: MintsRedeemer -> String +show MintsRedeemer NoMintsRedeemer = String "NoMintsRedeemer" - show (SomeMintsRedeemer redeemer -x) = String + show (SomeMintsRedeemer redeemer +x) = String "(SomeMintsRedeemer " String -> ShowS forall a. [a] -> [a] -> [a] ++ redeemer -> String forall a. Show a => a -> String show redeemer -x String -> ShowS +x String -> ShowS forall a. [a] -> [a] -> [a] ++ String ")" -instance Eq MintsRedeemer where - MintsRedeemer -a == :: MintsRedeemer -> MintsRedeemer -> Bool -== MintsRedeemer -b = MintsRedeemer -> MintsRedeemer -> Ordering +instance Eq MintsRedeemer where + MintsRedeemer +a == :: MintsRedeemer -> MintsRedeemer -> Bool +== MintsRedeemer +b = MintsRedeemer -> MintsRedeemer -> Ordering forall a. Ord a => a -> a -> Ordering compare MintsRedeemer -a MintsRedeemer -b Ordering -> Ordering -> Bool +a MintsRedeemer +b Ordering -> Ordering -> Bool forall a. Eq a => a -> a -> Bool == Ordering EQ -instance Ord MintsRedeemer where - compare :: MintsRedeemer -> MintsRedeemer -> Ordering -compare MintsRedeemer +instance Ord MintsRedeemer where + compare :: MintsRedeemer -> MintsRedeemer -> Ordering +compare MintsRedeemer NoMintsRedeemer MintsRedeemer NoMintsRedeemer = Ordering EQ @@ -722,9 +722,9 @@ compare SomeMintsRedeemer {} MintsRedeemer NoMintsRedeemer = Ordering GT - compare (SomeMintsRedeemer redeemer -a) (SomeMintsRedeemer redeemer -b) = + compare (SomeMintsRedeemer redeemer +a) (SomeMintsRedeemer redeemer +b) = case SomeTypeRep -> SomeTypeRep -> Ordering forall a. Ord a => a -> a -> Ordering compare (TypeRep redeemer -> SomeTypeRep @@ -735,7 +735,7 @@ $ redeemer -> TypeRep redeemer forall a. Typeable a => a -> TypeRep a typeOf redeemer -a) (TypeRep redeemer -> SomeTypeRep +a) (TypeRep redeemer -> SomeTypeRep forall k (a :: k). TypeRep a -> SomeTypeRep SomeTypeRep (TypeRep redeemer -> SomeTypeRep) -> TypeRep redeemer -> SomeTypeRep @@ -743,7 +743,7 @@ $ redeemer -> TypeRep redeemer forall a. Typeable a => a -> TypeRep a typeOf redeemer -b) of +b) of Ordering LT -> Ordering LT @@ -754,24 +754,24 @@ EQ -> case redeemer -> TypeRep redeemer forall a. Typeable a => a -> TypeRep a typeOf redeemer -a TypeRep redeemer +a TypeRep redeemer -> TypeRep redeemer -> Maybe (redeemer :~~: redeemer) forall k1 k2 (a :: k1) (b :: k2). TypeRep a -> TypeRep b -> Maybe (a :~~: b) `eqTypeRep` redeemer -> TypeRep redeemer forall a. Typeable a => a -> TypeRep a typeOf redeemer -b of +b of Just redeemer :~~: redeemer HRefl -> Data -> Data -> Ordering forall a. Ord a => a -> a -> Ordering compare (redeemer -> Data forall a. ToData a => a -> Data Pl.toData redeemer -a) (redeemer -> Data +a) (redeemer -> Data forall a. ToData a => a -> Data Pl.toData redeemer -b) +b) Maybe (redeemer :~~: redeemer) Nothing -> String -> Ordering forall a. HasCallStack => String -> a @@ -802,11 +802,11 @@ -- -- In every case, if you add mints with a different redeemer for the same -- policy, the redeemer used in the right argument takes precedence. -instance {-# OVERLAPPING #-} Semigroup TxSkelMints where - TxSkelMints -a <> :: TxSkelMints -> TxSkelMints -> TxSkelMints -<> TxSkelMints -b = +instance {-# OVERLAPPING #-} Semigroup TxSkelMints where + TxSkelMints +a <> :: TxSkelMints -> TxSkelMints -> TxSkelMints +<> TxSkelMints +b = (TxSkelMints -> (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> TxSkelMints) @@ -827,14 +827,14 @@ -> TxSkelMints -> TxSkelMints addToTxSkelMints) TxSkelMints -a +a (TxSkelMints -> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] txSkelMintsToList TxSkelMints -b) +b) -instance {-# OVERLAPPING #-} Monoid TxSkelMints where - mempty :: TxSkelMints +instance {-# OVERLAPPING #-} Monoid TxSkelMints where + mempty :: TxSkelMints mempty = TxSkelMints forall k a. Map k a Map.empty @@ -870,26 +870,26 @@ TxSkelMints addToTxSkelMints :: (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> TxSkelMints -> TxSkelMints -addToTxSkelMints (Versioned MintingPolicy -pol, MintsRedeemer -red, TokenName -tName, Integer -amount) TxSkelMints -mints +addToTxSkelMints (Versioned MintingPolicy +pol, MintsRedeemer +red, TokenName +tName, Integer +amount) TxSkelMints +mints | Integer 0 Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool == Integer -amount = TxSkelMints -mints +amount = TxSkelMints +mints | Bool otherwise = case TxSkelMints -mints TxSkelMints +mints TxSkelMints -> Versioned MintingPolicy -> Maybe (MintsRedeemer, NEMap TokenName (NonZero Integer)) forall k a. Ord k => Map k a -> k -> Maybe a Map.!? Versioned MintingPolicy -pol of +pol of Maybe (MintsRedeemer, NEMap TokenName (NonZero Integer)) Nothing -> -- The policy isn't yet in the given 'TxSkelMints', so we can just add a @@ -900,26 +900,26 @@ -> TxSkelMints forall k a. Ord k => k -> a -> Map k a -> Map k a Map.insert Versioned MintingPolicy -pol (MintsRedeemer -red, TokenName -> NonZero Integer -> NEMap TokenName (NonZero Integer) +pol (MintsRedeemer +red, TokenName -> NonZero Integer -> NEMap TokenName (NonZero Integer) forall k a. k -> a -> NEMap k a NEMap.singleton TokenName -tName (Integer -> NonZero Integer +tName (Integer -> NonZero Integer forall a. a -> NonZero a NonZero Integer -amount)) TxSkelMints -mints - Just (MintsRedeemer -_oldRed, NEMap TokenName (NonZero Integer) -innerMap) -> +amount)) TxSkelMints +mints + Just (MintsRedeemer +_oldRed, NEMap TokenName (NonZero Integer) +innerMap) -> -- Ignore the old redeemer: If it's the same as the new one, nothing will -- change, if not, the new redeemer will be kept. case NEMap TokenName (NonZero Integer) -innerMap NEMap TokenName (NonZero Integer) +innerMap NEMap TokenName (NonZero Integer) -> TokenName -> Maybe (NonZero Integer) forall k a. Ord k => NEMap k a -> k -> Maybe a NEMap.!? TokenName -tName of +tName of Maybe (NonZero Integer) Nothing -> -- The given token name has not yet occurred for the given @@ -931,29 +931,29 @@ -> TxSkelMints forall k a. Ord k => k -> a -> Map k a -> Map k a Map.insert Versioned MintingPolicy -pol (MintsRedeemer -red, TokenName +pol (MintsRedeemer +red, TokenName -> NonZero Integer -> NEMap TokenName (NonZero Integer) -> NEMap TokenName (NonZero Integer) forall k a. Ord k => k -> a -> NEMap k a -> NEMap k a NEMap.insert TokenName -tName (Integer -> NonZero Integer +tName (Integer -> NonZero Integer forall a. a -> NonZero a NonZero Integer -amount) NEMap TokenName (NonZero Integer) -innerMap) TxSkelMints -mints - Just (NonZero Integer -oldAmount) -> - let newAmount :: Integer -newAmount = Integer -oldAmount Integer -> Integer -> Integer +amount) NEMap TokenName (NonZero Integer) +innerMap) TxSkelMints +mints + Just (NonZero Integer +oldAmount) -> + let newAmount :: Integer +newAmount = Integer +oldAmount Integer -> Integer -> Integer forall a. Num a => a -> a -> a + Integer -amount +amount in if Integer -newAmount Integer -> Integer -> Bool +newAmount Integer -> Integer -> Bool forall a. Eq a => a -> a -> Bool /= Integer 0 @@ -966,19 +966,19 @@ -> TxSkelMints forall k a. Ord k => k -> a -> Map k a -> Map k a Map.insert Versioned MintingPolicy -pol (MintsRedeemer -red, TokenName +pol (MintsRedeemer +red, TokenName -> NonZero Integer -> NEMap TokenName (NonZero Integer) -> NEMap TokenName (NonZero Integer) forall k a. Ord k => k -> a -> NEMap k a -> NEMap k a NEMap.insert TokenName -tName (Integer -> NonZero Integer +tName (Integer -> NonZero Integer forall a. a -> NonZero a NonZero Integer -newAmount) NEMap TokenName (NonZero Integer) -innerMap) TxSkelMints -mints +newAmount) NEMap TokenName (NonZero Integer) +innerMap) TxSkelMints +mints else -- If the sum is zero, we'll have to delete the token name -- from the inner map. If that yields a completely empty -- inner map, we'll have to remove the entry altogether: @@ -995,25 +995,25 @@ -> Map TokenName (NonZero Integer) forall k a. Ord k => k -> NEMap k a -> Map k a NEMap.delete TokenName -tName NEMap TokenName (NonZero Integer) -innerMap of +tName NEMap TokenName (NonZero Integer) +innerMap of Maybe (NEMap TokenName (NonZero Integer)) Nothing -> Versioned MintingPolicy -> TxSkelMints -> TxSkelMints forall k a. Ord k => k -> Map k a -> Map k a Map.delete Versioned MintingPolicy -pol TxSkelMints -mints - Just NEMap TokenName (NonZero Integer) -newInnerMap -> Versioned MintingPolicy +pol TxSkelMints +mints + Just NEMap TokenName (NonZero Integer) +newInnerMap -> Versioned MintingPolicy -> (MintsRedeemer, NEMap TokenName (NonZero Integer)) -> TxSkelMints -> TxSkelMints forall k a. Ord k => k -> a -> Map k a -> Map k a Map.insert Versioned MintingPolicy -pol (MintsRedeemer -red, NEMap TokenName (NonZero Integer) -newInnerMap) TxSkelMints -mints +pol (MintsRedeemer +red, NEMap TokenName (NonZero Integer) +newInnerMap) TxSkelMints +mints -- | Convert from 'TxSkelMints' to a list of tuples describing eveything that's -- being minted. @@ -1029,17 +1029,17 @@ -> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b] concatMap - ( \(Versioned MintingPolicy -p, (MintsRedeemer -r, NEMap TokenName (NonZero Integer) -m)) -> - (\(TokenName -t, NonZero Integer -n) -> (Versioned MintingPolicy -p, MintsRedeemer -r, TokenName -t, Integer -n)) + ( \(Versioned MintingPolicy +p, (MintsRedeemer +r, NEMap TokenName (NonZero Integer) +m)) -> + (\(TokenName +t, NonZero Integer +n) -> (Versioned MintingPolicy +p, MintsRedeemer +r, TokenName +t, Integer +n)) ((TokenName, NonZero Integer) -> (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)) -> [(TokenName, NonZero Integer)] @@ -1052,7 +1052,7 @@ -> NonEmpty (TokenName, NonZero Integer) forall k a. NEMap k a -> NonEmpty (k, a) NEMap.toList NEMap TokenName (NonZero Integer) -m) +m) ) ([(Versioned MintingPolicy, (MintsRedeemer, NEMap TokenName (NonZero Integer)))] @@ -1143,39 +1143,39 @@ (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) forall (f :: * -> *) a. Foldable f => Fold (f a) a folded) - ( \(Versioned MintingPolicy -policy, MintsRedeemer -_, TokenName -tName, Integer -amount) -> + ( \(Versioned MintingPolicy +policy, MintsRedeemer +_, TokenName +tName, Integer +amount) -> AssetClass -> Integer -> Value Pl.assetClassValue ( CurrencySymbol -> TokenName -> AssetClass Pl.assetClass (Versioned MintingPolicy -> CurrencySymbol Pl.scriptCurrencySymbol Versioned MintingPolicy -policy) +policy) TokenName -tName +tName ) Integer -amount +amount ) -- * Transaction outputs -class IsTxSkelOutAllowedOwner a where - toPKHOrValidator :: a -> Either Pl.PubKeyHash (Pl.Versioned Pl.Validator) +class IsTxSkelOutAllowedOwner a where + toPKHOrValidator :: a -> Either Pl.PubKeyHash (Pl.Versioned Pl.Validator) instance IsTxSkelOutAllowedOwner Pl.PubKeyHash where - toPKHOrValidator :: PubKeyHash -> Either PubKeyHash (Versioned Validator) -toPKHOrValidator = PubKeyHash -> Either PubKeyHash (Versioned Validator) + toPKHOrValidator :: PubKeyHash -> Either PubKeyHash (Versioned Validator) +toPKHOrValidator = PubKeyHash -> Either PubKeyHash (Versioned Validator) forall a b. a -> Either a b Left -instance IsTxSkelOutAllowedOwner (Pl.TypedValidator a) where - toPKHOrValidator :: TypedValidator a -> Either PubKeyHash (Versioned Validator) -toPKHOrValidator = Versioned Validator -> Either PubKeyHash (Versioned Validator) +instance IsTxSkelOutAllowedOwner (Pl.TypedValidator a) where + toPKHOrValidator :: TypedValidator a -> Either PubKeyHash (Versioned Validator) +toPKHOrValidator = Versioned Validator -> Either PubKeyHash (Versioned Validator) forall a b. b -> Either a b Right (Versioned Validator -> Either PubKeyHash (Versioned Validator)) -> (TypedValidator a -> Versioned Validator) @@ -1190,53 +1190,53 @@ -- probably want to use one of the smart constructors like 'paysScript' or -- 'paysPK' in most cases. data TxSkelOut where - Pays :: - ( Show o, -- This is needed only for the 'Show' instance of 'TxSkel', which in turn is only needed in tests. - Typeable o, - IsTxInfoOutput o, - IsTxSkelOutAllowedOwner (OwnerType o), - Typeable (OwnerType o), - ToCredential (OwnerType o), - DatumType o ~ TxSkelOutDatum, - ValueType o ~ Pl.Value, -- needed for the 'txSkelOutValueL' - ToScript (ReferenceScriptType o), - Show (OwnerType o), - Show (ReferenceScriptType o), - Typeable (ReferenceScriptType o) + Pays :: + ( Show o, -- This is needed only for the 'Show' instance of 'TxSkel', which in turn is only needed in tests. + Typeable o, + IsTxInfoOutput o, + IsTxSkelOutAllowedOwner (OwnerType o), + Typeable (OwnerType o), + ToCredential (OwnerType o), + DatumType o ~ TxSkelOutDatum, + ValueType o ~ Pl.Value, -- needed for the 'txSkelOutValueL' + ToScript (ReferenceScriptType o), + Show (OwnerType o), + Show (ReferenceScriptType o), + Typeable (ReferenceScriptType o) ) => {() -producedOutput :: o} -> +producedOutput :: o} -> TxSkelOut -instance Eq TxSkelOut where - Pays o -a == :: TxSkelOut -> TxSkelOut -> Bool -== Pays o -b = case o -> TypeRep o +instance Eq TxSkelOut where + Pays o +a == :: TxSkelOut -> TxSkelOut -> Bool +== Pays o +b = case o -> TypeRep o forall a. Typeable a => a -> TypeRep a typeOf o -a TypeRep o -> TypeRep o -> Maybe (o :~~: o) +a TypeRep o -> TypeRep o -> Maybe (o :~~: o) forall k1 k2 (a :: k1) (b :: k2). TypeRep a -> TypeRep b -> Maybe (a :~~: b) `eqTypeRep` o -> TypeRep o forall a. Typeable a => a -> TypeRep a typeOf o -b of +b of Just o :~~: o HRefl -> o -> TxOut forall o. IsTxInfoOutput o => o -> TxOut outputTxOut o -a TxOut -> TxOut -> Bool +a TxOut -> TxOut -> Bool forall a. Eq a => a -> a -> Bool == o -> TxOut forall o. IsTxInfoOutput o => o -> TxOut outputTxOut o -b +b Maybe (o :~~: o) Nothing -> Bool False -deriving instance Show TxSkelOut +deriving instance Show TxSkelOut txSkelOutDatumL :: Lens' TxSkelOut TxSkelOutDatum txSkelOutDatumL :: Lens' TxSkelOut TxSkelOutDatum @@ -1246,18 +1246,18 @@ -> Lens' TxSkelOut TxSkelOutDatum forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b lens - (\(Pays o -output) -> o -output o -> Optic' A_Lens '[] o TxSkelOutDatum -> TxSkelOutDatum + (\(Pays o +output) -> o +output o -> Optic' A_Lens '[] o TxSkelOutDatum -> TxSkelOutDatum forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a ^. Optic' A_Lens '[] o TxSkelOutDatum forall o. IsAbstractOutput o => Lens' o (DatumType o) outputDatumL) - (\(Pays o -output) TxSkelOutDatum -newDatum -> o -> TxSkelOut + (\(Pays o +output) TxSkelOutDatum +newDatum -> o -> TxSkelOut forall o. (Show o, Typeable o, IsTxInfoOutput o, IsTxSkelOutAllowedOwner (OwnerType o), Typeable (OwnerType o), @@ -1269,7 +1269,7 @@ Pays (o -> TxSkelOut) -> o -> TxSkelOut forall a b. (a -> b) -> a -> b $ o -output o -> (o -> o) -> o +output o -> (o -> o) -> o forall a b. a -> (a -> b) -> b & Optic A_Lens '[] o o TxSkelOutDatum TxSkelOutDatum forall o. IsAbstractOutput o => Lens' o (DatumType o) @@ -1279,7 +1279,7 @@ Is k A_Setter => Optic k is s t a b -> b -> s -> t .~ TxSkelOutDatum -newDatum) +newDatum) txSkelOutValueL :: Lens' TxSkelOut Pl.Value txSkelOutValueL :: Lens' TxSkelOut Value @@ -1288,14 +1288,14 @@ -> (TxSkelOut -> Value -> TxSkelOut) -> Lens' TxSkelOut Value forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b lens - (\(Pays o -output) -> o -> Value + (\(Pays o +output) -> o -> Value forall o. (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value outputValue o -output) - (\(Pays o -output) Value -newValue -> o -> TxSkelOut +output) + (\(Pays o +output) Value +newValue -> o -> TxSkelOut forall o. (Show o, Typeable o, IsTxInfoOutput o, IsTxSkelOutAllowedOwner (OwnerType o), Typeable (OwnerType o), @@ -1307,7 +1307,7 @@ Pays (o -> TxSkelOut) -> o -> TxSkelOut forall a b. (a -> b) -> a -> b $ o -output o -> (o -> o) -> o +output o -> (o -> o) -> o forall a b. a -> (a -> b) -> b & Optic A_Lens '[] o o Value Value forall o. IsAbstractOutput o => Lens' o (ValueType o) @@ -1316,7 +1316,7 @@ Is k A_Setter => Optic k is s t a b -> b -> s -> t .~ Value -newValue) +newValue) txSkelOutValue :: TxSkelOut -> Pl.Value txSkelOutValue :: TxSkelOut -> Value @@ -1329,8 +1329,8 @@ txSkelOutValidator :: TxSkelOut -> Maybe (Pl.Versioned Pl.Validator) txSkelOutValidator :: TxSkelOut -> Maybe (Versioned Validator) -txSkelOutValidator (Pays o -output) = Either PubKeyHash (Versioned Validator) +txSkelOutValidator (Pays o +output) = Either PubKeyHash (Versioned Validator) -> Maybe (Versioned Validator) forall a b. Either a b -> Maybe b rightToMaybe (OwnerType o -> Either PubKeyHash (Versioned Validator) @@ -1341,7 +1341,7 @@ -> OwnerType o -> Either PubKeyHash (Versioned Validator) forall a b. (a -> b) -> a -> b $ o -output o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o +output o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -1349,7 +1349,7 @@ forall o. IsAbstractOutput o => Lens' o (OwnerType o) outputOwnerL) -type TxSkelOutDatumConstrs a = (Show a, PrettyCooked a, Pl.ToData a, Pl.Eq a, Typeable a) +type TxSkelOutDatumConstrs a = (Show a, PrettyCooked a, Pl.ToData a, Pl.Eq a, Typeable a) -- | On transaction outputs, we have the options to use -- @@ -1389,38 +1389,38 @@ -- | use no datum TxSkelOutNoDatum :: TxSkelOutDatum -- | only include the hash on the transaction - TxSkelOutDatumHash :: TxSkelOutDatumConstrs a => a -> TxSkelOutDatum + TxSkelOutDatumHash :: TxSkelOutDatumConstrs a => a -> TxSkelOutDatum -- | use a 'Pl.OutputDatumHash' on the transaction output, but generate the -- transaction in such a way that the complete datum is included in the -- 'txInfoData' seen by validators - TxSkelOutDatum :: TxSkelOutDatumConstrs a => a -> TxSkelOutDatum + TxSkelOutDatum :: TxSkelOutDatumConstrs a => a -> TxSkelOutDatum -- | use an inline datum - TxSkelOutInlineDatum :: TxSkelOutDatumConstrs a => a -> TxSkelOutDatum + TxSkelOutInlineDatum :: TxSkelOutDatumConstrs a => a -> TxSkelOutDatum -deriving instance Show TxSkelOutDatum +deriving instance Show TxSkelOutDatum -instance Eq TxSkelOutDatum where - TxSkelOutDatum -x == :: TxSkelOutDatum -> TxSkelOutDatum -> Bool -== TxSkelOutDatum -y = TxSkelOutDatum -> TxSkelOutDatum -> Ordering +instance Eq TxSkelOutDatum where + TxSkelOutDatum +x == :: TxSkelOutDatum -> TxSkelOutDatum -> Bool +== TxSkelOutDatum +y = TxSkelOutDatum -> TxSkelOutDatum -> Ordering forall a. Ord a => a -> a -> Ordering compare TxSkelOutDatum -x TxSkelOutDatum -y Ordering -> Ordering -> Bool +x TxSkelOutDatum +y Ordering -> Ordering -> Bool forall a. Eq a => a -> a -> Bool == Ordering EQ -instance Ord TxSkelOutDatum where - compare :: TxSkelOutDatum -> TxSkelOutDatum -> Ordering -compare TxSkelOutDatum +instance Ord TxSkelOutDatum where + compare :: TxSkelOutDatum -> TxSkelOutDatum -> Ordering +compare TxSkelOutDatum TxSkelOutNoDatum TxSkelOutDatum TxSkelOutNoDatum = Ordering EQ - compare (TxSkelOutDatumHash a -d1) (TxSkelOutDatumHash a -d2) = + compare (TxSkelOutDatumHash a +d1) (TxSkelOutDatumHash a +d2) = case SomeTypeRep -> SomeTypeRep -> Ordering forall a. Ord a => a -> a -> Ordering compare (TypeRep a -> SomeTypeRep @@ -1428,12 +1428,12 @@ SomeTypeRep (a -> TypeRep a forall a. Typeable a => a -> TypeRep a typeOf a -d1)) (TypeRep a -> SomeTypeRep +d1)) (TypeRep a -> SomeTypeRep forall k (a :: k). TypeRep a -> SomeTypeRep SomeTypeRep (a -> TypeRep a forall a. Typeable a => a -> TypeRep a typeOf a -d2)) of +d2)) of Ordering LT -> Ordering LT @@ -1444,52 +1444,52 @@ EQ -> case a -> TypeRep a forall a. Typeable a => a -> TypeRep a typeOf a -d1 TypeRep a -> TypeRep a -> Maybe (a :~~: a) +d1 TypeRep a -> TypeRep a -> Maybe (a :~~: a) forall k1 k2 (a :: k1) (b :: k2). TypeRep a -> TypeRep b -> Maybe (a :~~: b) `eqTypeRep` a -> TypeRep a forall a. Typeable a => a -> TypeRep a typeOf a -d2 of +d2 of Just a :~~: a HRefl -> BuiltinData -> BuiltinData -> Ordering forall a. Ord a => a -> a -> Ordering compare (a -> BuiltinData forall a. ToData a => a -> BuiltinData Pl.toBuiltinData a -d1) (a -> BuiltinData +d1) (a -> BuiltinData forall a. ToData a => a -> BuiltinData Pl.toBuiltinData a -d2) +d2) Maybe (a :~~: a) Nothing -> String -> Ordering forall a. HasCallStack => String -> a error String "This branch cannot happen: un-equal type representations that compare to EQ" - compare (TxSkelOutDatum a -d1) (TxSkelOutDatum a -d2) = + compare (TxSkelOutDatum a +d1) (TxSkelOutDatum a +d2) = TxSkelOutDatum -> TxSkelOutDatum -> Ordering forall a. Ord a => a -> a -> Ordering compare (a -> TxSkelOutDatum forall a. TxSkelOutDatumConstrs a => a -> TxSkelOutDatum TxSkelOutDatumHash a -d1) (a -> TxSkelOutDatum +d1) (a -> TxSkelOutDatum forall a. TxSkelOutDatumConstrs a => a -> TxSkelOutDatum TxSkelOutDatumHash a -d2) - compare (TxSkelOutInlineDatum a -d1) (TxSkelOutInlineDatum a -d2) = +d2) + compare (TxSkelOutInlineDatum a +d1) (TxSkelOutInlineDatum a +d2) = TxSkelOutDatum -> TxSkelOutDatum -> Ordering forall a. Ord a => a -> a -> Ordering compare (a -> TxSkelOutDatum forall a. TxSkelOutDatumConstrs a => a -> TxSkelOutDatum TxSkelOutDatumHash a -d1) (a -> TxSkelOutDatum +d1) (a -> TxSkelOutDatum forall a. TxSkelOutDatumConstrs a => a -> TxSkelOutDatum TxSkelOutDatumHash a -d2) +d2) compare TxSkelOutDatumHash {} TxSkelOutDatum TxSkelOutNoDatum = Ordering GT @@ -1507,12 +1507,12 @@ LT instance ToOutputDatum TxSkelOutDatum where - toOutputDatum :: TxSkelOutDatum -> OutputDatum + toOutputDatum :: TxSkelOutDatum -> OutputDatum toOutputDatum TxSkelOutDatum TxSkelOutNoDatum = OutputDatum Pl.NoOutputDatum - toOutputDatum (TxSkelOutDatumHash a -datum) = DatumHash -> OutputDatum + toOutputDatum (TxSkelOutDatumHash a +datum) = DatumHash -> OutputDatum Pl.OutputDatumHash (DatumHash -> OutputDatum) -> (a -> DatumHash) -> a -> OutputDatum forall b c a. (b -> c) -> (a -> b) -> a -> c . Datum -> DatumHash @@ -1526,9 +1526,9 @@ Pl.toBuiltinData (a -> OutputDatum) -> a -> OutputDatum forall a b. (a -> b) -> a -> b $ a -datum - toOutputDatum (TxSkelOutDatum a -datum) = DatumHash -> OutputDatum +datum + toOutputDatum (TxSkelOutDatum a +datum) = DatumHash -> OutputDatum Pl.OutputDatumHash (DatumHash -> OutputDatum) -> (a -> DatumHash) -> a -> OutputDatum forall b c a. (b -> c) -> (a -> b) -> a -> c . Datum -> DatumHash @@ -1542,9 +1542,9 @@ Pl.toBuiltinData (a -> OutputDatum) -> a -> OutputDatum forall a b. (a -> b) -> a -> b $ a -datum - toOutputDatum (TxSkelOutInlineDatum a -datum) = Datum -> OutputDatum +datum + toOutputDatum (TxSkelOutInlineDatum a +datum) = Datum -> OutputDatum Pl.OutputDatum (Datum -> OutputDatum) -> (a -> Datum) -> a -> OutputDatum forall b c a. (b -> c) -> (a -> b) -> a -> c . BuiltinData -> Datum @@ -1555,7 +1555,7 @@ Pl.toBuiltinData (a -> OutputDatum) -> a -> OutputDatum forall a b. (a -> b) -> a -> b $ a -datum +datum txSkelOutUntypedDatum :: TxSkelOutDatum -> Maybe Pl.Datum txSkelOutUntypedDatum :: TxSkelOutDatum -> Maybe Datum @@ -1564,8 +1564,8 @@ TxSkelOutNoDatum -> Maybe Datum forall a. Maybe a Nothing - TxSkelOutDatumHash a -x -> Datum -> Maybe Datum + TxSkelOutDatumHash a +x -> Datum -> Maybe Datum forall a. a -> Maybe a Just (BuiltinData -> Datum Pl.Datum (BuiltinData -> Datum) -> BuiltinData -> Datum @@ -1573,9 +1573,9 @@ $ a -> BuiltinData forall a. ToData a => a -> BuiltinData Pl.toBuiltinData a -x) - TxSkelOutDatum a -x -> Datum -> Maybe Datum +x) + TxSkelOutDatum a +x -> Datum -> Maybe Datum forall a. a -> Maybe a Just (BuiltinData -> Datum Pl.Datum (BuiltinData -> Datum) -> BuiltinData -> Datum @@ -1583,9 +1583,9 @@ $ a -> BuiltinData forall a. ToData a => a -> BuiltinData Pl.toBuiltinData a -x) - TxSkelOutInlineDatum a -x -> Datum -> Maybe Datum +x) + TxSkelOutInlineDatum a +x -> Datum -> Maybe Datum forall a. a -> Maybe a Just (BuiltinData -> Datum Pl.Datum (BuiltinData -> Datum) -> BuiltinData -> Datum @@ -1593,9 +1593,9 @@ $ a -> BuiltinData forall a. ToData a => a -> BuiltinData Pl.toBuiltinData a -x) +x) -txSkelOutTypedDatum :: Pl.FromData a => TxSkelOutDatum -> Maybe a +txSkelOutTypedDatum :: Pl.FromData a => TxSkelOutDatum -> Maybe a txSkelOutTypedDatum :: TxSkelOutDatum -> Maybe a txSkelOutTypedDatum = BuiltinData -> Maybe a forall a. FromData a => BuiltinData -> Maybe a @@ -1616,9 +1616,9 @@ -- | Pay a certain value to a public key. paysPK :: Pl.PubKeyHash -> Pl.Value -> TxSkelOut paysPK :: PubKeyHash -> Value -> TxSkelOut -paysPK PubKeyHash -pkh Value -value = +paysPK PubKeyHash +pkh Value +value = ConcreteOutput PubKeyHash TxSkelOutDatum Value (Versioned Script) -> TxSkelOut forall o. @@ -1646,12 +1646,12 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput PubKeyHash -pkh +pkh Maybe StakingCredential forall a. Maybe a Nothing Value -value +value TxSkelOutDatum TxSkelOutNoDatum (Maybe (Versioned Script) @@ -1661,23 +1661,23 @@ -- | Pays a script a certain value with a certain datum, using the -- 'TxSkelOutDatum' constructor. (See the documentation of 'TxSkelOutDatum'.) -paysScript :: - ( Pl.ToData (Pl.DatumType a), - Show (Pl.DatumType a), - Typeable (Pl.DatumType a), - Pl.Eq (Pl.DatumType a), - PrettyCooked (Pl.DatumType a), - Typeable a +paysScript :: + ( Pl.ToData (Pl.DatumType a), + Show (Pl.DatumType a), + Typeable (Pl.DatumType a), + Pl.Eq (Pl.DatumType a), + PrettyCooked (Pl.DatumType a), + Typeable a ) => - Pl.TypedValidator a -> - Pl.DatumType a -> + Pl.TypedValidator a -> + Pl.DatumType a -> Pl.Value -> TxSkelOut paysScript :: TypedValidator a -> DatumType a -> Value -> TxSkelOut -paysScript TypedValidator a -validator DatumType a -datum Value -value = +paysScript TypedValidator a +validator DatumType a +datum Value +value = ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -> TxSkelOut @@ -1706,39 +1706,39 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput TypedValidator a -validator +validator Maybe StakingCredential forall a. Maybe a Nothing Value -value +value (DatumType a -> TxSkelOutDatum forall a. TxSkelOutDatumConstrs a => a -> TxSkelOutDatum TxSkelOutDatum DatumType a -datum) +datum) (Maybe (Versioned Script) forall a. Maybe a Nothing @(Pl.Versioned Pl.Script)) ) -- | Pays a script a certain value with a certain inlined datum. -paysScriptInlineDatum :: - ( Pl.ToData (Pl.DatumType a), - Show (Pl.DatumType a), - Typeable (Pl.DatumType a), - Pl.Eq (Pl.DatumType a), - PrettyCooked (Pl.DatumType a), - Typeable a +paysScriptInlineDatum :: + ( Pl.ToData (Pl.DatumType a), + Show (Pl.DatumType a), + Typeable (Pl.DatumType a), + Pl.Eq (Pl.DatumType a), + PrettyCooked (Pl.DatumType a), + Typeable a ) => - Pl.TypedValidator a -> - Pl.DatumType a -> + Pl.TypedValidator a -> + Pl.DatumType a -> Pl.Value -> TxSkelOut paysScriptInlineDatum :: TypedValidator a -> DatumType a -> Value -> TxSkelOut -paysScriptInlineDatum TypedValidator a -validator DatumType a -datum Value -value = +paysScriptInlineDatum TypedValidator a +validator DatumType a +datum Value +value = ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -> TxSkelOut @@ -1767,16 +1767,16 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput TypedValidator a -validator +validator Maybe StakingCredential forall a. Maybe a Nothing Value -value +value (DatumType a -> TxSkelOutDatum forall a. TxSkelOutDatumConstrs a => a -> TxSkelOutDatum TxSkelOutInlineDatum DatumType a -datum) +datum) (Maybe (Versioned Script) forall a. Maybe a Nothing @(Pl.Versioned Pl.Script)) @@ -1784,23 +1784,23 @@ -- | Pays a script a certain value with a certain hashed (not resolved in -- transaction) datum. -paysScriptDatumHash :: - ( Pl.ToData (Pl.DatumType a), - Show (Pl.DatumType a), - Typeable (Pl.DatumType a), - Pl.Eq (Pl.DatumType a), - PrettyCooked (Pl.DatumType a), - Typeable a +paysScriptDatumHash :: + ( Pl.ToData (Pl.DatumType a), + Show (Pl.DatumType a), + Typeable (Pl.DatumType a), + Pl.Eq (Pl.DatumType a), + PrettyCooked (Pl.DatumType a), + Typeable a ) => - Pl.TypedValidator a -> - Pl.DatumType a -> + Pl.TypedValidator a -> + Pl.DatumType a -> Pl.Value -> TxSkelOut paysScriptDatumHash :: TypedValidator a -> DatumType a -> Value -> TxSkelOut -paysScriptDatumHash TypedValidator a -validator DatumType a -datum Value -value = +paysScriptDatumHash TypedValidator a +validator DatumType a +datum Value +value = ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -> TxSkelOut @@ -1829,16 +1829,16 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput TypedValidator a -validator +validator Maybe StakingCredential forall a. Maybe a Nothing Value -value +value (DatumType a -> TxSkelOutDatum forall a. TxSkelOutDatumConstrs a => a -> TxSkelOutDatum TxSkelOutDatumHash DatumType a -datum) +datum) (Maybe (Versioned Script) forall a. Maybe a Nothing @(Pl.Versioned Pl.Script)) @@ -1847,11 +1847,11 @@ -- | Pays a script a certain value without any datum. Intended to be used with -- 'withDatum', 'withDatumHash', or 'withInlineDatum' to try a datum whose type -- does not match the validator's. -paysScriptNoDatum :: Typeable a => Pl.TypedValidator a -> Pl.Value -> TxSkelOut +paysScriptNoDatum :: Typeable a => Pl.TypedValidator a -> Pl.Value -> TxSkelOut paysScriptNoDatum :: TypedValidator a -> Value -> TxSkelOut -paysScriptNoDatum TypedValidator a -validator Value -value = +paysScriptNoDatum TypedValidator a +validator Value +value = ConcreteOutput (TypedValidator a) TxSkelOutDatum Value (Versioned Script) -> TxSkelOut @@ -1880,12 +1880,12 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput TypedValidator a -validator +validator Maybe StakingCredential forall a. Maybe a Nothing Value -value +value TxSkelOutDatum TxSkelOutNoDatum (Maybe (Versioned Script) @@ -1895,20 +1895,20 @@ -- | Set the datum in a payment to the given datum (whose type may not fit the -- typed validator in case of a script). -withDatum :: - ( Pl.ToData a, - Show a, - Typeable a, - Pl.Eq a, - PrettyCooked a +withDatum :: + ( Pl.ToData a, + Show a, + Typeable a, + Pl.Eq a, + PrettyCooked a ) => TxSkelOut -> - a -> + a -> TxSkelOut withDatum :: TxSkelOut -> a -> TxSkelOut -withDatum (Pays o -output) a -datum = +withDatum (Pays o +output) a +datum = ConcreteOutput (OwnerType o) TxSkelOutDatum Value (ReferenceScriptType o) -> TxSkelOut @@ -1944,7 +1944,7 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput (o -output o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o +output o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -1952,7 +1952,7 @@ forall o. IsAbstractOutput o => Lens' o (OwnerType o) outputOwnerL) (o -output o +output o -> Optic' A_Lens '[] o (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -1962,7 +1962,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) (o -output o -> Optic' A_Lens '[] o Value -> Value +output o -> Optic' A_Lens '[] o Value -> Value forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -1972,9 +1972,9 @@ (a -> TxSkelOutDatum forall a. TxSkelOutDatumConstrs a => a -> TxSkelOutDatum TxSkelOutDatum a -datum) +datum) (o -output o +output o -> Optic' A_Lens '[] o (Maybe (ReferenceScriptType o)) -> Maybe (ReferenceScriptType o) forall k s (is :: IxList) a. @@ -1988,20 +1988,20 @@ -- | Set the datum in a payment to the given inlined datum (whose type may not -- fit the typed validator in case of a script). -withInlineDatum :: - ( Pl.ToData a, - Show a, - Typeable a, - Pl.Eq a, - PrettyCooked a +withInlineDatum :: + ( Pl.ToData a, + Show a, + Typeable a, + Pl.Eq a, + PrettyCooked a ) => TxSkelOut -> - a -> + a -> TxSkelOut withInlineDatum :: TxSkelOut -> a -> TxSkelOut -withInlineDatum (Pays o -output) a -datum = +withInlineDatum (Pays o +output) a +datum = ConcreteOutput (OwnerType o) TxSkelOutDatum Value (ReferenceScriptType o) -> TxSkelOut @@ -2037,7 +2037,7 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput (o -output o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o +output o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -2045,7 +2045,7 @@ forall o. IsAbstractOutput o => Lens' o (OwnerType o) outputOwnerL) (o -output o +output o -> Optic' A_Lens '[] o (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -2055,7 +2055,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) (o -output o -> Optic' A_Lens '[] o Value -> Value +output o -> Optic' A_Lens '[] o Value -> Value forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -2065,9 +2065,9 @@ (a -> TxSkelOutDatum forall a. TxSkelOutDatumConstrs a => a -> TxSkelOutDatum TxSkelOutInlineDatum a -datum) +datum) (o -output o +output o -> Optic' A_Lens '[] o (Maybe (ReferenceScriptType o)) -> Maybe (ReferenceScriptType o) forall k s (is :: IxList) a. @@ -2082,20 +2082,20 @@ -- | Set the datum in a payment to the given hashed (not resolved in the -- transaction) datum (whose type may not fit the typed validator in case of a -- script). -withDatumHash :: - ( Pl.ToData a, - Show a, - Typeable a, - Pl.Eq a, - PrettyCooked a +withDatumHash :: + ( Pl.ToData a, + Show a, + Typeable a, + Pl.Eq a, + PrettyCooked a ) => TxSkelOut -> - a -> + a -> TxSkelOut withDatumHash :: TxSkelOut -> a -> TxSkelOut -withDatumHash (Pays o -output) a -datum = +withDatumHash (Pays o +output) a +datum = ConcreteOutput (OwnerType o) TxSkelOutDatum Value (ReferenceScriptType o) -> TxSkelOut @@ -2131,7 +2131,7 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput (o -output o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o +output o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -2139,7 +2139,7 @@ forall o. IsAbstractOutput o => Lens' o (OwnerType o) outputOwnerL) (o -output o +output o -> Optic' A_Lens '[] o (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -2149,7 +2149,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) (o -output o -> Optic' A_Lens '[] o Value -> Value +output o -> Optic' A_Lens '[] o Value -> Value forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -2159,9 +2159,9 @@ (a -> TxSkelOutDatum forall a. TxSkelOutDatumConstrs a => a -> TxSkelOutDatum TxSkelOutDatumHash a -datum) +datum) (o -output o +output o -> Optic' A_Lens '[] o (Maybe (ReferenceScriptType o)) -> Maybe (ReferenceScriptType o) forall k s (is :: IxList) a. @@ -2174,19 +2174,19 @@ outputReferenceScriptL) -- | Add a reference script to a transaction output (or replace it if there is already one) -withReferenceScript :: - ( Show script, - ToScript script, - Typeable script, - ToScriptHash script +withReferenceScript :: + ( Show script, + ToScript script, + Typeable script, + ToScriptHash script ) => TxSkelOut -> - script -> + script -> TxSkelOut withReferenceScript :: TxSkelOut -> script -> TxSkelOut -withReferenceScript (Pays o -output) script -script = +withReferenceScript (Pays o +output) script +script = ConcreteOutput (OwnerType o) TxSkelOutDatum Value script -> TxSkelOut forall o. @@ -2218,7 +2218,7 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput (o -output o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o +output o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -2226,7 +2226,7 @@ forall o. IsAbstractOutput o => Lens' o (OwnerType o) outputOwnerL) (o -output o +output o -> Optic' A_Lens '[] o (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -2236,7 +2236,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) (o -output o -> Optic' A_Lens '[] o Value -> Value +output o -> Optic' A_Lens '[] o Value -> Value forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -2244,7 +2244,7 @@ forall o. IsAbstractOutput o => Lens' o (ValueType o) outputValueL) (o -output o -> Optic' A_Lens '[] o TxSkelOutDatum -> TxSkelOutDatum +output o -> Optic' A_Lens '[] o TxSkelOutDatum -> TxSkelOutDatum forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -2254,14 +2254,14 @@ (script -> Maybe script forall a. a -> Maybe a Just script -script) +script) -- | Add a staking credential to a transaction output (or replace it if there is already one) withStakingCredential :: TxSkelOut -> Pl.StakingCredential -> TxSkelOut withStakingCredential :: TxSkelOut -> StakingCredential -> TxSkelOut -withStakingCredential (Pays o -output) StakingCredential -stakingCredential = +withStakingCredential (Pays o +output) StakingCredential +stakingCredential = ConcreteOutput (OwnerType o) TxSkelOutDatum Value (ReferenceScriptType o) -> TxSkelOut @@ -2297,7 +2297,7 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput (o -output o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o +output o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -2307,9 +2307,9 @@ (StakingCredential -> Maybe StakingCredential forall a. a -> Maybe a Just StakingCredential -stakingCredential) +stakingCredential) (o -output o -> Optic' A_Lens '[] o Value -> Value +output o -> Optic' A_Lens '[] o Value -> Value forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -2317,7 +2317,7 @@ forall o. IsAbstractOutput o => Lens' o (ValueType o) outputValueL) (o -output o -> Optic' A_Lens '[] o TxSkelOutDatum -> TxSkelOutDatum +output o -> Optic' A_Lens '[] o TxSkelOutDatum -> TxSkelOutDatum forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -2325,7 +2325,7 @@ forall o. IsAbstractOutput o => Lens' o (DatumType o) outputDatumL) (o -output o +output o -> Optic' A_Lens '[] o (Maybe (ReferenceScriptType o)) -> Maybe (ReferenceScriptType o) forall k s (is :: IxList) a. @@ -2339,25 +2339,25 @@ -- * Redeemers for transaction inputs -type SpendsScriptConstrs redeemer = - ( Pl.ToData redeemer, - Show redeemer, - PrettyCooked redeemer, - Pl.Eq redeemer, - Typeable redeemer +type SpendsScriptConstrs redeemer = + ( Pl.ToData redeemer, + Show redeemer, + PrettyCooked redeemer, + Pl.Eq redeemer, + Typeable redeemer ) data TxSkelRedeemer where TxSkelNoRedeemerForPK :: TxSkelRedeemer - TxSkelRedeemerForScript :: SpendsScriptConstrs redeemer => redeemer -> TxSkelRedeemer + TxSkelRedeemerForScript :: SpendsScriptConstrs redeemer => redeemer -> TxSkelRedeemer -- | The first argument is a reference to the output where the referenced -- script is stored. - TxSkelRedeemerForReferencedScript :: SpendsScriptConstrs redeemer => Pl.TxOutRef -> redeemer -> TxSkelRedeemer + TxSkelRedeemerForReferencedScript :: SpendsScriptConstrs redeemer => Pl.TxOutRef -> redeemer -> TxSkelRedeemer -txSkelTypedRedeemer :: Pl.FromData (Pl.RedeemerType a) => TxSkelRedeemer -> Maybe (Pl.RedeemerType a) +txSkelTypedRedeemer :: Pl.FromData (Pl.RedeemerType a) => TxSkelRedeemer -> Maybe (Pl.RedeemerType a) txSkelTypedRedeemer :: TxSkelRedeemer -> Maybe (RedeemerType a) -txSkelTypedRedeemer (TxSkelRedeemerForScript redeemer -redeemer) = Data -> Maybe (RedeemerType a) +txSkelTypedRedeemer (TxSkelRedeemerForScript redeemer +redeemer) = Data -> Maybe (RedeemerType a) forall a. FromData a => Data -> Maybe a Pl.fromData (Data -> Maybe (RedeemerType a)) -> (redeemer -> Data) -> redeemer -> Maybe (RedeemerType a) @@ -2368,10 +2368,10 @@ -> redeemer -> Maybe (RedeemerType a) forall a b. (a -> b) -> a -> b $ redeemer -redeemer +redeemer txSkelTypedRedeemer (TxSkelRedeemerForReferencedScript TxOutRef -_ redeemer -redeemer) = Data -> Maybe (RedeemerType a) +_ redeemer +redeemer) = Data -> Maybe (RedeemerType a) forall a. FromData a => Data -> Maybe a Pl.fromData (Data -> Maybe (RedeemerType a)) -> (redeemer -> Data) -> redeemer -> Maybe (RedeemerType a) @@ -2382,68 +2382,68 @@ -> redeemer -> Maybe (RedeemerType a) forall a b. (a -> b) -> a -> b $ redeemer -redeemer +redeemer txSkelTypedRedeemer TxSkelRedeemer _ = Maybe (RedeemerType a) forall a. Maybe a Nothing -deriving instance (Show TxSkelRedeemer) +deriving instance (Show TxSkelRedeemer) -instance Eq TxSkelRedeemer where +instance Eq TxSkelRedeemer where TxSkelRedeemer -TxSkelNoRedeemerForPK == :: TxSkelRedeemer -> TxSkelRedeemer -> Bool +TxSkelNoRedeemerForPK == :: TxSkelRedeemer -> TxSkelRedeemer -> Bool == TxSkelRedeemer TxSkelNoRedeemerForPK = Bool True - (TxSkelRedeemerForScript redeemer -r1) == (TxSkelRedeemerForScript redeemer -r2) = + (TxSkelRedeemerForScript redeemer +r1) == (TxSkelRedeemerForScript redeemer +r2) = case redeemer -> TypeRep redeemer forall a. Typeable a => a -> TypeRep a typeOf redeemer -r1 TypeRep redeemer +r1 TypeRep redeemer -> TypeRep redeemer -> Maybe (redeemer :~~: redeemer) forall k1 k2 (a :: k1) (b :: k2). TypeRep a -> TypeRep b -> Maybe (a :~~: b) `eqTypeRep` redeemer -> TypeRep redeemer forall a. Typeable a => a -> TypeRep a typeOf redeemer -r2 of +r2 of Just redeemer :~~: redeemer HRefl -> redeemer -r1 redeemer -> redeemer -> Bool +r1 redeemer -> redeemer -> Bool forall a. Eq a => a -> a -> Bool Pl.== redeemer redeemer -r2 +r2 Maybe (redeemer :~~: redeemer) Nothing -> Bool False - (TxSkelRedeemerForReferencedScript TxOutRef -o1 redeemer -r1) == (TxSkelRedeemerForReferencedScript TxOutRef -o2 redeemer -r2) = + (TxSkelRedeemerForReferencedScript TxOutRef +o1 redeemer +r1) == (TxSkelRedeemerForReferencedScript TxOutRef +o2 redeemer +r2) = redeemer -> TxSkelRedeemer forall redeemer. SpendsScriptConstrs redeemer => redeemer -> TxSkelRedeemer TxSkelRedeemerForScript redeemer -r1 TxSkelRedeemer -> TxSkelRedeemer -> Bool +r1 TxSkelRedeemer -> TxSkelRedeemer -> Bool forall a. Eq a => a -> a -> Bool == redeemer -> TxSkelRedeemer forall redeemer. SpendsScriptConstrs redeemer => redeemer -> TxSkelRedeemer TxSkelRedeemerForScript redeemer -r2 +r2 Bool -> Bool -> Bool && TxOutRef -o1 TxOutRef -> TxOutRef -> Bool +o1 TxOutRef -> TxOutRef -> Bool forall a. Eq a => a -> a -> Bool == TxOutRef -o2 +o2 TxSkelRedeemer _ == TxSkelRedeemer _ = Bool @@ -2491,7 +2491,7 @@ txSkelOuts :: [TxSkelOut] } -> TxSkel - deriving (Int -> TxSkel -> ShowS + deriving (Int -> TxSkel -> ShowS [TxSkel] -> ShowS TxSkel -> String (Int -> TxSkel -> ShowS) @@ -2504,7 +2504,7 @@ $cshow :: TxSkel -> String showsPrec :: Int -> TxSkel -> ShowS $cshowsPrec :: Int -> TxSkel -> ShowS -Show, TxSkel -> TxSkel -> Bool +Show, TxSkel -> TxSkel -> Bool (TxSkel -> TxSkel -> Bool) -> (TxSkel -> TxSkel -> Bool) -> Eq TxSkel forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a @@ -2615,8 +2615,8 @@ % Lens' TxSkelOut TxSkelOutDatum txSkelOutDatumL ) - ( \TxSkelOutDatum -txSkelOutDatum -> do + ( \TxSkelOutDatum +txSkelOutDatum -> do Map DatumHash TxSkelOutDatum -> (Datum -> Map DatumHash TxSkelOutDatum) -> Maybe Datum @@ -2626,27 +2626,27 @@ Map DatumHash TxSkelOutDatum forall k a. Map k a Map.empty - (\Datum -datum -> DatumHash -> TxSkelOutDatum -> Map DatumHash TxSkelOutDatum + (\Datum +datum -> DatumHash -> TxSkelOutDatum -> Map DatumHash TxSkelOutDatum forall k a. k -> a -> Map k a Map.singleton (Datum -> DatumHash Pl.datumHash Datum -datum) TxSkelOutDatum -txSkelOutDatum) +datum) TxSkelOutDatum +txSkelOutDatum) (TxSkelOutDatum -> Maybe Datum txSkelOutUntypedDatum TxSkelOutDatum -txSkelOutDatum) +txSkelOutDatum) ) newtype Fee = Fee {Fee -> Integer -feeLovelace :: Integer} deriving (Fee -> Fee -> Bool +feeLovelace :: Integer} deriving (Fee -> Fee -> Bool (Fee -> Fee -> Bool) -> (Fee -> Fee -> Bool) -> Eq Fee forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: Fee -> Fee -> Bool $c/= :: Fee -> Fee -> Bool == :: Fee -> Fee -> Bool $c== :: Fee -> Fee -> Bool -Eq, Eq Fee +Eq, Eq Fee Eq Fee -> (Fee -> Fee -> Ordering) -> (Fee -> Fee -> Bool) @@ -2684,7 +2684,7 @@ compare :: Fee -> Fee -> Ordering $ccompare :: Fee -> Fee -> Ordering $cp1Ord :: Eq Fee -Ord, Int -> Fee -> ShowS +Ord, Int -> Fee -> ShowS [Fee] -> ShowS Fee -> String (Int -> Fee -> ShowS) @@ -2697,7 +2697,7 @@ $cshow :: Fee -> String showsPrec :: Int -> Fee -> ShowS $cshowsPrec :: Int -> Fee -> ShowS -Show, Integer -> Fee +Show, Integer -> Fee Fee -> Fee Fee -> Fee -> Fee (Fee -> Fee -> Fee) @@ -2739,15 +2739,15 @@ -- > mints + inputs = fees + burns + outputs txSkelOutputValue :: TxSkel -> Fee -> Pl.Value txSkelOutputValue :: TxSkel -> Fee -> Value -txSkelOutputValue skel :: TxSkel -skel@TxSkel {txSkelMints :: TxSkel -> TxSkelMints -txSkelMints = TxSkelMints -mints} Fee -fees = +txSkelOutputValue skel :: TxSkel +skel@TxSkel {txSkelMints :: TxSkel -> TxSkelMints +txSkelMints = TxSkelMints +mints} Fee +fees = Value -> Value negativePart (TxSkelMints -> Value txSkelMintsValue TxSkelMints -mints) +mints) Value -> Value -> Value forall a. Semigroup a => a -> a -> a <> Optic' A_Fold '[] TxSkel Value -> TxSkel -> Value @@ -2772,13 +2772,13 @@ Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b % Lens' TxSkelOut Value txSkelOutValueL) TxSkel -skel +skel Value -> Value -> Value forall a. Semigroup a => a -> a -> a <> Integer -> Value Pl.lovelaceValueOf (Fee -> Integer feeLovelace Fee -fees) +fees) -- | All validators which will receive transaction outputs txSkelOutValidators :: TxSkel -> Map Pl.ValidatorHash (Pl.Versioned Pl.Validator) @@ -2801,11 +2801,11 @@ -> Maybe (Versioned Validator) -> Maybe (ValidatorHash, Versioned Validator) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b -fmap (\Versioned Validator -script -> (Versioned Validator -> ValidatorHash +fmap (\Versioned Validator +script -> (Versioned Validator -> ValidatorHash Ledger.Scripts.validatorHash Versioned Validator -script, Versioned Validator -script)) (Maybe (Versioned Validator) +script, Versioned Validator +script)) (Maybe (Versioned Validator) -> Maybe (ValidatorHash, Versioned Validator)) -> (TxSkelOut -> Maybe (Versioned Validator)) -> TxSkelOut @@ -2839,10 +2839,10 @@ -> [TxSkelOut] -> [Map ValidatorHash (Versioned Validator)] forall a b. (a -> b) -> [a] -> [b] map - ( \(Pays o -output) -> + ( \(Pays o +output) -> case o -output o +output o -> Optic' A_Lens '[] o (Maybe (ReferenceScriptType o)) -> Maybe (ReferenceScriptType o) forall k s (is :: IxList) a. @@ -2857,34 +2857,34 @@ Nothing -> Map ValidatorHash (Versioned Validator) forall k a. Map k a Map.empty - Just ReferenceScriptType o -x -> - let vScript :: Versioned Script -vScript@(Pl.Versioned Script -script Language -version) = ReferenceScriptType o -> Versioned Script + Just ReferenceScriptType o +x -> + let vScript :: Versioned Script +vScript@(Pl.Versioned Script +script Language +version) = ReferenceScriptType o -> Versioned Script forall a. ToScript a => a -> Versioned Script toScript ReferenceScriptType o -x - Pl.ScriptHash BuiltinByteString -hash = Versioned Script -> ScriptHash +x + Pl.ScriptHash BuiltinByteString +hash = Versioned Script -> ScriptHash forall a. ToScriptHash a => a -> ScriptHash toScriptHash Versioned Script -vScript +vScript in ValidatorHash -> Versioned Validator -> Map ValidatorHash (Versioned Validator) forall k a. k -> a -> Map k a Map.singleton (BuiltinByteString -> ValidatorHash Pl.ValidatorHash BuiltinByteString -hash) (Versioned Validator -> Map ValidatorHash (Versioned Validator)) +hash) (Versioned Validator -> Map ValidatorHash (Versioned Validator)) -> Versioned Validator -> Map ValidatorHash (Versioned Validator) forall a b. (a -> b) -> a -> b $ Validator -> Language -> Versioned Validator forall script. script -> Language -> Versioned script Pl.Versioned (Script -> Validator Pl.Validator Script -script) Language -version +script) Language +version ) ([TxSkelOut] -> [Map ValidatorHash (Versioned Validator)]) -> (TxSkel -> [TxSkelOut]) @@ -2898,13 +2898,13 @@ -- | Decide if a transaction output has a certain owner and datum type. txSkelOutOwnerTypeP :: - forall ownerType. - ( ToCredential ownerType, - Show ownerType, - IsTxSkelOutAllowedOwner ownerType, - Typeable ownerType + forall ownerType. + ( ToCredential ownerType, + Show ownerType, + IsTxSkelOutAllowedOwner ownerType, + Typeable ownerType ) => - Prism' TxSkelOut (ConcreteOutput ownerType TxSkelOutDatum Pl.Value (Pl.Versioned Pl.Script)) + Prism' TxSkelOut (ConcreteOutput ownerType TxSkelOutDatum Pl.Value (Pl.Versioned Pl.Script)) txSkelOutOwnerTypeP :: Prism' TxSkelOut (ConcreteOutput ownerType TxSkelOutDatum Value (Versioned Script)) @@ -2930,11 +2930,11 @@ Typeable (ReferenceScriptType o)) => o -> TxSkelOut Pays - ( \(Pays o -output) -> - let owner :: OwnerType o -owner = o -output o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o + ( \(Pays o +output) -> + let owner :: OwnerType o +owner = o +output o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -2944,13 +2944,13 @@ in case OwnerType o -> TypeRep (OwnerType o) forall a. Typeable a => a -> TypeRep a typeOf OwnerType o -owner TypeRep (OwnerType o) +owner TypeRep (OwnerType o) -> TypeRep ownerType -> Maybe (OwnerType o :~~: ownerType) forall k1 k2 (a :: k1) (b :: k2). TypeRep a -> TypeRep b -> Maybe (a :~~: b) `eqTypeRep` Typeable ownerType => TypeRep ownerType forall k (a :: k). Typeable a => TypeRep a -typeRep @ownerType of +typeRep @ownerType of Just OwnerType o :~~: ownerType HRefl -> ConcreteOutput @@ -2987,9 +2987,9 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput OwnerType o -owner +owner (o -output o +output o -> Optic' A_Lens '[] o (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -2999,7 +2999,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) (o -output o -> Optic' A_Lens '[] o Value -> Value +output o -> Optic' A_Lens '[] o Value -> Value forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -3007,7 +3007,7 @@ forall o. IsAbstractOutput o => Lens' o (ValueType o) outputValueL) (o -output o -> Optic' A_Lens '[] o TxSkelOutDatum -> TxSkelOutDatum +output o -> Optic' A_Lens '[] o TxSkelOutDatum -> TxSkelOutDatum forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -3020,7 +3020,7 @@ -> Maybe (ReferenceScriptType o) -> Maybe (Versioned Script) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> o -output o +output o -> Optic' A_Lens '[] o (Maybe (ReferenceScriptType o)) -> Maybe (ReferenceScriptType o) forall k s (is :: IxList) a. @@ -3038,9 +3038,9 @@ Nothing ) -txSkelOutputDatumTypeAT :: - (Pl.FromData a, Typeable a) => - AffineTraversal' TxSkelOut a +txSkelOutputDatumTypeAT :: + (Pl.FromData a, Typeable a) => + AffineTraversal' TxSkelOut a txSkelOutputDatumTypeAT :: AffineTraversal' TxSkelOut a txSkelOutputDatumTypeAT = (TxSkelOut -> Either TxSkelOut a) @@ -3048,34 +3048,34 @@ forall s t a b. (s -> Either t a) -> (s -> b -> t) -> AffineTraversal s t a b atraversal - ( \TxSkelOut -txSkelOut -> case TxSkelOut -> Maybe Datum -txSkelOutDatumComplete TxSkelOut -txSkelOut of + ( \TxSkelOut +txSkelOut -> case TxSkelOut -> Maybe Datum +txSkelOutDatumComplete TxSkelOut +txSkelOut of Maybe Datum Nothing -> TxSkelOut -> Either TxSkelOut a forall a b. a -> Either a b Left TxSkelOut -txSkelOut - Just (Pl.Datum BuiltinData -datum) -> case BuiltinData -> Maybe a +txSkelOut + Just (Pl.Datum BuiltinData +datum) -> case BuiltinData -> Maybe a forall a. FromData a => BuiltinData -> Maybe a Pl.fromBuiltinData BuiltinData -datum of - Just a -tyDatum -> a -> Either TxSkelOut a +datum of + Just a +tyDatum -> a -> Either TxSkelOut a forall a b. b -> Either a b Right a -tyDatum +tyDatum Maybe a Nothing -> TxSkelOut -> Either TxSkelOut a forall a b. a -> Either a b Left TxSkelOut -txSkelOut +txSkelOut ) - ( \(Pays o -output) a -newTyDatum -> + ( \(Pays o +output) a +newTyDatum -> o -> TxSkelOut forall o. (Show o, Typeable o, IsTxInfoOutput o, @@ -3101,71 +3101,71 @@ TxSkelOutDatum TxSkelOutNoDatum -> TxSkelOutDatum TxSkelOutNoDatum - TxSkelOutDatum a -tyDatum -> a -> TxSkelOutDatum + TxSkelOutDatum a +tyDatum -> a -> TxSkelOutDatum forall a. TxSkelOutDatumConstrs a => a -> TxSkelOutDatum TxSkelOutDatum (a -> TxSkelOutDatum) -> a -> TxSkelOutDatum forall a b. (a -> b) -> a -> b $ a -> a -> a forall b a. (Typeable b, Typeable a) => b -> a -> b -replaceDatumOnCorrectType a -tyDatum a -newTyDatum - TxSkelOutDatumHash a -tyDatum -> a -> TxSkelOutDatum +replaceDatumOnCorrectType a +tyDatum a +newTyDatum + TxSkelOutDatumHash a +tyDatum -> a -> TxSkelOutDatum forall a. TxSkelOutDatumConstrs a => a -> TxSkelOutDatum TxSkelOutDatumHash (a -> TxSkelOutDatum) -> a -> TxSkelOutDatum forall a b. (a -> b) -> a -> b $ a -> a -> a forall b a. (Typeable b, Typeable a) => b -> a -> b -replaceDatumOnCorrectType a -tyDatum a -newTyDatum - TxSkelOutInlineDatum a -tyDatum -> a -> TxSkelOutDatum +replaceDatumOnCorrectType a +tyDatum a +newTyDatum + TxSkelOutInlineDatum a +tyDatum -> a -> TxSkelOutDatum forall a. TxSkelOutDatumConstrs a => a -> TxSkelOutDatum TxSkelOutInlineDatum (a -> TxSkelOutDatum) -> a -> TxSkelOutDatum forall a b. (a -> b) -> a -> b $ a -> a -> a forall b a. (Typeable b, Typeable a) => b -> a -> b -replaceDatumOnCorrectType a -tyDatum a -newTyDatum +replaceDatumOnCorrectType a +tyDatum a +newTyDatum ) o -output +output ) where - replaceDatumOnCorrectType :: (Typeable b, Typeable a) => b -> a -> b - replaceDatumOnCorrectType :: b -> a -> b -replaceDatumOnCorrectType b -old a -new = case b -> TypeRep b + replaceDatumOnCorrectType :: (Typeable b, Typeable a) => b -> a -> b + replaceDatumOnCorrectType :: b -> a -> b +replaceDatumOnCorrectType b +old a +new = case b -> TypeRep b forall a. Typeable a => a -> TypeRep a typeOf b -old TypeRep b -> TypeRep a -> Maybe (b :~~: a) +old TypeRep b -> TypeRep a -> Maybe (b :~~: a) forall k1 k2 (a :: k1) (b :: k2). TypeRep a -> TypeRep b -> Maybe (a :~~: b) `eqTypeRep` a -> TypeRep a forall a. Typeable a => a -> TypeRep a typeOf a -new of +new of Just b :~~: a HRefl -> b a -new +new Maybe (b :~~: a) Nothing -> b -old +old - txSkelOutDatumComplete :: TxSkelOut -> Maybe Pl.Datum - txSkelOutDatumComplete :: TxSkelOut -> Maybe Datum -txSkelOutDatumComplete (Pays o -output) = TxSkelOutDatum -> Maybe Datum + txSkelOutDatumComplete :: TxSkelOut -> Maybe Pl.Datum + txSkelOutDatumComplete :: TxSkelOut -> Maybe Datum +txSkelOutDatumComplete (Pays o +output) = TxSkelOutDatum -> Maybe Datum txSkelOutUntypedDatum (TxSkelOutDatum -> Maybe Datum) -> TxSkelOutDatum -> Maybe Datum forall a b. (a -> b) -> a -> b $ o -output o -> Optic' A_Lens '[] o TxSkelOutDatum -> TxSkelOutDatum +output o -> Optic' A_Lens '[] o TxSkelOutDatum -> TxSkelOutDatum forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a diff --git a/src/Cooked.Tweak.AddInputsAndOutputs.html b/src/Cooked.Tweak.AddInputsAndOutputs.html index 8c0484b6e..9f664cb29 100644 --- a/src/Cooked.Tweak.AddInputsAndOutputs.html +++ b/src/Cooked.Tweak.AddInputsAndOutputs.html @@ -31,13 +31,13 @@ -- | Ensure that a given 'Pl.TxOutRef' is being spent with a given -- 'TxSkelRedeemer'. The return value will be @Just@ the added data, if anything -- changed. -ensureInputTweak :: MonadTweak m => Pl.TxOutRef -> TxSkelRedeemer -> m (Maybe (Pl.TxOutRef, TxSkelRedeemer)) +ensureInputTweak :: MonadTweak m => Pl.TxOutRef -> TxSkelRedeemer -> m (Maybe (Pl.TxOutRef, TxSkelRedeemer)) ensureInputTweak :: TxOutRef -> TxSkelRedeemer -> m (Maybe (TxOutRef, TxSkelRedeemer)) -ensureInputTweak TxOutRef -oref TxSkelRedeemer -howConsumed = do - Map TxOutRef TxSkelRedeemer -presentInputs <- Optic' A_Lens NoIx TxSkel (Map TxOutRef TxSkelRedeemer) +ensureInputTweak TxOutRef +oref TxSkelRedeemer +howConsumed = do + Map TxOutRef TxSkelRedeemer +presentInputs <- Optic' A_Lens NoIx TxSkel (Map TxOutRef TxSkelRedeemer) -> m (Map TxOutRef TxSkelRedeemer) forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Getter) => @@ -45,15 +45,15 @@ viewTweak Optic' A_Lens NoIx TxSkel (Map TxOutRef TxSkelRedeemer) txSkelInsL if Map TxOutRef TxSkelRedeemer -presentInputs Map TxOutRef TxSkelRedeemer -> TxOutRef -> Maybe TxSkelRedeemer +presentInputs Map TxOutRef TxSkelRedeemer -> TxOutRef -> Maybe TxSkelRedeemer forall k a. Ord k => Map k a -> k -> Maybe a Map.!? TxOutRef -oref Maybe TxSkelRedeemer -> Maybe TxSkelRedeemer -> Bool +oref Maybe TxSkelRedeemer -> Maybe TxSkelRedeemer -> Bool forall a. Eq a => a -> a -> Bool == TxSkelRedeemer -> Maybe TxSkelRedeemer forall a. a -> Maybe a Just TxSkelRedeemer -howConsumed +howConsumed then Maybe (TxOutRef, TxSkelRedeemer) -> m (Maybe (TxOutRef, TxSkelRedeemer)) forall (m :: * -> *) a. Monad m => a -> m a @@ -74,8 +74,8 @@ -> Map TxOutRef TxSkelRedeemer forall k a. Ord k => k -> a -> Map k a -> Map k a Map.insert TxOutRef -oref TxSkelRedeemer -howConsumed) +oref TxSkelRedeemer +howConsumed) Maybe (TxOutRef, TxSkelRedeemer) -> m (Maybe (TxOutRef, TxSkelRedeemer)) forall (m :: * -> *) a. Monad m => a -> m a @@ -87,18 +87,18 @@ $ (TxOutRef, TxSkelRedeemer) -> Maybe (TxOutRef, TxSkelRedeemer) forall a. a -> Maybe a Just (TxOutRef -oref, TxSkelRedeemer -howConsumed) +oref, TxSkelRedeemer +howConsumed) -- | Add an input to a transaction. If the given 'Pl.TxOutRef' is already being -- consumed by the transaction, fail. -addInputTweak :: MonadTweak m => Pl.TxOutRef -> TxSkelRedeemer -> m () +addInputTweak :: MonadTweak m => Pl.TxOutRef -> TxSkelRedeemer -> m () addInputTweak :: TxOutRef -> TxSkelRedeemer -> m () -addInputTweak TxOutRef -oref TxSkelRedeemer -howConsumed = do - Map TxOutRef TxSkelRedeemer -presentInputs <- Optic' A_Lens NoIx TxSkel (Map TxOutRef TxSkelRedeemer) +addInputTweak TxOutRef +oref TxSkelRedeemer +howConsumed = do + Map TxOutRef TxSkelRedeemer +presentInputs <- Optic' A_Lens NoIx TxSkel (Map TxOutRef TxSkelRedeemer) -> m (Map TxOutRef TxSkelRedeemer) forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Getter) => @@ -110,8 +110,8 @@ guard (TxOutRef -> Map TxOutRef TxSkelRedeemer -> Bool forall k a. Ord k => k -> Map k a -> Bool Map.notMember TxOutRef -oref Map TxOutRef TxSkelRedeemer -presentInputs) +oref Map TxOutRef TxSkelRedeemer +presentInputs) Optic' A_Lens NoIx TxSkel (Map TxOutRef TxSkelRedeemer) -> (Map TxOutRef TxSkelRedeemer -> Map TxOutRef TxSkelRedeemer) -> m () @@ -125,33 +125,33 @@ -> Map TxOutRef TxSkelRedeemer forall k a. Ord k => k -> a -> Map k a -> Map k a Map.insert TxOutRef -oref TxSkelRedeemer -howConsumed) +oref TxSkelRedeemer +howConsumed) -- | Remove transaction inputs according to a given predicate. The returned list -- contains all removed inputs. -removeInputTweak :: MonadTweak m => (Pl.TxOutRef -> TxSkelRedeemer -> Bool) -> m [(Pl.TxOutRef, TxSkelRedeemer)] +removeInputTweak :: MonadTweak m => (Pl.TxOutRef -> TxSkelRedeemer -> Bool) -> m [(Pl.TxOutRef, TxSkelRedeemer)] removeInputTweak :: (TxOutRef -> TxSkelRedeemer -> Bool) -> m [(TxOutRef, TxSkelRedeemer)] -removeInputTweak TxOutRef -> TxSkelRedeemer -> Bool -removePred = do - Map TxOutRef TxSkelRedeemer -presentInputs <- Optic' A_Lens NoIx TxSkel (Map TxOutRef TxSkelRedeemer) +removeInputTweak TxOutRef -> TxSkelRedeemer -> Bool +removePred = do + Map TxOutRef TxSkelRedeemer +presentInputs <- Optic' A_Lens NoIx TxSkel (Map TxOutRef TxSkelRedeemer) -> m (Map TxOutRef TxSkelRedeemer) forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a viewTweak Optic' A_Lens NoIx TxSkel (Map TxOutRef TxSkelRedeemer) txSkelInsL - let (Map TxOutRef TxSkelRedeemer -removed, Map TxOutRef TxSkelRedeemer -kept) = (TxOutRef -> TxSkelRedeemer -> Bool) + let (Map TxOutRef TxSkelRedeemer +removed, Map TxOutRef TxSkelRedeemer +kept) = (TxOutRef -> TxSkelRedeemer -> Bool) -> Map TxOutRef TxSkelRedeemer -> (Map TxOutRef TxSkelRedeemer, Map TxOutRef TxSkelRedeemer) forall k a. (k -> a -> Bool) -> Map k a -> (Map k a, Map k a) Map.partitionWithKey TxOutRef -> TxSkelRedeemer -> Bool -removePred Map TxOutRef TxSkelRedeemer -presentInputs +removePred Map TxOutRef TxSkelRedeemer +presentInputs Optic' A_Lens NoIx TxSkel (Map TxOutRef TxSkelRedeemer) -> Map TxOutRef TxSkelRedeemer -> m () forall (m :: * -> *) k (is :: IxList) a. @@ -159,7 +159,7 @@ Optic' k is TxSkel a -> a -> m () setTweak Optic' A_Lens NoIx TxSkel (Map TxOutRef TxSkelRedeemer) txSkelInsL Map TxOutRef TxSkelRedeemer -kept +kept [(TxOutRef, TxSkelRedeemer)] -> m [(TxOutRef, TxSkelRedeemer)] forall (m :: * -> *) a. Monad m => a -> m a return ([(TxOutRef, TxSkelRedeemer)] -> m [(TxOutRef, TxSkelRedeemer)]) @@ -168,28 +168,28 @@ $ Map TxOutRef TxSkelRedeemer -> [(TxOutRef, TxSkelRedeemer)] forall k a. Map k a -> [(k, a)] Map.toList Map TxOutRef TxSkelRedeemer -removed +removed -- * Adding and removing transaction outputs -- | Ensure that a certain output is produced by a transaction. The return value -- will be @Just@ the added output, if there was any change. -ensureOutputTweak :: MonadTweak m => TxSkelOut -> m (Maybe TxSkelOut) +ensureOutputTweak :: MonadTweak m => TxSkelOut -> m (Maybe TxSkelOut) ensureOutputTweak :: TxSkelOut -> m (Maybe TxSkelOut) -ensureOutputTweak TxSkelOut -txSkelOut = do - [TxSkelOut] -presentOutputs <- Optic' A_Lens NoIx TxSkel [TxSkelOut] -> m [TxSkelOut] +ensureOutputTweak TxSkelOut +txSkelOut = do + [TxSkelOut] +presentOutputs <- Optic' A_Lens NoIx TxSkel [TxSkelOut] -> m [TxSkelOut] forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a viewTweak Optic' A_Lens NoIx TxSkel [TxSkelOut] txSkelOutsL if TxSkelOut -txSkelOut TxSkelOut -> [TxSkelOut] -> Bool +txSkelOut TxSkelOut -> [TxSkelOut] -> Bool forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool `elem` [TxSkelOut] -presentOutputs +presentOutputs then Maybe TxSkelOut -> m (Maybe TxSkelOut) forall (m :: * -> *) a. Monad m => a -> m a return Maybe TxSkelOut @@ -199,7 +199,7 @@ TxSkelOut -> m () forall (m :: * -> *). MonadTweak m => TxSkelOut -> m () addOutputTweak TxSkelOut -txSkelOut +txSkelOut Maybe TxSkelOut -> m (Maybe TxSkelOut) forall (m :: * -> *) a. Monad m => a -> m a return (Maybe TxSkelOut -> m (Maybe TxSkelOut)) @@ -208,14 +208,14 @@ $ TxSkelOut -> Maybe TxSkelOut forall a. a -> Maybe a Just TxSkelOut -txSkelOut +txSkelOut -- | Add a transaction output, at the end of the current list of outputs, -- thus retaining the order in which they have been specified. -addOutputTweak :: MonadTweak m => TxSkelOut -> m () +addOutputTweak :: MonadTweak m => TxSkelOut -> m () addOutputTweak :: TxSkelOut -> m () -addOutputTweak TxSkelOut -txSkelOut = Optic' A_Lens NoIx TxSkel [TxSkelOut] +addOutputTweak TxSkelOut +txSkelOut = Optic' A_Lens NoIx TxSkel [TxSkelOut] -> ([TxSkelOut] -> [TxSkelOut]) -> m () forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Setter) => @@ -224,50 +224,50 @@ txSkelOutsL ([TxSkelOut] -> [TxSkelOut] -> [TxSkelOut] forall a. [a] -> [a] -> [a] ++ [TxSkelOut -txSkelOut]) +txSkelOut]) -- | Remove transaction outputs according to some predicate. The returned list -- contains all the removed outputs. -removeOutputTweak :: MonadTweak m => (TxSkelOut -> Bool) -> m [TxSkelOut] +removeOutputTweak :: MonadTweak m => (TxSkelOut -> Bool) -> m [TxSkelOut] removeOutputTweak :: (TxSkelOut -> Bool) -> m [TxSkelOut] -removeOutputTweak TxSkelOut -> Bool -removePred = do - [TxSkelOut] -presentOutputs <- Optic' A_Lens NoIx TxSkel [TxSkelOut] -> m [TxSkelOut] +removeOutputTweak TxSkelOut -> Bool +removePred = do + [TxSkelOut] +presentOutputs <- Optic' A_Lens NoIx TxSkel [TxSkelOut] -> m [TxSkelOut] forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a viewTweak Optic' A_Lens NoIx TxSkel [TxSkelOut] txSkelOutsL - let ([TxSkelOut] -removed, [TxSkelOut] -kept) = (TxSkelOut -> Bool) -> [TxSkelOut] -> ([TxSkelOut], [TxSkelOut]) + let ([TxSkelOut] +removed, [TxSkelOut] +kept) = (TxSkelOut -> Bool) -> [TxSkelOut] -> ([TxSkelOut], [TxSkelOut]) forall a. (a -> Bool) -> [a] -> ([a], [a]) partition TxSkelOut -> Bool -removePred [TxSkelOut] -presentOutputs +removePred [TxSkelOut] +presentOutputs Optic' A_Lens NoIx TxSkel [TxSkelOut] -> [TxSkelOut] -> m () forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> a -> m () setTweak Optic' A_Lens NoIx TxSkel [TxSkelOut] txSkelOutsL [TxSkelOut] -kept +kept [TxSkelOut] -> m [TxSkelOut] forall (m :: * -> *) a. Monad m => a -> m a return [TxSkelOut] -removed +removed -- * Adding and removing minted values -- | Add a new entry to the 'TxSkelMints' of the transaction skeleton under -- modification. As this is implemented in terms of 'addToTxSkelMints', the same -- caveats apply as do to that function! -addMintTweak :: MonadTweak m => (Pl.Versioned Pl.MintingPolicy, MintsRedeemer, Pl.TokenName, Integer) -> m () +addMintTweak :: MonadTweak m => (Pl.Versioned Pl.MintingPolicy, MintsRedeemer, Pl.TokenName, Integer) -> m () addMintTweak :: (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> m () -addMintTweak (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -mint = Optic' A_Lens NoIx TxSkel TxSkelMints +addMintTweak (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) +mint = Optic' A_Lens NoIx TxSkel TxSkelMints -> (TxSkelMints -> TxSkelMints) -> m () forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Setter) => @@ -279,22 +279,22 @@ $ (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> TxSkelMints -> TxSkelMints addToTxSkelMints (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -mint +mint -- | Remove some entries from the 'TxSkelMints' of a transaction, according to -- some predicate. The returned list holds the removed entries. -removeMintTweak :: - MonadTweak m => +removeMintTweak :: + MonadTweak m => ((Pl.Versioned Pl.MintingPolicy, MintsRedeemer, Pl.TokenName, Integer) -> Bool) -> - m [(Pl.Versioned Pl.MintingPolicy, MintsRedeemer, Pl.TokenName, Integer)] + m [(Pl.Versioned Pl.MintingPolicy, MintsRedeemer, Pl.TokenName, Integer)] removeMintTweak :: ((Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> Bool) -> m [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -removeMintTweak (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) +removeMintTweak (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> Bool -removePred = do - [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -presentMints <- Optic' +removePred = do + [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] +presentMints <- Optic' A_Getter NoIx TxSkel @@ -348,9 +348,9 @@ to TxSkelMints -> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] txSkelMintsToList - let ([(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -removed, [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -kept) = ((Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) + let ([(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] +removed, [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] +kept) = ((Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> Bool) -> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -> ([(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)], @@ -358,8 +358,8 @@ forall a. (a -> Bool) -> [a] -> ([a], [a]) partition (Versioned MintingPolicy, MintsRedeemer, TokenName, Integer) -> Bool -removePred [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -presentMints +removePred [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] +presentMints Optic' A_Lens NoIx TxSkel TxSkelMints -> TxSkelMints -> m () forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Setter) => @@ -370,10 +370,10 @@ $ [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -> TxSkelMints txSkelMintsFromList [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -kept +kept [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -> m [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] forall (m :: * -> *) a. Monad m => a -> m a return [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)] -removed +removed \ No newline at end of file diff --git a/src/Cooked.Tweak.Common.html b/src/Cooked.Tweak.Common.html index 6d14526f6..c4dbec20d 100644 --- a/src/Cooked.Tweak.Common.html +++ b/src/Cooked.Tweak.Common.html @@ -42,19 +42,19 @@ -- * The type of tweaks -class (MonadPlus m, MonadBlockChainWithoutValidation m) => MonadTweak m where - getTxSkel :: m TxSkel - putTxSkel :: TxSkel -> m () +class (MonadPlus m, MonadBlockChainWithoutValidation m) => MonadTweak m where + getTxSkel :: m TxSkel + putTxSkel :: TxSkel -> m () -type Tweak m = StateT TxSkel (ListT m) +type Tweak m = StateT TxSkel (ListT m) -instance MonadBlockChainWithoutValidation m => MonadTweak (Tweak m) where - getTxSkel :: Tweak m TxSkel -getTxSkel = Tweak m TxSkel +instance MonadBlockChainWithoutValidation m => MonadTweak (Tweak m) where + getTxSkel :: Tweak m TxSkel +getTxSkel = Tweak m TxSkel forall s (m :: * -> *). MonadState s m => m s get - putTxSkel :: TxSkel -> Tweak m () -putTxSkel = TxSkel -> Tweak m () + putTxSkel :: TxSkel -> Tweak m () +putTxSkel = TxSkel -> Tweak m () forall s (m :: * -> *). MonadState s m => s -> m () put @@ -79,11 +79,11 @@ -- If you're using tweaks in a 'MonadModalBlockChain' together with mechanisms -- like 'withTweak', 'somewhere', or 'everywhere', you should never have areason -- to use this function. -runTweakInChain :: (MonadBlockChainWithoutValidation m, MonadPlus m) => Tweak m a -> TxSkel -> m (a, TxSkel) +runTweakInChain :: (MonadBlockChainWithoutValidation m, MonadPlus m) => Tweak m a -> TxSkel -> m (a, TxSkel) runTweakInChain :: Tweak m a -> TxSkel -> m (a, TxSkel) -runTweakInChain Tweak m a -tweak TxSkel -skel = ListT m (a, TxSkel) -> m (a, TxSkel) +runTweakInChain Tweak m a +tweak TxSkel +skel = ListT m (a, TxSkel) -> m (a, TxSkel) forall (m :: * -> *) a. (Alternative m, Monad m) => ListT m a -> m a @@ -93,8 +93,8 @@ $ Tweak m a -> TxSkel -> ListT m (a, TxSkel) forall s (m :: * -> *) a. StateT s m a -> s -> m (a, s) runStateT Tweak m a -tweak TxSkel -skel +tweak TxSkel +skel -- | Like 'runTweakInChain', but for when you want to explicitly apply a tweak -- to a transaction skeleton and get all results as a list. @@ -102,11 +102,11 @@ -- If you're trying to apply a tweak to a transaction directly before it's -- modified, consider using 'MonadModalBlockChain' and idioms like 'withTweak', -- 'somewhere', or 'everywhere'. -runTweakInChain' :: MonadBlockChainWithoutValidation m => Tweak m a -> TxSkel -> m [(a, TxSkel)] +runTweakInChain' :: MonadBlockChainWithoutValidation m => Tweak m a -> TxSkel -> m [(a, TxSkel)] runTweakInChain' :: Tweak m a -> TxSkel -> m [(a, TxSkel)] -runTweakInChain' Tweak m a -tweak TxSkel -skel = ListT m (a, TxSkel) -> m [(a, TxSkel)] +runTweakInChain' Tweak m a +tweak TxSkel +skel = ListT m (a, TxSkel) -> m [(a, TxSkel)] forall (m :: * -> *) a. Monad m => ListT m a -> m [a] ListT.toList (ListT m (a, TxSkel) -> m [(a, TxSkel)]) -> ListT m (a, TxSkel) -> m [(a, TxSkel)] @@ -114,31 +114,31 @@ $ Tweak m a -> TxSkel -> ListT m (a, TxSkel) forall s (m :: * -> *) a. StateT s m a -> s -> m (a, s) runStateT Tweak m a -tweak TxSkel -skel +tweak TxSkel +skel -- | This is a wrapper type used in the implementation of the Staged monad. You -- will probably never use it while you're building 'Tweak's. -data UntypedTweak m where - UntypedTweak :: Tweak m a -> UntypedTweak m +data UntypedTweak m where + UntypedTweak :: Tweak m a -> UntypedTweak m -instance Monad m => Semigroup (UntypedTweak m) where +instance Monad m => Semigroup (UntypedTweak m) where -- The right tweak is applied first - UntypedTweak Tweak m a -f <> :: UntypedTweak m -> UntypedTweak m -> UntypedTweak m -<> UntypedTweak Tweak m a -g = Tweak m a -> UntypedTweak m + UntypedTweak Tweak m a +f <> :: UntypedTweak m -> UntypedTweak m -> UntypedTweak m +<> UntypedTweak Tweak m a +g = Tweak m a -> UntypedTweak m forall (m :: * -> *) a. Tweak m a -> UntypedTweak m UntypedTweak (Tweak m a -> UntypedTweak m) -> Tweak m a -> UntypedTweak m forall a b. (a -> b) -> a -> b $ Tweak m a -g Tweak m a -> Tweak m a -> Tweak m a +g Tweak m a -> Tweak m a -> Tweak m a forall (m :: * -> *) a b. Monad m => m a -> m b -> m b >> Tweak m a -f +f -instance Monad m => Monoid (UntypedTweak m) where - mempty :: UntypedTweak m +instance Monad m => Monoid (UntypedTweak m) where + mempty :: UntypedTweak m mempty = Tweak m () -> UntypedTweak m forall (m :: * -> *) a. Tweak m a -> UntypedTweak m UntypedTweak (Tweak m () -> UntypedTweak m) -> Tweak m () -> UntypedTweak m @@ -150,14 +150,14 @@ -- * A few fundamental tweaks -- | The never-applicable tweak. -failingTweak :: MonadTweak m => m a +failingTweak :: MonadTweak m => m a failingTweak :: m a failingTweak = m a forall (m :: * -> *) a. MonadPlus m => m a mzero -- | The tweak that always applies and leaves the transaction unchanged. -doNothingTweak :: MonadTweak m => m () +doNothingTweak :: MonadTweak m => m () doNothingTweak :: m () doNothingTweak = () -> m () forall (m :: * -> *) a. Monad m => a -> m a @@ -167,10 +167,10 @@ -- | The "tweak" that obtains some value from the 'TxSkel'. This does *not* -- modify the transaction. -viewTweak :: (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a +viewTweak :: (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a viewTweak :: Optic' k is TxSkel a -> m a -viewTweak Optic' k is TxSkel a -optic = m TxSkel +viewTweak Optic' k is TxSkel a +optic = m TxSkel forall (m :: * -> *). MonadTweak m => m TxSkel getTxSkel m TxSkel -> (TxSkel -> a) -> m a forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b @@ -179,13 +179,13 @@ Is k A_Getter => Optic' k is s a -> s -> a view Optic' k is TxSkel a -optic +optic -- | Like 'viewTweak', only for indexed optics. -iviewTweak :: (MonadTweak m, Is k A_Getter) => Optic' k (WithIx is) TxSkel a -> m (is, a) +iviewTweak :: (MonadTweak m, Is k A_Getter) => Optic' k (WithIx is) TxSkel a -> m (is, a) iviewTweak :: Optic' k (WithIx is) TxSkel a -> m (is, a) -iviewTweak Optic' k (WithIx is) TxSkel a -optic = m TxSkel +iviewTweak Optic' k (WithIx is) TxSkel a +optic = m TxSkel forall (m :: * -> *). MonadTweak m => m TxSkel getTxSkel m TxSkel -> (TxSkel -> (is, a)) -> m (is, a) forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b @@ -194,13 +194,13 @@ (Is k A_Getter, HasSingleIndex is i) => Optic' k is s a -> s -> (i, a) iview Optic' k (WithIx is) TxSkel a -optic +optic -- | Like the 'viewTweak', but returns a list of all foci -viewAllTweak :: (MonadTweak m, Is k A_Fold) => Optic' k is TxSkel a -> m [a] +viewAllTweak :: (MonadTweak m, Is k A_Fold) => Optic' k is TxSkel a -> m [a] viewAllTweak :: Optic' k is TxSkel a -> m [a] -viewAllTweak Optic' k is TxSkel a -optic = m TxSkel +viewAllTweak Optic' k is TxSkel a +optic = m TxSkel forall (m :: * -> *). MonadTweak m => m TxSkel getTxSkel m TxSkel -> (TxSkel -> [a]) -> m [a] forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b @@ -209,14 +209,14 @@ Is k A_Fold => Optic' k is s a -> s -> [a] toListOf Optic' k is TxSkel a -optic +optic -- | The tweak that sets a certain value in the 'TxSkel'. -setTweak :: (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> a -> m () +setTweak :: (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> a -> m () setTweak :: Optic' k is TxSkel a -> a -> m () -setTweak Optic' k is TxSkel a -optic a -newValue = m TxSkel +setTweak Optic' k is TxSkel a +optic a +newValue = m TxSkel forall (m :: * -> *). MonadTweak m => m TxSkel getTxSkel m TxSkel -> (TxSkel -> m ()) -> m () forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b @@ -229,15 +229,15 @@ Is k A_Setter => Optic k is s t a b -> b -> s -> t set Optic' k is TxSkel a -optic a -newValue +optic a +newValue -- | The tweak that modifies a certain value in the 'TxSkel'. -overTweak :: (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> (a -> a) -> m () +overTweak :: (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> (a -> a) -> m () overTweak :: Optic' k is TxSkel a -> (a -> a) -> m () -overTweak Optic' k is TxSkel a -optic a -> a -change = m TxSkel +overTweak Optic' k is TxSkel a +optic a -> a +change = m TxSkel forall (m :: * -> *). MonadTweak m => m TxSkel getTxSkel m TxSkel -> (TxSkel -> m ()) -> m () forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b @@ -250,26 +250,26 @@ Is k A_Setter => Optic k is s t a b -> (a -> b) -> s -> t over Optic' k is TxSkel a -optic a -> a -change +optic a -> a +change -- | Like 'overTweak', but only modifies foci on which the argument function -- returns @Just@ the new focus. Returns a list of the foci that were modified, -- as they were /before/ the tweak, and in the order in which they occurred on -- the original transaction. -overMaybeTweak :: (MonadTweak m, Is k A_Traversal) => Optic' k is TxSkel a -> (a -> Maybe a) -> m [a] +overMaybeTweak :: (MonadTweak m, Is k A_Traversal) => Optic' k is TxSkel a -> (a -> Maybe a) -> m [a] overMaybeTweak :: Optic' k is TxSkel a -> (a -> Maybe a) -> m [a] -overMaybeTweak Optic' k is TxSkel a -optic a -> Maybe a -mChange = Optic' k is TxSkel a +overMaybeTweak Optic' k is TxSkel a +optic a -> Maybe a +mChange = Optic' k is TxSkel a -> (a -> Maybe a) -> (Integer -> Bool) -> m [a] forall a (m :: * -> *) k (is :: IxList). (MonadTweak m, Is k A_Traversal) => Optic' k is TxSkel a -> (a -> Maybe a) -> (Integer -> Bool) -> m [a] overMaybeSelectingTweak Optic' k is TxSkel a -optic a -> Maybe a -mChange (Bool -> Integer -> Bool +optic a -> Maybe a +mChange (Bool -> Integer -> Bool forall a b. a -> b -> a const Bool True) @@ -280,20 +280,20 @@ -- argument can be used to select which of the modifiable foci should be -- actually modified. overMaybeSelectingTweak :: - forall a m k is. - (MonadTweak m, Is k A_Traversal) => - Optic' k is TxSkel a -> - (a -> Maybe a) -> + forall a m k is. + (MonadTweak m, Is k A_Traversal) => + Optic' k is TxSkel a -> + (a -> Maybe a) -> (Integer -> Bool) -> - m [a] + m [a] overMaybeSelectingTweak :: Optic' k is TxSkel a -> (a -> Maybe a) -> (Integer -> Bool) -> m [a] -overMaybeSelectingTweak Optic' k is TxSkel a -optic a -> Maybe a -mChange Integer -> Bool -select = do - [a] -allFoci <- Optic' A_Lens NoIx TxSkel [a] -> m [a] +overMaybeSelectingTweak Optic' k is TxSkel a +optic a -> Maybe a +mChange Integer -> Bool +select = do + [a] +allFoci <- Optic' A_Lens NoIx TxSkel [a] -> m [a] forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a @@ -305,10 +305,10 @@ Is k A_Traversal => Optic k is s t a a -> Lens s t [a] [a] partsOf Optic' k is TxSkel a -optic - let evaluatedFoci :: [(a, Maybe a)] - evaluatedFoci :: [(a, Maybe a)] -evaluatedFoci = +optic + let evaluatedFoci :: [(a, Maybe a)] + evaluatedFoci :: [(a, Maybe a)] +evaluatedFoci = (Integer, [(a, Maybe a)]) -> [(a, Maybe a)] forall a b. (a, b) -> b snd ((Integer, [(a, Maybe a)]) -> [(a, Maybe a)]) @@ -321,45 +321,45 @@ Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c) mapAccumL - ( \Integer -i a -unmodifiedFocus -> + ( \Integer +i a +unmodifiedFocus -> case a -> Maybe a -mChange a -unmodifiedFocus of - Just a -modifiedFocus -> +mChange a +unmodifiedFocus of + Just a +modifiedFocus -> if Integer -> Bool -select Integer -i +select Integer +i then (Integer -i Integer -> Integer -> Integer +i Integer -> Integer -> Integer forall a. Num a => a -> a -> a + Integer 1, (a -unmodifiedFocus, a -> Maybe a +unmodifiedFocus, a -> Maybe a forall a. a -> Maybe a Just a -modifiedFocus)) +modifiedFocus)) else (Integer -i Integer -> Integer -> Integer +i Integer -> Integer -> Integer forall a. Num a => a -> a -> a + Integer 1, (a -unmodifiedFocus, Maybe a +unmodifiedFocus, Maybe a forall a. Maybe a Nothing)) Maybe a Nothing -> (Integer -i, (a -unmodifiedFocus, Maybe a +i, (a +unmodifiedFocus, Maybe a forall a. Maybe a Nothing)) ) Integer 0 [a] -allFoci +allFoci Optic' A_Lens NoIx TxSkel [a] -> [a] -> m () forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Setter) => @@ -369,7 +369,7 @@ Is k A_Traversal => Optic k is s t a a -> Lens s t [a] [a] partsOf Optic' k is TxSkel a -optic) ([a] -> m ()) -> [a] -> m () +optic) ([a] -> m ()) -> [a] -> m () forall a b. (a -> b) -> a -> b $ ((a, Maybe a) -> a) -> [(a, Maybe a)] -> [a] forall a b. (a -> b) -> [a] -> [b] @@ -378,7 +378,7 @@ uncurry a -> Maybe a -> a forall a. a -> Maybe a -> a fromMaybe) [(a, Maybe a)] -evaluatedFoci -- If the second component of the pair is @Just@, use it. +evaluatedFoci -- If the second component of the pair is @Just@, use it. [a] -> m [a] forall (m :: * -> *) a. Monad m => a -> m a return ([a] -> m [a]) -> [a] -> m [a] @@ -387,19 +387,19 @@ ((a, Maybe a) -> Maybe a) -> [(a, Maybe a)] -> [a] forall a b. (a -> Maybe b) -> [a] -> [b] mapMaybe - (\(a -original, Maybe a -mNew) -> if Maybe a -> Bool + (\(a +original, Maybe a +mNew) -> if Maybe a -> Bool forall a. Maybe a -> Bool isJust Maybe a -mNew then a -> Maybe a +mNew then a -> Maybe a forall a. a -> Maybe a Just a -original else Maybe a +original else Maybe a forall a. Maybe a Nothing) [(a, Maybe a)] -evaluatedFoci +evaluatedFoci -- | When constructing a tweak from an optic and a modification of foci, there -- are in principle two options for optics with many foci: (a) apply the @@ -493,23 +493,23 @@ -- -- So you see that tweaks constructed like this can branch quite wildly. Use -- with caution! -combineModsTweak :: - (Eq is, Is k A_Traversal, MonadTweak m) => - ([is] -> [[is]]) -> - Optic' k (WithIx is) TxSkel x -> - (is -> x -> m [(x, l)]) -> - m [l] +combineModsTweak :: + (Eq is, Is k A_Traversal, MonadTweak m) => + ([is] -> [[is]]) -> + Optic' k (WithIx is) TxSkel x -> + (is -> x -> m [(x, l)]) -> + m [l] combineModsTweak :: ([is] -> [[is]]) -> Optic' k (WithIx is) TxSkel x -> (is -> x -> m [(x, l)]) -> m [l] -combineModsTweak [is] -> [[is]] -groupings Optic' k (WithIx is) TxSkel x -optic is -> x -> m [(x, l)] -changes = do - ([is] -indexes, [x] -foci) <- Optic' A_Lens (WithIx [is]) TxSkel [x] -> m ([is], [x]) +combineModsTweak [is] -> [[is]] +groupings Optic' k (WithIx is) TxSkel x +optic is -> x -> m [(x, l)] +changes = do + ([is] +indexes, [x] +foci) <- Optic' A_Lens (WithIx [is]) TxSkel [x] -> m ([is], [x]) forall (m :: * -> *) k is a. (MonadTweak m, Is k A_Getter) => Optic' k (WithIx is) TxSkel a -> m (is, a) @@ -519,7 +519,7 @@ (Is k A_Traversal, HasSingleIndex is i) => Optic k is s t a a -> IxLens [i] s t [a] [a] ipartsOf Optic' k (WithIx is) TxSkel x -optic) +optic) [m [l]] -> m [l] forall (t :: * -> *) (m :: * -> *) a. (Foldable t, MonadPlus m) => @@ -530,22 +530,22 @@ ([is] -> m [l]) -> [[is]] -> [m [l]] forall a b. (a -> b) -> [a] -> [b] map - ( \[is] -grouping -> do - let mChangedFoci :: [m [(x, Either () l)]] -mChangedFoci = + ( \[is] +grouping -> do + let mChangedFoci :: [m [(x, Either () l)]] +mChangedFoci = (is -> x -> m [(x, Either () l)]) -> [is] -> [x] -> [m [(x, Either () l)]] forall a b c. (a -> b -> c) -> [a] -> [b] -> [c] zipWith - ( \is -i x -a -> + ( \is +i x +a -> if is -i is -> [is] -> Bool +i is -> [is] -> Bool forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool `elem` [is] -grouping +grouping then ((x, l) -> (x, Either () l)) -> [(x, l)] -> [(x, Either () l)] forall a b. (a -> b) -> [a] -> [b] map ((l -> Either () l) -> (x, l) -> (x, Either () l) @@ -558,27 +558,27 @@ -> m [(x, l)] -> m [(x, Either () l)] forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> is -> x -> m [(x, l)] -changes is -i x -a +changes is +i x +a else [(x, Either () l)] -> m [(x, Either () l)] forall (m :: * -> *) a. Monad m => a -> m a return [(x -a, () -> Either () l +a, () -> Either () l forall a b. a -> Either a b Left ())] ) [is] -indexes +indexes [x] -foci - [[(x, Either () l)]] -changedFoci <- [m [(x, Either () l)]] -> m [[(x, Either () l)]] +foci + [[(x, Either () l)]] +changedFoci <- [m [(x, Either () l)]] -> m [[(x, Either () l)]] forall (t :: * -> *) (m :: * -> *) a. (Traversable t, Monad m) => t (m a) -> m (t a) sequence [m [(x, Either () l)]] -mChangedFoci +mChangedFoci [m [l]] -> m [l] forall (t :: * -> *) (m :: * -> *) a. (Foldable t, MonadPlus m) => @@ -589,8 +589,8 @@ ([(x, Either () l)] -> m [l]) -> [[(x, Either () l)]] -> [m [l]] forall a b. (a -> b) -> [a] -> [b] map - ( \[(x, Either () l)] -combination -> do + ( \[(x, Either () l)] +combination -> do Optic' A_Lens NoIx TxSkel [x] -> [x] -> m () forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Setter) => @@ -600,14 +600,14 @@ Is k A_Traversal => Optic k is s t a a -> Lens s t [a] [a] partsOf Optic' k (WithIx is) TxSkel x -optic) ([x] -> m ()) -> [x] -> m () +optic) ([x] -> m ()) -> [x] -> m () forall a b. (a -> b) -> a -> b $ ((x, Either () l) -> x) -> [(x, Either () l)] -> [x] forall a b. (a -> b) -> [a] -> [b] map (x, Either () l) -> x forall a b. (a, b) -> a fst [(x, Either () l)] -combination +combination [l] -> m [l] forall (m :: * -> *) a. Monad m => a -> m a return ([l] -> m [l]) -> [l] -> m [l] @@ -622,33 +622,33 @@ . (x, Either () l) -> Either () l forall a b. (a, b) -> b snd) [(x, Either () l)] -combination +combination ) ([[(x, Either () l)]] -> [[(x, Either () l)]] forall a. [[a]] -> [[a]] -allCombinations [[(x, Either () l)]] -changedFoci) +allCombinations [[(x, Either () l)]] +changedFoci) ) ([is] -> [[is]] -groupings [is] -indexes) +groupings [is] +indexes) where - allCombinations :: [[a]] -> [[a]] - allCombinations :: [[a]] -> [[a]] -allCombinations [] = [[]] - allCombinations ([a] -first : [[a]] -rest) = [a -x a -> [a] -> [a] + allCombinations :: [[a]] -> [[a]] + allCombinations :: [[a]] -> [[a]] +allCombinations [] = [[]] + allCombinations ([a] +first : [[a]] +rest) = [a +x a -> [a] -> [a] forall a. a -> [a] -> [a] : [a] -xs | a -x <- [a] -first, [a] -xs <- [[a]] -> [[a]] +xs | a +x <- [a] +first, [a] +xs <- [[a]] -> [[a]] forall a. [[a]] -> [[a]] -allCombinations [[a]] -rest] +allCombinations [[a]] +rest] -- | 'overMaybeTweak' requires a modification that can fail (targeting 'Maybe'). -- Sometimes, it can prove more convenient to explicitly state which property @@ -657,20 +657,20 @@ -- The intended use case is 'overTweak (optic % selectP prop) mod' -- where 'optic' gives the candidate foci, 'prop' is the predicate to be satisfied -- by the foci, and 'mod' is the modification to be applied to the selected foci. -selectP :: (a -> Bool) -> Prism' a a +selectP :: (a -> Bool) -> Prism' a a selectP :: (a -> Bool) -> Prism' a a -selectP a -> Bool -prop = (a -> a) -> (a -> Maybe a) -> Prism' a a +selectP a -> Bool +prop = (a -> a) -> (a -> Maybe a) -> Prism' a a forall b s a. (b -> s) -> (s -> Maybe a) -> Prism s s a b prism' a -> a forall a. a -> a -id (\a -a -> if a -> Bool -prop a -a then a -> Maybe a +id (\a +a -> if a -> Bool +prop a +a then a -> Maybe a forall a. a -> Maybe a Just a -a else Maybe a +a else Maybe a forall a. Maybe a Nothing) \ No newline at end of file diff --git a/src/Cooked.Tweak.Labels.html b/src/Cooked.Tweak.Labels.html index 2f9644d57..d735b33f3 100644 --- a/src/Cooked.Tweak.Labels.html +++ b/src/Cooked.Tweak.Labels.html @@ -13,7 +13,7 @@ import Data.Set qualified as Set -- | Add a label to a 'TxSkel'. -addLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m () +addLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m () addLabelTweak :: x -> m () addLabelTweak = Optic' A_Lens NoIx TxSkel (Set TxLabel) -> (Set TxLabel -> Set TxLabel) -> m () @@ -34,7 +34,7 @@ TxLabel -- | Removes a label from a 'TxSkel' -removeLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m () +removeLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m () removeLabelTweak :: x -> m () removeLabelTweak = Optic' A_Lens NoIx TxSkel (Set TxLabel) -> (Set TxLabel -> Set TxLabel) -> m () @@ -55,7 +55,7 @@ TxLabel -- | Checks if a given label is present in the 'TxSkel' -hasLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m Bool +hasLabelTweak :: (MonadTweak m, LabelConstrs x) => x -> m Bool hasLabelTweak :: x -> m Bool hasLabelTweak = (Optic' A_Lens NoIx TxSkel (Set TxLabel) -> m (Set TxLabel) forall (m :: * -> *) k (is :: IxList) a. diff --git a/src/Cooked.Tweak.OutPermutations.html b/src/Cooked.Tweak.OutPermutations.html index c7a538a63..bf4db747b 100644 --- a/src/Cooked.Tweak.OutPermutations.html +++ b/src/Cooked.Tweak.OutPermutations.html @@ -35,12 +35,12 @@ -- -- (In particular, this is clever enough to generate only the distinct -- permutations, even if some outputs are identical.) -allOutPermutsTweak :: MonadTweak m => PermutOutTweakMode -> m () +allOutPermutsTweak :: MonadTweak m => PermutOutTweakMode -> m () allOutPermutsTweak :: PermutOutTweakMode -> m () -allOutPermutsTweak PermutOutTweakMode -mode = do - [TxSkelOut] -oldOut <- Optic' A_Lens NoIx TxSkel [TxSkelOut] -> m [TxSkelOut] +allOutPermutsTweak PermutOutTweakMode +mode = do + [TxSkelOut] +oldOut <- Optic' A_Lens NoIx TxSkel [TxSkelOut] -> m [TxSkelOut] forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a @@ -63,54 +63,54 @@ setTweak Optic' A_Lens NoIx TxSkel [TxSkelOut] txSkelOutsL) ([TxSkelOut] -> [[TxSkelOut]] -perms [TxSkelOut] -oldOut) +perms [TxSkelOut] +oldOut) where - perms :: [TxSkelOut] -> [[TxSkelOut]] -perms = case PermutOutTweakMode -mode of - KeepIdentity (Just Int -n) -> \[TxSkelOut] -l -> ([TxSkelOut] -> [TxSkelOut]) -> [[TxSkelOut]] -> [[TxSkelOut]] + perms :: [TxSkelOut] -> [[TxSkelOut]] +perms = case PermutOutTweakMode +mode of + KeepIdentity (Just Int +n) -> \[TxSkelOut] +l -> ([TxSkelOut] -> [TxSkelOut]) -> [[TxSkelOut]] -> [[TxSkelOut]] forall a b. (a -> b) -> [a] -> [b] map ([TxSkelOut] -> [TxSkelOut] -> [TxSkelOut] forall a. [a] -> [a] -> [a] ++ Int -> [TxSkelOut] -> [TxSkelOut] forall a. Int -> [a] -> [a] drop Int -n [TxSkelOut] -l) ([[TxSkelOut]] -> [[TxSkelOut]]) -> [[TxSkelOut]] -> [[TxSkelOut]] +n [TxSkelOut] +l) ([[TxSkelOut]] -> [[TxSkelOut]]) -> [[TxSkelOut]] -> [[TxSkelOut]] forall a b. (a -> b) -> a -> b $ [TxSkelOut] -> [[TxSkelOut]] forall a. Eq a => [a] -> [[a]] distinctPermutations (Int -> [TxSkelOut] -> [TxSkelOut] forall a. Int -> [a] -> [a] take Int -n [TxSkelOut] -l) +n [TxSkelOut] +l) KeepIdentity Maybe Int Nothing -> [TxSkelOut] -> [[TxSkelOut]] forall a. Eq a => [a] -> [[a]] distinctPermutations - OmitIdentity (Just Int -n) -> \[TxSkelOut] -l -> ([TxSkelOut] -> [TxSkelOut]) -> [[TxSkelOut]] -> [[TxSkelOut]] + OmitIdentity (Just Int +n) -> \[TxSkelOut] +l -> ([TxSkelOut] -> [TxSkelOut]) -> [[TxSkelOut]] -> [[TxSkelOut]] forall a b. (a -> b) -> [a] -> [b] map ([TxSkelOut] -> [TxSkelOut] -> [TxSkelOut] forall a. [a] -> [a] -> [a] ++ Int -> [TxSkelOut] -> [TxSkelOut] forall a. Int -> [a] -> [a] drop Int -n [TxSkelOut] -l) ([[TxSkelOut]] -> [[TxSkelOut]]) -> [[TxSkelOut]] -> [[TxSkelOut]] +n [TxSkelOut] +l) ([[TxSkelOut]] -> [[TxSkelOut]]) -> [[TxSkelOut]] -> [[TxSkelOut]] forall a b. (a -> b) -> a -> b $ [TxSkelOut] -> [[TxSkelOut]] forall a. Eq a => [a] -> [[a]] nonIdentityPermutations (Int -> [TxSkelOut] -> [TxSkelOut] forall a. Int -> [a] -> [a] take Int -n [TxSkelOut] -l) +n [TxSkelOut] +l) OmitIdentity Maybe Int Nothing -> [TxSkelOut] -> [[TxSkelOut]] forall a. Eq a => [a] -> [[a]] @@ -118,7 +118,7 @@ -- This is implemented so that duplicate entries in the input list don't give -- rise to duplicate permutations. -distinctPermutations :: Eq a => [a] -> [[a]] +distinctPermutations :: Eq a => [a] -> [[a]] distinctPermutations :: [a] -> [[a]] distinctPermutations = ([a] -> [[a]] -> [[a]]) -> [[a]] -> [[a]] -> [[a]] forall (t :: * -> *) a b. @@ -131,191 +131,191 @@ forall b c a. (b -> c) -> (a -> b) -> a -> c . [a] -> [a] -> [[a]] forall a. [a] -> [a] -> [[a]] -insertSomewhere) [[]] ([[a]] -> [[a]]) -> ([a] -> [[a]]) -> [a] -> [[a]] +insertSomewhere) [[]] ([[a]] -> [[a]]) -> ([a] -> [[a]]) -> [a] -> [[a]] forall b c a. (b -> c) -> (a -> b) -> a -> c . [a] -> [[a]] forall a. Eq a => [a] -> [[a]] -groupEq +groupEq where -- group all equal elements. If we had @Ord a@, we could implement this more -- effifiently as @group . sort@. - groupEq :: Eq a => [a] -> [[a]] - groupEq :: [a] -> [[a]] -groupEq [a] -l = (a -> [a]) -> [a] -> [[a]] + groupEq :: Eq a => [a] -> [[a]] + groupEq :: [a] -> [[a]] +groupEq [a] +l = (a -> [a]) -> [a] -> [[a]] forall a b. (a -> b) -> [a] -> [b] -map (\a -x -> Int -> a -> [a] +map (\a +x -> Int -> a -> [a] forall a. Int -> a -> [a] replicate (a -> [a] -> Int forall a. Eq a => a -> [a] -> Int -count a -x [a] -l) a -x) ([a] -> [[a]]) -> [a] -> [[a]] +count a +x [a] +l) a +x) ([a] -> [[a]]) -> [a] -> [[a]] forall a b. (a -> b) -> a -> b $ [a] -> [a] forall a. Eq a => [a] -> [a] -makeUnique [a] -l +makeUnique [a] +l where - count :: Eq a => a -> [a] -> Int - count :: a -> [a] -> Int -count a + count :: Eq a => a -> [a] -> Int + count :: a -> [a] -> Int +count a _ [] = Int 0 - count a -a (a -b : [a] -bs) = if a -a a -> a -> Bool + count a +a (a +b : [a] +bs) = if a +a a -> a -> Bool forall a. Eq a => a -> a -> Bool /= a -b then a -> [a] -> Int +b then a -> [a] -> Int forall a. Eq a => a -> [a] -> Int -count a -a [a] -bs else Int +count a +a [a] +bs else Int 1 Int -> Int -> Int forall a. Num a => a -> a -> a + a -> [a] -> Int forall a. Eq a => a -> [a] -> Int -count a -a [a] -bs +count a +a [a] +bs - makeUnique :: Eq a => [a] -> [a] - makeUnique :: [a] -> [a] -makeUnique [] = [] - makeUnique (a -x : [a] -xs) = - let xs' :: [a] -xs' = [a] -> [a] + makeUnique :: Eq a => [a] -> [a] + makeUnique :: [a] -> [a] +makeUnique [] = [] + makeUnique (a +x : [a] +xs) = + let xs' :: [a] +xs' = [a] -> [a] forall a. Eq a => [a] -> [a] -makeUnique [a] -xs +makeUnique [a] +xs in if a -x a -> [a] -> Bool +x a -> [a] -> Bool forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool `elem` [a] -xs' then [a] -xs' else a -x a -> [a] -> [a] +xs' then [a] +xs' else a +x a -> [a] -> [a] forall a. a -> [a] -> [a] : [a] -xs' +xs' -- all possibilities to insert elements from the left list into the right -- list - insertSomewhere :: [a] -> [a] -> [[a]] - insertSomewhere :: [a] -> [a] -> [[a]] -insertSomewhere [] [a] -ys = [[a] -ys] - insertSomewhere [a] -xs [] = [[a] -xs] - insertSomewhere l :: [a] -l@(a -x : [a] -xs) r :: [a] -r@(a -y : [a] -ys) = + insertSomewhere :: [a] -> [a] -> [[a]] + insertSomewhere :: [a] -> [a] -> [[a]] +insertSomewhere [] [a] +ys = [[a] +ys] + insertSomewhere [a] +xs [] = [[a] +xs] + insertSomewhere l :: [a] +l@(a +x : [a] +xs) r :: [a] +r@(a +y : [a] +ys) = ([a] -> [a]) -> [[a]] -> [[a]] forall a b. (a -> b) -> [a] -> [b] map (a -x a -> [a] -> [a] +x a -> [a] -> [a] forall a. a -> [a] -> [a] :) ([a] -> [a] -> [[a]] forall a. [a] -> [a] -> [[a]] -insertSomewhere [a] -xs [a] -r) [[a]] -> [[a]] -> [[a]] +insertSomewhere [a] +xs [a] +r) [[a]] -> [[a]] -> [[a]] forall a. [a] -> [a] -> [a] ++ ([a] -> [a]) -> [[a]] -> [[a]] forall a b. (a -> b) -> [a] -> [b] map (a -y a -> [a] -> [a] +y a -> [a] -> [a] forall a. a -> [a] -> [a] :) ([a] -> [a] -> [[a]] forall a. [a] -> [a] -> [[a]] -insertSomewhere [a] -l [a] -ys) +insertSomewhere [a] +l [a] +ys) -nonIdentityPermutations :: Eq a => [a] -> [[a]] +nonIdentityPermutations :: Eq a => [a] -> [[a]] nonIdentityPermutations :: [a] -> [[a]] -nonIdentityPermutations [a] -l = [a] -> [[a]] -> [[a]] +nonIdentityPermutations [a] +l = [a] -> [[a]] -> [[a]] forall a. Eq a => a -> [a] -> [a] -removeFirst [a] -l ([[a]] -> [[a]]) -> [[a]] -> [[a]] +removeFirst [a] +l ([[a]] -> [[a]]) -> [[a]] -> [[a]] forall a b. (a -> b) -> a -> b $ [a] -> [[a]] forall a. Eq a => [a] -> [[a]] distinctPermutations [a] -l +l where - removeFirst :: Eq a => a -> [a] -> [a] - removeFirst :: a -> [a] -> [a] -removeFirst a + removeFirst :: Eq a => a -> [a] -> [a] + removeFirst :: a -> [a] -> [a] +removeFirst a _ [] = [] - removeFirst a -x (a -y : [a] -ys) = if a -x a -> a -> Bool + removeFirst a +x (a +y : [a] +ys) = if a +x a -> a -> Bool forall a. Eq a => a -> a -> Bool == a -y then [a] -ys else a -y a -> [a] -> [a] +y then [a] +ys else a +y a -> [a] -> [a] forall a. a -> [a] -> [a] : a -> [a] -> [a] forall a. Eq a => a -> [a] -> [a] -removeFirst a -x [a] -ys +removeFirst a +x [a] +ys -- | This randomly permutes the outputs of a transaction with a given seed -- Can be used to assess if a certain validator is order-dependant -singleOutPermutTweak :: MonadTweak m => Int -> m () +singleOutPermutTweak :: MonadTweak m => Int -> m () singleOutPermutTweak :: Int -> m () -singleOutPermutTweak Int -seed = do - [TxSkelOut] -outputs <- Optic' A_Lens NoIx TxSkel [TxSkelOut] -> m [TxSkelOut] +singleOutPermutTweak Int +seed = do + [TxSkelOut] +outputs <- Optic' A_Lens NoIx TxSkel [TxSkelOut] -> m [TxSkelOut] forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a viewTweak Optic' A_Lens NoIx TxSkel [TxSkelOut] txSkelOutsL - let outputs' :: [TxSkelOut] -outputs' = [TxSkelOut] -> Int -> StdGen -> [TxSkelOut] + let outputs' :: [TxSkelOut] +outputs' = [TxSkelOut] -> Int -> StdGen -> [TxSkelOut] forall gen a. RandomGen gen => [a] -> Int -> gen -> [a] shuffle' [TxSkelOut] -outputs ([TxSkelOut] -> Int +outputs ([TxSkelOut] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int length [TxSkelOut] -outputs) (Int -> StdGen +outputs) (Int -> StdGen mkStdGen Int -seed) +seed) Bool -> m () forall (f :: * -> *). Alternative f => Bool -> f () guard (Bool -> m ()) -> Bool -> m () forall a b. (a -> b) -> a -> b $ [TxSkelOut] -outputs' [TxSkelOut] -> [TxSkelOut] -> Bool +outputs' [TxSkelOut] -> [TxSkelOut] -> Bool forall a. Eq a => a -> a -> Bool /= [TxSkelOut] -outputs +outputs Optic' A_Lens NoIx TxSkel [TxSkelOut] -> [TxSkelOut] -> m () forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Setter) => Optic' k is TxSkel a -> a -> m () setTweak Optic' A_Lens NoIx TxSkel [TxSkelOut] txSkelOutsL [TxSkelOut] -outputs' +outputs' \ No newline at end of file diff --git a/src/Cooked.Tweak.Signers.html b/src/Cooked.Tweak.Signers.html index 042ed61bd..c7bf4cfc4 100644 --- a/src/Cooked.Tweak.Signers.html +++ b/src/Cooked.Tweak.Signers.html @@ -25,7 +25,7 @@ import Data.List (delete, (\\)) -- | Returns the current list of signers -getSignersTweak :: MonadTweak m => m [Wallet] +getSignersTweak :: MonadTweak m => m [Wallet] getSignersTweak :: m [Wallet] getSignersTweak = Optic' A_Lens NoIx TxSkel [Wallet] -> m [Wallet] forall (m :: * -> *) k (is :: IxList) a. @@ -35,12 +35,12 @@ txSkelSignersL -- | Apply a function to the list of signers and return the old ones -modifySignersTweak :: MonadTweak m => ([Wallet] -> [Wallet]) -> m [Wallet] +modifySignersTweak :: MonadTweak m => ([Wallet] -> [Wallet]) -> m [Wallet] modifySignersTweak :: ([Wallet] -> [Wallet]) -> m [Wallet] -modifySignersTweak [Wallet] -> [Wallet] -f = do - [Wallet] -oldSigners <- m [Wallet] +modifySignersTweak [Wallet] -> [Wallet] +f = do + [Wallet] +oldSigners <- m [Wallet] forall (m :: * -> *). MonadTweak m => m [Wallet] getSignersTweak Optic' A_Lens NoIx TxSkel [Wallet] -> [Wallet] -> m () @@ -49,15 +49,15 @@ Optic' k is TxSkel a -> a -> m () setTweak Optic' A_Lens NoIx TxSkel [Wallet] txSkelSignersL ([Wallet] -> [Wallet] -f [Wallet] -oldSigners) +f [Wallet] +oldSigners) [Wallet] -> m [Wallet] forall (m :: * -> *) a. Monad m => a -> m a return [Wallet] -oldSigners +oldSigners -- | Change the current signers and return the old ones -setSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet] +setSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet] setSignersTweak :: [Wallet] -> m [Wallet] setSignersTweak = ([Wallet] -> [Wallet]) -> m [Wallet] forall (m :: * -> *). @@ -71,7 +71,7 @@ const -- | Check if the signers satisfy a certain predicate -signersSatisfyTweak :: MonadTweak m => ([Wallet] -> Bool) -> m Bool +signersSatisfyTweak :: MonadTweak m => ([Wallet] -> Bool) -> m Bool signersSatisfyTweak :: ([Wallet] -> Bool) -> m Bool signersSatisfyTweak = (([Wallet] -> Bool) -> m [Wallet] -> m Bool forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b @@ -80,7 +80,7 @@ getSignersTweak) -- | Check if a wallet signs a transaction -isSignerTweak :: MonadTweak m => Wallet -> m Bool +isSignerTweak :: MonadTweak m => Wallet -> m Bool isSignerTweak :: Wallet -> m Bool isSignerTweak = ([Wallet] -> Bool) -> m Bool forall (m :: * -> *). MonadTweak m => ([Wallet] -> Bool) -> m Bool @@ -92,7 +92,7 @@ elem -- | Check if the transaction has at least a signer -hasSignersTweak :: MonadTweak m => m Bool +hasSignersTweak :: MonadTweak m => m Bool hasSignersTweak :: m Bool hasSignersTweak = ([Wallet] -> Bool) -> m Bool forall (m :: * -> *). MonadTweak m => ([Wallet] -> Bool) -> m Bool @@ -105,7 +105,7 @@ -- | Add a signer to the transaction, at the head of the list of signers, and -- return the old list of signers -addFirstSignerTweak :: MonadTweak m => Wallet -> m [Wallet] +addFirstSignerTweak :: MonadTweak m => Wallet -> m [Wallet] addFirstSignerTweak :: Wallet -> m [Wallet] addFirstSignerTweak = ([Wallet] -> [Wallet]) -> m [Wallet] forall (m :: * -> *). @@ -118,7 +118,7 @@ -- | Add signers at the end of the list of signers, and return the old list of -- signers -addSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet] +addSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet] addSignersTweak :: [Wallet] -> m [Wallet] addSignersTweak = ([Wallet] -> [Wallet]) -> m [Wallet] forall (m :: * -> *). @@ -133,7 +133,7 @@ -- | Add a signer to the transaction, at the end of the list of signers, and -- return the old list of signers -addLastSignerTweak :: MonadTweak m => Wallet -> m [Wallet] +addLastSignerTweak :: MonadTweak m => Wallet -> m [Wallet] addLastSignerTweak :: Wallet -> m [Wallet] addLastSignerTweak = [Wallet] -> m [Wallet] forall (m :: * -> *). MonadTweak m => [Wallet] -> m [Wallet] @@ -145,7 +145,7 @@ : []) -- | Remove signers from the transaction and return the old list of signers -removeSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet] +removeSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet] removeSignersTweak :: [Wallet] -> m [Wallet] removeSignersTweak = ([Wallet] -> [Wallet]) -> m [Wallet] forall (m :: * -> *). @@ -159,7 +159,7 @@ (\\) -- | Remove a signer from the transaction and return the old list of signers -removeSignerTweak :: MonadTweak m => Wallet -> m [Wallet] +removeSignerTweak :: MonadTweak m => Wallet -> m [Wallet] removeSignerTweak :: Wallet -> m [Wallet] removeSignerTweak = ([Wallet] -> [Wallet]) -> m [Wallet] forall (m :: * -> *). @@ -174,7 +174,7 @@ -- | Changes the first signer (adds it if there are no signers) and return the -- old list of signers. -replaceFirstSignerTweak :: MonadTweak m => Wallet -> m [Wallet] +replaceFirstSignerTweak :: MonadTweak m => Wallet -> m [Wallet] replaceFirstSignerTweak :: Wallet -> m [Wallet] replaceFirstSignerTweak = ([Wallet] -> [Wallet]) -> m [Wallet] @@ -185,16 +185,16 @@ (([Wallet] -> [Wallet]) -> m [Wallet]) -> (Wallet -> [Wallet] -> [Wallet]) -> Wallet -> m [Wallet] forall b c a. (b -> c) -> (a -> b) -> a -> c -. ( \Wallet -newSigner -> \case +. ( \Wallet +newSigner -> \case [] -> [Wallet -newSigner] +newSigner] (Wallet -_ : [Wallet] -ss) -> Wallet -newSigner Wallet -> [Wallet] -> [Wallet] +_ : [Wallet] +ss) -> Wallet +newSigner Wallet -> [Wallet] -> [Wallet] forall a. a -> [a] -> [a] : [Wallet] -ss +ss ) \ No newline at end of file diff --git a/src/Cooked.Tweak.TamperDatum.html b/src/Cooked.Tweak.TamperDatum.html index 5d14210eb..bff10d858 100644 --- a/src/Cooked.Tweak.TamperDatum.html +++ b/src/Cooked.Tweak.TamperDatum.html @@ -29,24 +29,24 @@ -- The tweak returns a list of the modified datums, as they were *before* the -- modification was applied to them. tamperDatumTweak :: - forall a m. - ( MonadTweak m, - Show a, - PrettyCooked a, - Pl.ToData a, - Pl.FromData a, - Typeable a + forall a m. + ( MonadTweak m, + Show a, + PrettyCooked a, + Pl.ToData a, + Pl.FromData a, + Typeable a ) => -- | Use this function to return 'Just' the changed datum, if you want to -- perform a change, and 'Nothing', if you want to leave it as-is. All datums -- on outputs not paying to a validator of type @a@ are never touched. - (a -> Maybe a) -> - m [a] + (a -> Maybe a) -> + m [a] tamperDatumTweak :: (a -> Maybe a) -> m [a] -tamperDatumTweak a -> Maybe a -change = do - [a] -beforeModification <- +tamperDatumTweak a -> Maybe a +change = do + [a] +beforeModification <- Optic' A_Traversal '[] TxSkel a -> (a -> Maybe a) -> m [a] forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Traversal) => @@ -77,10 +77,10 @@ % (FromData a, Typeable a) => Optic An_AffineTraversal '[] TxSkelOut TxSkelOut a a forall a. (FromData a, Typeable a) => AffineTraversal' TxSkelOut a -txSkelOutputDatumTypeAT @a +txSkelOutputDatumTypeAT @a ) a -> Maybe a -change +change Bool -> m () forall (f :: * -> *). Alternative f => Bool -> f () guard (Bool -> m ()) -> ([a] -> Bool) -> [a] -> m () @@ -93,7 +93,7 @@ null ([a] -> m ()) -> [a] -> m () forall a b. (a -> b) -> a -> b $ [a] -beforeModification +beforeModification TamperDatumLbl -> m () forall (m :: * -> *) x. (MonadTweak m, LabelConstrs x) => x -> m () addLabelTweak TamperDatumLbl @@ -101,9 +101,9 @@ [a] -> m [a] forall (m :: * -> *) a. Monad m => a -> m a return [a] -beforeModification +beforeModification -data TamperDatumLbl = TamperDatumLbl deriving (Int -> TamperDatumLbl -> ShowS +data TamperDatumLbl = TamperDatumLbl deriving (Int -> TamperDatumLbl -> ShowS [TamperDatumLbl] -> ShowS TamperDatumLbl -> String (Int -> TamperDatumLbl -> ShowS) @@ -118,7 +118,7 @@ $cshow :: TamperDatumLbl -> String showsPrec :: Int -> TamperDatumLbl -> ShowS $cshowsPrec :: Int -> TamperDatumLbl -> ShowS -Show, TamperDatumLbl -> TamperDatumLbl -> Bool +Show, TamperDatumLbl -> TamperDatumLbl -> Bool (TamperDatumLbl -> TamperDatumLbl -> Bool) -> (TamperDatumLbl -> TamperDatumLbl -> Bool) -> Eq TamperDatumLbl forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a @@ -126,7 +126,7 @@ $c/= :: TamperDatumLbl -> TamperDatumLbl -> Bool == :: TamperDatumLbl -> TamperDatumLbl -> Bool $c== :: TamperDatumLbl -> TamperDatumLbl -> Bool -Eq, Eq TamperDatumLbl +Eq, Eq TamperDatumLbl Eq TamperDatumLbl -> (TamperDatumLbl -> TamperDatumLbl -> Ordering) -> (TamperDatumLbl -> TamperDatumLbl -> Bool) @@ -184,19 +184,19 @@ -- -- modified transactions. malformDatumTweak :: - forall a m. - ( MonadTweak m, - Pl.ToData a, - Pl.FromData a, - Typeable a + forall a m. + ( MonadTweak m, + Pl.ToData a, + Pl.FromData a, + Typeable a ) => - (a -> [Pl.BuiltinData]) -> - m () + (a -> [Pl.BuiltinData]) -> + m () malformDatumTweak :: (a -> [BuiltinData]) -> m () -malformDatumTweak a -> [BuiltinData] -change = do - [TxSkelOut] -outputs <- Optic A_Traversal '[] TxSkel TxSkel TxSkelOut TxSkelOut +malformDatumTweak a -> [BuiltinData] +change = do + [TxSkelOut] +outputs <- Optic A_Traversal '[] TxSkel TxSkel TxSkelOut TxSkelOut -> m [TxSkelOut] forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Fold) => @@ -215,28 +215,28 @@ Traversable t => Traversal (t a) (t b) a b traversed) - let modifiedOutputs :: [[TxSkelOut]] -modifiedOutputs = (TxSkelOut -> [TxSkelOut]) -> [TxSkelOut] -> [[TxSkelOut]] + let modifiedOutputs :: [[TxSkelOut]] +modifiedOutputs = (TxSkelOut -> [TxSkelOut]) -> [TxSkelOut] -> [[TxSkelOut]] forall a b. (a -> b) -> [a] -> [b] -map (\TxSkelOut -output -> TxSkelOut -output TxSkelOut -> [TxSkelOut] -> [TxSkelOut] +map (\TxSkelOut +output -> TxSkelOut +output TxSkelOut -> [TxSkelOut] -> [TxSkelOut] forall a. a -> [a] -> [a] : TxSkelOut -> [TxSkelOut] -changeOutput TxSkelOut -output) [TxSkelOut] -outputs +changeOutput TxSkelOut +output) [TxSkelOut] +outputs -- We remove the first combination because it consists of all the heads -- and therefore it is the combination consisting of no changes at all. - modifiedOutputGroups :: [[TxSkelOut]] -modifiedOutputGroups = [[TxSkelOut]] -> [[TxSkelOut]] + modifiedOutputGroups :: [[TxSkelOut]] +modifiedOutputGroups = [[TxSkelOut]] -> [[TxSkelOut]] forall a. [a] -> [a] tail ([[TxSkelOut]] -> [[TxSkelOut]]) -> [[TxSkelOut]] -> [[TxSkelOut]] forall a b. (a -> b) -> a -> b $ [[TxSkelOut]] -> [[TxSkelOut]] forall a. [[a]] -> [[a]] allCombinations [[TxSkelOut]] -modifiedOutputs +modifiedOutputs [m ()] -> m () forall (t :: * -> *) (m :: * -> *) a. (Foldable t, MonadPlus m) => @@ -251,19 +251,19 @@ Optic' k is TxSkel a -> a -> m () setTweak Lens' TxSkel [TxSkelOut] txSkelOutsL) [[TxSkelOut]] -modifiedOutputGroups +modifiedOutputGroups MalformDatumLbl -> m () forall (m :: * -> *) x. (MonadTweak m, LabelConstrs x) => x -> m () addLabelTweak MalformDatumLbl MalformDatumLbl where - changeOutput :: TxSkelOut -> [TxSkelOut] - changeOutput :: TxSkelOut -> [TxSkelOut] -changeOutput (Pays o -out) = - let datums :: [TxSkelOutDatum] -datums = TxSkelOutDatum -> [TxSkelOutDatum] -changeTxSkelOutDatum (TxSkelOutDatum -> [TxSkelOutDatum]) + changeOutput :: TxSkelOut -> [TxSkelOut] + changeOutput :: TxSkelOut -> [TxSkelOut] +changeOutput (Pays o +out) = + let datums :: [TxSkelOutDatum] +datums = TxSkelOutDatum -> [TxSkelOutDatum] +changeTxSkelOutDatum (TxSkelOutDatum -> [TxSkelOutDatum]) -> TxSkelOutDatum -> [TxSkelOutDatum] forall a b. (a -> b) -> a -> b $ Optic' A_Lens '[] o TxSkelOutDatum -> o -> TxSkelOutDatum @@ -273,12 +273,12 @@ view Optic' A_Lens '[] o TxSkelOutDatum forall o. IsAbstractOutput o => Lens' o (DatumType o) outputDatumL o -out +out in (TxSkelOutDatum -> TxSkelOut) -> [TxSkelOutDatum] -> [TxSkelOut] forall a b. (a -> b) -> [a] -> [b] map - ( \TxSkelOutDatum -datum -> + ( \TxSkelOutDatum +datum -> ConcreteOutput (OwnerType o) TxSkelOutDatum Value (ReferenceScriptType o) -> TxSkelOut @@ -314,7 +314,7 @@ -> ConcreteOutput ownerType datumType valueType referenceScriptType ConcreteOutput (o -out o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o +out o -> Optic' A_Lens '[] o (OwnerType o) -> OwnerType o forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -322,7 +322,7 @@ forall o. IsAbstractOutput o => Lens' o (OwnerType o) outputOwnerL) (o -out o +out o -> Optic' A_Lens '[] o (Maybe StakingCredential) -> Maybe StakingCredential forall k s (is :: IxList) a. @@ -332,7 +332,7 @@ forall o. IsAbstractOutput o => Lens' o (Maybe StakingCredential) outputStakingCredentialL) (o -out o -> Optic' A_Lens '[] o Value -> Value +out o -> Optic' A_Lens '[] o Value -> Value forall k s (is :: IxList) a. Is k A_Getter => s -> Optic' k is s a -> a @@ -340,9 +340,9 @@ forall o. IsAbstractOutput o => Lens' o (ValueType o) outputValueL) TxSkelOutDatum -datum +datum (o -out o +out o -> Optic' A_Lens '[] o (Maybe (ReferenceScriptType o)) -> Maybe (ReferenceScriptType o) forall k s (is :: IxList) a. @@ -355,14 +355,14 @@ outputReferenceScriptL) ) [TxSkelOutDatum] -datums +datums - changeTxSkelOutDatum :: TxSkelOutDatum -> [TxSkelOutDatum] - changeTxSkelOutDatum :: TxSkelOutDatum -> [TxSkelOutDatum] -changeTxSkelOutDatum TxSkelOutDatum + changeTxSkelOutDatum :: TxSkelOutDatum -> [TxSkelOutDatum] + changeTxSkelOutDatum :: TxSkelOutDatum -> [TxSkelOutDatum] +changeTxSkelOutDatum TxSkelOutDatum TxSkelOutNoDatum = [] - changeTxSkelOutDatum (TxSkelOutDatum a -datum) = (BuiltinData -> TxSkelOutDatum) + changeTxSkelOutDatum (TxSkelOutDatum a +datum) = (BuiltinData -> TxSkelOutDatum) -> [BuiltinData] -> [TxSkelOutDatum] forall a b. (a -> b) -> [a] -> [b] map BuiltinData -> TxSkelOutDatum @@ -372,10 +372,10 @@ forall a b. (a -> b) -> a -> b $ a -> [BuiltinData] forall b. Typeable b => b -> [BuiltinData] -changeOnCorrectType a -datum - changeTxSkelOutDatum (TxSkelOutDatumHash a -datum) = (BuiltinData -> TxSkelOutDatum) +changeOnCorrectType a +datum + changeTxSkelOutDatum (TxSkelOutDatumHash a +datum) = (BuiltinData -> TxSkelOutDatum) -> [BuiltinData] -> [TxSkelOutDatum] forall a b. (a -> b) -> [a] -> [b] map BuiltinData -> TxSkelOutDatum @@ -385,10 +385,10 @@ forall a b. (a -> b) -> a -> b $ a -> [BuiltinData] forall b. Typeable b => b -> [BuiltinData] -changeOnCorrectType a -datum - changeTxSkelOutDatum (TxSkelOutInlineDatum a -datum) = (BuiltinData -> TxSkelOutDatum) +changeOnCorrectType a +datum + changeTxSkelOutDatum (TxSkelOutInlineDatum a +datum) = (BuiltinData -> TxSkelOutDatum) -> [BuiltinData] -> [TxSkelOutDatum] forall a b. (a -> b) -> [a] -> [b] map BuiltinData -> TxSkelOutDatum @@ -398,30 +398,30 @@ forall a b. (a -> b) -> a -> b $ a -> [BuiltinData] forall b. Typeable b => b -> [BuiltinData] -changeOnCorrectType a -datum +changeOnCorrectType a +datum - changeOnCorrectType :: Typeable b => b -> [Pl.BuiltinData] - changeOnCorrectType :: b -> [BuiltinData] -changeOnCorrectType b -datum = case b -> TypeRep b + changeOnCorrectType :: Typeable b => b -> [Pl.BuiltinData] + changeOnCorrectType :: b -> [BuiltinData] +changeOnCorrectType b +datum = case b -> TypeRep b forall a. Typeable a => a -> TypeRep a typeOf b -datum TypeRep b -> TypeRep a -> Maybe (b :~~: a) +datum TypeRep b -> TypeRep a -> Maybe (b :~~: a) forall k1 k2 (a :: k1) (b :: k2). TypeRep a -> TypeRep b -> Maybe (a :~~: b) `eqTypeRep` (Typeable a => TypeRep a forall k (a :: k). Typeable a => TypeRep a -typeRep @a) of +typeRep @a) of Just b :~~: a HRefl -> a -> [BuiltinData] -change a +change a b -datum +datum Maybe (b :~~: a) Nothing -> [] -data MalformDatumLbl = MalformDatumLbl deriving (Int -> MalformDatumLbl -> ShowS +data MalformDatumLbl = MalformDatumLbl deriving (Int -> MalformDatumLbl -> ShowS [MalformDatumLbl] -> ShowS MalformDatumLbl -> String (Int -> MalformDatumLbl -> ShowS) @@ -436,7 +436,7 @@ $cshow :: MalformDatumLbl -> String showsPrec :: Int -> MalformDatumLbl -> ShowS $cshowsPrec :: Int -> MalformDatumLbl -> ShowS -Show, MalformDatumLbl -> MalformDatumLbl -> Bool +Show, MalformDatumLbl -> MalformDatumLbl -> Bool (MalformDatumLbl -> MalformDatumLbl -> Bool) -> (MalformDatumLbl -> MalformDatumLbl -> Bool) -> Eq MalformDatumLbl @@ -445,7 +445,7 @@ $c/= :: MalformDatumLbl -> MalformDatumLbl -> Bool == :: MalformDatumLbl -> MalformDatumLbl -> Bool $c== :: MalformDatumLbl -> MalformDatumLbl -> Bool -Eq, Eq MalformDatumLbl +Eq, Eq MalformDatumLbl Eq MalformDatumLbl -> (MalformDatumLbl -> MalformDatumLbl -> Ordering) -> (MalformDatumLbl -> MalformDatumLbl -> Bool) @@ -503,21 +503,21 @@ -- and @a1@ comes before @a2@ in the list @l !! length p@. In particular, the -- first element of the result list is the combination consisting of all the -- first elements of the input lists. -allCombinations :: [[a]] -> [[a]] +allCombinations :: [[a]] -> [[a]] allCombinations :: [[a]] -> [[a]] allCombinations [] = [[]] allCombinations [[]] = [] -- included in the next one -allCombinations ([a] -first : [[a]] -rest) = [a -x a -> [a] -> [a] +allCombinations ([a] +first : [[a]] +rest) = [a +x a -> [a] -> [a] forall a. a -> [a] -> [a] : [a] -xs | a -x <- [a] -first, [a] -xs <- [[a]] -> [[a]] +xs | a +x <- [a] +first, [a] +xs <- [[a]] -> [[a]] forall a. [[a]] -> [[a]] allCombinations [[a]] -rest] +rest] \ No newline at end of file diff --git a/src/Cooked.Tweak.ValidityRange.html b/src/Cooked.Tweak.ValidityRange.html index bdec0afbc..82116b869 100644 --- a/src/Cooked.Tweak.ValidityRange.html +++ b/src/Cooked.Tweak.ValidityRange.html @@ -9,7 +9,7 @@ import Plutus.V1.Ledger.Interval (before, contains, intersection, interval, isEmpty, member, never, singleton) import Plutus.V2.Ledger.Api (Extended (Finite), LowerBound (LowerBound), always, ivFrom) -getValidityRangeTweak :: MonadTweak m => m SlotRange +getValidityRangeTweak :: MonadTweak m => m SlotRange getValidityRangeTweak :: m SlotRange getValidityRangeTweak = Optic' A_Lens NoIx TxSkel SlotRange -> m SlotRange forall (m :: * -> *) k (is :: IxList) a. @@ -19,12 +19,12 @@ txSkelValidityRangeL -- | Changes the current validity range, returning the old one -setValidityRangeTweak :: MonadTweak m => SlotRange -> m SlotRange +setValidityRangeTweak :: MonadTweak m => SlotRange -> m SlotRange setValidityRangeTweak :: SlotRange -> m SlotRange -setValidityRangeTweak SlotRange -newRange = do - SlotRange -oldRange <- m SlotRange +setValidityRangeTweak SlotRange +newRange = do + SlotRange +oldRange <- m SlotRange forall (m :: * -> *). MonadTweak m => m SlotRange getValidityRangeTweak Optic' A_Lens NoIx TxSkel SlotRange -> SlotRange -> m () @@ -33,14 +33,14 @@ Optic' k is TxSkel a -> a -> m () setTweak Optic' A_Lens NoIx TxSkel SlotRange txSkelValidityRangeL SlotRange -newRange +newRange SlotRange -> m SlotRange forall (m :: * -> *) a. Monad m => a -> m a return SlotRange -oldRange +oldRange -- | Ensures the skeleton makes for an unconstrained validity range -setAlwaysValidRangeTweak :: MonadTweak m => m SlotRange +setAlwaysValidRangeTweak :: MonadTweak m => m SlotRange setAlwaysValidRangeTweak :: m SlotRange setAlwaysValidRangeTweak = SlotRange -> m SlotRange forall (m :: * -> *). MonadTweak m => SlotRange -> m SlotRange @@ -49,7 +49,7 @@ always -- | Checks if the validity range satisfies a certain predicate -validityRangeSatisfiesTweak :: MonadTweak m => (SlotRange -> Bool) -> m Bool +validityRangeSatisfiesTweak :: MonadTweak m => (SlotRange -> Bool) -> m Bool validityRangeSatisfiesTweak :: (SlotRange -> Bool) -> m Bool validityRangeSatisfiesTweak = ((SlotRange -> Bool) -> m SlotRange -> m Bool forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b @@ -58,7 +58,7 @@ getValidityRangeTweak) -- | Checks if a given time belongs to the validity range of a transaction -isValidAtTweak :: MonadTweak m => Slot -> m Bool +isValidAtTweak :: MonadTweak m => Slot -> m Bool isValidAtTweak :: Slot -> m Bool isValidAtTweak = (SlotRange -> Bool) -> m Bool forall (m :: * -> *). MonadTweak m => (SlotRange -> Bool) -> m Bool @@ -70,7 +70,7 @@ member -- | Checks if the current validity range includes the current time -isValidNowTweak :: MonadTweak m => m Bool +isValidNowTweak :: MonadTweak m => m Bool isValidNowTweak :: m Bool isValidNowTweak = m Slot forall (m :: * -> *). MonadBlockChainWithoutValidation m => m Slot @@ -81,7 +81,7 @@ isValidAtTweak -- | Checks if a given range is included in the validity range of a transaction -isValidDuringTweak :: MonadTweak m => SlotRange -> m Bool +isValidDuringTweak :: MonadTweak m => SlotRange -> m Bool isValidDuringTweak :: SlotRange -> m Bool isValidDuringTweak = (SlotRange -> Bool) -> m Bool forall (m :: * -> *). MonadTweak m => (SlotRange -> Bool) -> m Bool @@ -95,7 +95,7 @@ contains -- | Checks if the validity range is empty -hasEmptyTimeRangeTweak :: MonadTweak m => m Bool +hasEmptyTimeRangeTweak :: MonadTweak m => m Bool hasEmptyTimeRangeTweak :: m Bool hasEmptyTimeRangeTweak = (SlotRange -> Bool) -> m Bool forall (m :: * -> *). MonadTweak m => (SlotRange -> Bool) -> m Bool @@ -104,7 +104,7 @@ isEmpty -- | Checks if the validity range is unconstrained -hasFullTimeRangeTweak :: MonadTweak m => m Bool +hasFullTimeRangeTweak :: MonadTweak m => m Bool hasFullTimeRangeTweak :: m Bool hasFullTimeRangeTweak = (SlotRange -> Bool) -> m Bool forall (m :: * -> *). MonadTweak m => (SlotRange -> Bool) -> m Bool @@ -116,27 +116,27 @@ -- | Adds a constraint to the current validity range -- Returns the old range, and fails is the resulting interval is empty -intersectValidityRangeTweak :: MonadTweak m => SlotRange -> m SlotRange +intersectValidityRangeTweak :: MonadTweak m => SlotRange -> m SlotRange intersectValidityRangeTweak :: SlotRange -> m SlotRange -intersectValidityRangeTweak SlotRange -newRange = do - SlotRange -oldRange <- Optic' A_Lens NoIx TxSkel SlotRange -> m SlotRange +intersectValidityRangeTweak SlotRange +newRange = do + SlotRange +oldRange <- Optic' A_Lens NoIx TxSkel SlotRange -> m SlotRange forall (m :: * -> *) k (is :: IxList) a. (MonadTweak m, Is k A_Getter) => Optic' k is TxSkel a -> m a viewTweak Optic' A_Lens NoIx TxSkel SlotRange txSkelValidityRangeL - let combinedRange :: SlotRange -combinedRange = SlotRange -> SlotRange -> SlotRange + let combinedRange :: SlotRange +combinedRange = SlotRange -> SlotRange -> SlotRange forall a. Ord a => Interval a -> Interval a -> Interval a intersection SlotRange -newRange SlotRange -oldRange +newRange SlotRange +oldRange Bool -> m () forall (f :: * -> *). Alternative f => Bool -> f () guard (SlotRange -combinedRange SlotRange -> SlotRange -> Bool +combinedRange SlotRange -> SlotRange -> Bool forall a. Eq a => a -> a -> Bool /= SlotRange forall a. Interval a @@ -147,47 +147,47 @@ Optic' k is TxSkel a -> a -> m () setTweak Optic' A_Lens NoIx TxSkel SlotRange txSkelValidityRangeL SlotRange -combinedRange +combinedRange SlotRange -> m SlotRange forall (m :: * -> *) a. Monad m => a -> m a return SlotRange -oldRange +oldRange -- | Centers the validity range around a value with a certain radius -centerAroundValidityRangeTweak :: MonadTweak m => Slot -> Integer -> m SlotRange +centerAroundValidityRangeTweak :: MonadTweak m => Slot -> Integer -> m SlotRange centerAroundValidityRangeTweak :: Slot -> Integer -> m SlotRange -centerAroundValidityRangeTweak Slot -t Integer -r = do - let radius :: Slot -radius = Integer -> Slot +centerAroundValidityRangeTweak Slot +t Integer +r = do + let radius :: Slot +radius = Integer -> Slot Slot Integer -r - left :: Slot -left = Slot -t Slot -> Slot -> Slot +r + left :: Slot +left = Slot +t Slot -> Slot -> Slot forall a. Num a => a -> a -> a - Slot -radius - right :: Slot -right = Slot -t Slot -> Slot -> Slot +radius + right :: Slot +right = Slot +t Slot -> Slot -> Slot forall a. Num a => a -> a -> a + Slot -radius - newRange :: SlotRange -newRange = Slot -> Slot -> SlotRange +radius + newRange :: SlotRange +newRange = Slot -> Slot -> SlotRange forall a. a -> a -> Interval a interval Slot -left Slot -right +left Slot +right SlotRange -> m SlotRange forall (m :: * -> *). MonadTweak m => SlotRange -> m SlotRange setValidityRangeTweak SlotRange -newRange +newRange -- | Makes a transaction range equal to a singleton -makeValidityRangeSingletonTweak :: MonadTweak m => Slot -> m SlotRange +makeValidityRangeSingletonTweak :: MonadTweak m => Slot -> m SlotRange makeValidityRangeSingletonTweak :: Slot -> m SlotRange makeValidityRangeSingletonTweak = SlotRange -> m SlotRange forall (m :: * -> *). MonadTweak m => SlotRange -> m SlotRange @@ -199,7 +199,7 @@ singleton -- | Makes the transaction validity range comply with the current time -makeValidityRangeNowTweak :: MonadTweak m => m SlotRange +makeValidityRangeNowTweak :: MonadTweak m => m SlotRange makeValidityRangeNowTweak :: m SlotRange makeValidityRangeNowTweak = m Slot forall (m :: * -> *). MonadBlockChainWithoutValidation m => m Slot @@ -212,26 +212,26 @@ -- | Makes current time comply with the validity range of the transaction under -- modification. Returns the new current time after the modification; fails if -- current time is already after the validity range. -waitUntilValidTweak :: MonadTweak m => m Slot +waitUntilValidTweak :: MonadTweak m => m Slot waitUntilValidTweak :: m Slot waitUntilValidTweak = do - Slot -now <- m Slot + Slot +now <- m Slot forall (m :: * -> *). MonadBlockChainWithoutValidation m => m Slot currentSlot - SlotRange -vRange <- m SlotRange + SlotRange +vRange <- m SlotRange forall (m :: * -> *). MonadTweak m => m SlotRange getValidityRangeTweak if Slot -> SlotRange -> Bool forall a. Ord a => a -> Interval a -> Bool member Slot -now SlotRange -vRange +now SlotRange +vRange then Slot -> m Slot forall (m :: * -> *) a. Monad m => a -> m a return Slot -now +now else do Bool -> m () forall (f :: * -> *). Alternative f => Bool -> f () @@ -240,8 +240,8 @@ $ Slot -> SlotRange -> Bool forall a. Ord a => a -> Interval a -> Bool before Slot -now SlotRange -vRange +now SlotRange +vRange Bool -> m () forall (f :: * -> *). Alternative f => Bool -> f () guard (Bool -> m ()) -> Bool -> m () @@ -252,21 +252,21 @@ $ SlotRange -> Bool forall a. (Enum a, Ord a) => Interval a -> Bool isEmpty SlotRange -vRange - Slot -later <- case SlotRange -> LowerBound Slot +vRange + Slot +later <- case SlotRange -> LowerBound Slot forall a. Interval a -> LowerBound a ivFrom SlotRange -vRange of - LowerBound (Finite Slot -left) Bool -isClosed -> +vRange of + LowerBound (Finite Slot +left) Bool +isClosed -> Slot -> m Slot forall (m :: * -> *) a. Monad m => a -> m a return (Slot -> m Slot) -> Slot -> m Slot forall a b. (a -> b) -> a -> b $ Slot -left Slot -> Slot -> Slot +left Slot -> Slot -> Slot forall a. Num a => a -> a -> a + Integer -> Slot Slot (Int -> Integer @@ -279,7 +279,7 @@ forall a b. (a -> b) -> a -> b $ Bool -> Bool not Bool -isClosed) +isClosed) LowerBound Slot _ -> [Char] -> m Slot forall a. HasCallStack => [Char] -> a @@ -294,9 +294,9 @@ MonadBlockChainWithoutValidation m => Slot -> m Slot awaitSlot Slot -later +later Slot -> m Slot forall (m :: * -> *) a. Monad m => a -> m a return Slot -later +later \ No newline at end of file diff --git a/src/Cooked.ValueUtils.html b/src/Cooked.ValueUtils.html index 46b9b20d9..5cad372d6 100644 --- a/src/Cooked.ValueUtils.html +++ b/src/Cooked.ValueUtils.html @@ -25,14 +25,14 @@ -> [(CurrencySymbol, TokenName, Integer)] -> [(AssetClass, Integer)] forall a b. (a -> b) -> [a] -> [b] -map (\(CurrencySymbol -cSymbol, TokenName -tName, Integer -amount) -> (CurrencySymbol -> TokenName -> AssetClass +map (\(CurrencySymbol +cSymbol, TokenName +tName, Integer +amount) -> (CurrencySymbol -> TokenName -> AssetClass Pl.assetClass CurrencySymbol -cSymbol TokenName -tName, Integer -amount)) ([(CurrencySymbol, TokenName, Integer)] -> [(AssetClass, Integer)]) +cSymbol TokenName +tName, Integer +amount)) ([(CurrencySymbol, TokenName, Integer)] -> [(AssetClass, Integer)]) -> (Value -> [(CurrencySymbol, TokenName, Integer)]) -> Value -> [(AssetClass, Integer)] @@ -44,16 +44,16 @@ forall (t :: * -> *) b a. Foldable t => (b -> a -> b) -> b -> t a -> b -foldl' (\Value -v (AssetClass -ac, Integer -amount) -> Value -v Value -> Value -> Value +foldl' (\Value +v (AssetClass +ac, Integer +amount) -> Value +v Value -> Value -> Value forall a. Semigroup a => a -> a -> a <> AssetClass -> Integer -> Value Pl.assetClassValue AssetClass -ac Integer -amount) Value +ac Integer +amount) Value forall a. Monoid a => a mempty) @@ -116,9 +116,9 @@ lens Value -> Ada Pl.fromValue - ( \Value -value (Pl.Lovelace Integer -ada) -> + ( \Value +value (Pl.Lovelace Integer +ada) -> Iso' Value [(AssetClass, Integer)] -> ([(AssetClass, Integer)] -> [(AssetClass, Integer)]) -> Value @@ -129,38 +129,38 @@ over Iso' Value [(AssetClass, Integer)] flattenValueI - (\[(AssetClass, Integer)] -l -> [(AssetClass, Integer)] + (\[(AssetClass, Integer)] +l -> [(AssetClass, Integer)] -> AssetClass -> Integer -> [(AssetClass, Integer)] forall a b. Eq a => [(a, b)] -> a -> b -> [(a, b)] -insertAssocList [(AssetClass, Integer)] -l (CurrencySymbol -> TokenName -> AssetClass +insertAssocList [(AssetClass, Integer)] +l (CurrencySymbol -> TokenName -> AssetClass Pl.assetClass CurrencySymbol Pl.adaSymbol TokenName Pl.adaToken) Integer -ada) +ada) Value -value +value ) where - insertAssocList :: Eq a => [(a, b)] -> a -> b -> [(a, b)] - insertAssocList :: [(a, b)] -> a -> b -> [(a, b)] -insertAssocList [(a, b)] -l a -a b -b = (a -a, b -b) (a, b) -> [(a, b)] -> [(a, b)] + insertAssocList :: Eq a => [(a, b)] -> a -> b -> [(a, b)] + insertAssocList :: [(a, b)] -> a -> b -> [(a, b)] +insertAssocList [(a, b)] +l a +a b +b = (a +a, b +b) (a, b) -> [(a, b)] -> [(a, b)] forall a. a -> [a] -> [a] : ((a, b) -> Bool) -> [(a, b)] -> [(a, b)] forall a. (a -> Bool) -> [a] -> [a] filter ((a -> a -> Bool forall a. Eq a => a -> a -> Bool /= a -a) (a -> Bool) -> ((a, b) -> a) -> (a, b) -> Bool +a) (a -> Bool) -> ((a, b) -> a) -> (a, b) -> Bool forall b c a. (b -> c) -> (a -> b) -> a -> c . (a, b) -> a forall a b. (a, b) -> a fst) [(a, b)] -l +l \ No newline at end of file diff --git a/src/Cooked.Wallet.html b/src/Cooked.Wallet.html index 8dd84dc84..c2720ae7d 100644 --- a/src/Cooked.Wallet.html +++ b/src/Cooked.Wallet.html @@ -52,8 +52,8 @@ type PrivateKey = Cardano.XPrv -instance Eq Wallet where - == :: Wallet -> Wallet -> Bool +instance Eq Wallet where + == :: Wallet -> Wallet -> Bool (==) = Digest Blake2b_160 -> Digest Blake2b_160 -> Bool forall a. Eq a => a -> a -> Bool (==) (Digest Blake2b_160 -> Digest Blake2b_160 -> Bool) @@ -62,8 +62,8 @@ `on` Wallet -> Digest Blake2b_160 Pl.mwWalletId -instance Ord Wallet where - compare :: Wallet -> Wallet -> Ordering +instance Ord Wallet where + compare :: Wallet -> Wallet -> Ordering compare = Digest Blake2b_160 -> Digest Blake2b_160 -> Ordering forall a. Ord a => a -> a -> Ordering compare (Digest Blake2b_160 -> Digest Blake2b_160 -> Ordering) @@ -88,27 +88,27 @@ -- | Wallet corresponding to a given wallet number (or wallet ID) wallet :: Int -> Wallet wallet :: Int -> Wallet -wallet Int -j +wallet Int +j | Int -j Int -> Int -> Bool +j Int -> Int -> Bool forall a. Ord a => a -> a -> Bool > Int 0 Bool -> Bool -> Bool && Int -j Int -> Int -> Bool +j Int -> Int -> Bool forall a. Ord a => a -> a -> Bool <= Int -10 = let i :: Int -i = Int -j Int -> Int -> Int +10 = let i :: Int +i = Int +j Int -> Int -> Int forall a. Num a => a -> a -> a - Int 1 in [Wallet] knownWallets [Wallet] -> Int -> Wallet forall a. [a] -> Int -> a !! Int -i +i | Bool otherwise = WalletNumber -> Wallet Pl.fromWalletNumber (Integer -> WalletNumber @@ -117,7 +117,7 @@ $ Int -> Integer forall a b. (Integral a, Num b) => a -> b fromIntegral Int -j) +j) -- | Retrieves the id of the known wallet that corresponds to a public key -- hash, if any. @@ -131,10 +131,10 @@ flip PubKeyHash -> Map PubKeyHash Int -> Maybe Int forall k a. Ord k => k -> Map k a -> Maybe a Map.lookup Map PubKeyHash Int -walletPKHashToIdMap +walletPKHashToIdMap where - walletPKHashToIdMap :: Map PubKeyHash Int -walletPKHashToIdMap = + walletPKHashToIdMap :: Map PubKeyHash Int +walletPKHashToIdMap = [(PubKeyHash, Int)] -> Map PubKeyHash Int forall k a. Ord k => [(k, a)] -> Map k a Map.fromList ([(PubKeyHash, Int)] -> Map PubKeyHash Int) @@ -206,8 +206,8 @@ -- | Retrieves a wallet's address walletAddress :: Wallet -> Pl.Address walletAddress :: Wallet -> Address -walletAddress Wallet -w = +walletAddress Wallet +w = Credential -> Maybe StakingCredential -> Address Pl.Address (PubKeyHash -> Credential @@ -215,7 +215,7 @@ forall a b. (a -> b) -> a -> b $ Wallet -> PubKeyHash walletPKHash Wallet -w) +w) (Credential -> StakingCredential Pl.StakingHash (Credential -> StakingCredential) -> (PubKeyHash -> Credential) -> PubKeyHash -> StakingCredential @@ -226,7 +226,7 @@ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Wallet -> Maybe PubKeyHash walletStakingPKHash Wallet -w) +w) -- | Retrieves a wallet private key (secret key SK) walletSK :: Pl.MockWallet -> PrivateKey @@ -251,7 +251,7 @@ forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap MockPrivateKey -> XPrv forall a. a -> XPrv -hackUnMockPrivateKey (Maybe MockPrivateKey -> Maybe XPrv) +hackUnMockPrivateKey (Maybe MockPrivateKey -> Maybe XPrv) -> (Wallet -> Maybe MockPrivateKey) -> Wallet -> Maybe XPrv forall b c a. (b -> c) -> (a -> b) -> a -> c . Wallet -> Maybe MockPrivateKey @@ -259,15 +259,15 @@ where -- Make sure that you only apply it to @MockPrivateKey@; the function is -- polymorphic because @MockPrivateKey@ is not exported either - hackUnMockPrivateKey :: a -> Cardano.XPrv - hackUnMockPrivateKey :: a -> XPrv -hackUnMockPrivateKey a -x = let HACK XPrv -y = a -> HACK + hackUnMockPrivateKey :: a -> Cardano.XPrv + hackUnMockPrivateKey :: a -> XPrv +hackUnMockPrivateKey a +x = let HACK XPrv +y = a -> HACK forall a b. a -> b unsafeCoerce a -x in XPrv -y +x in XPrv +y -- * Initial distribution of funds @@ -294,7 +294,7 @@ { InitialDistribution -> Map Wallet [Value] unInitialDistribution :: Map Wallet [Pl.Value] } - deriving (InitialDistribution -> InitialDistribution -> Bool + deriving (InitialDistribution -> InitialDistribution -> Bool (InitialDistribution -> InitialDistribution -> Bool) -> (InitialDistribution -> InitialDistribution -> Bool) -> Eq InitialDistribution @@ -303,7 +303,7 @@ $c/= :: InitialDistribution -> InitialDistribution -> Bool == :: InitialDistribution -> InitialDistribution -> Bool $c== :: InitialDistribution -> InitialDistribution -> Bool -Eq, Int -> InitialDistribution -> ShowS +Eq, Int -> InitialDistribution -> ShowS [InitialDistribution] -> ShowS InitialDistribution -> String (Int -> InitialDistribution -> ShowS) @@ -320,11 +320,11 @@ $cshowsPrec :: Int -> InitialDistribution -> ShowS Show) -instance Semigroup InitialDistribution where - (InitialDistribution Map Wallet [Value] -i) <> :: InitialDistribution -> InitialDistribution -> InitialDistribution -<> (InitialDistribution Map Wallet [Value] -j) = +instance Semigroup InitialDistribution where + (InitialDistribution Map Wallet [Value] +i) <> :: InitialDistribution -> InitialDistribution -> InitialDistribution +<> (InitialDistribution Map Wallet [Value] +j) = Map Wallet [Value] -> InitialDistribution InitialDistribution (Map Wallet [Value] -> InitialDistribution) -> Map Wallet [Value] -> InitialDistribution @@ -335,11 +335,11 @@ Map.unionWith [Value] -> [Value] -> [Value] forall a. Semigroup a => a -> a -> a (<>) Map Wallet [Value] -i Map Wallet [Value] -j +i Map Wallet [Value] +j -instance Monoid InitialDistribution where - mempty :: InitialDistribution +instance Monoid InitialDistribution where + mempty :: InitialDistribution mempty = Map Wallet [Value] -> InitialDistribution InitialDistribution Map Wallet [Value] forall k a. Map k a @@ -347,7 +347,7 @@ -- | 10 UTxOs with 100 Ada each, for each of the 'knownWallets'. instance Default InitialDistribution where - def :: InitialDistribution + def :: InitialDistribution def = Map Wallet [Value] -> InitialDistribution InitialDistribution (Map Wallet [Value] -> InitialDistribution) @@ -371,10 +371,10 @@ forall a. Int -> a -> [a] replicate Int 10 Value -defLovelace) +defLovelace) where - defLovelace :: Value -defLovelace = Integer -> Value + defLovelace :: Value +defLovelace = Integer -> Value Pl.lovelaceValueOf Integer 100_000_000 diff --git a/src/Paths_cooked_validators.html b/src/Paths_cooked_validators.html index f46cbc228..8b05ef40b 100644 --- a/src/Paths_cooked_validators.html +++ b/src/Paths_cooked_validators.html @@ -19,7 +19,7 @@ #if defined(VERSION_base) #if MIN_VERSION_base(4,0,0) -catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a #else catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a #endif @@ -42,17 +42,17 @@ getDataFileName :: FilePath -> IO FilePath getDataFileName :: String -> IO String -getDataFileName String -name = do - String -dir <- IO String +getDataFileName String +name = do + String +dir <- IO String getDataDir String -> IO String forall (m :: * -> *) a. Monad m => a -> m a return (String -dir String -> String -> String +dir String -> String -> String `joinFileName` String -name) +name) getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath @@ -145,38 +145,38 @@ joinFileName :: String -> String -> FilePath joinFileName :: String -> String -> String joinFileName String -"" String -fname = String -fname +"" String +fname = String +fname joinFileName String -"." String -fname = String -fname -joinFileName String -dir String +"." String +fname = String +fname +joinFileName String +dir String "" = String -dir -joinFileName String -dir String -fname +dir +joinFileName String +dir String +fname | Char -> Bool isPathSeparator (String -> Char forall a. [a] -> a List.last String -dir) = String -dir String -> String -> String +dir) = String +dir String -> String -> String forall a. [a] -> [a] -> [a] ++ String -fname +fname | Bool otherwise = String -dir String -> String -> String +dir String -> String -> String forall a. [a] -> [a] -> [a] ++ Char pathSeparator Char -> String -> String forall a. a -> [a] -> [a] : String -fname +fname pathSeparator :: Char pathSeparator :: Char @@ -185,9 +185,9 @@ isPathSeparator :: Char -> Bool isPathSeparator :: Char -> Bool -isPathSeparator Char -c = Char -c Char -> Char -> Bool +isPathSeparator Char +c = Char +c Char -> Char -> Bool forall a. Eq a => a -> a -> Bool == Char '/'