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.
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 @@
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.
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.
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.
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.
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 @@
-
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.
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.
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".
\ 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
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.
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.
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.
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.
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.
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.
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 3405249e3..bba46cc5f 100644
Binary files a/cooked-validators.haddock and b/cooked-validators.haddock differ
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 @@
-
","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":"classMonadPlus m => InterpLtl modification builtin m where
","name":"MonadModal Modification modifyLtl","module":"Cooked.Ltl","link":"Cooked-Ltl.html#t:MonadModal"},{"display_html":"classIsAbstractOutput o","name":"IsAbstractOutput","module":"Cooked.Output","link":"Cooked-Output.html#t:IsAbstractOutput"},{"display_html":"type familyOwnerType o","name":"OwnerType","module":"Cooked.Output","link":"Cooked-Output.html#t:OwnerType"},{"display_html":"type familyDatumType o","name":"DatumType","module":"Cooked.Output","link":"Cooked-Output.html#t:DatumType"},{"display_html":"type familyValueType o","name":"ValueType","module":"Cooked.Output","link":"Cooked-Output.html#t:ValueType"},{"display_html":"type familyReferenceScriptType 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":"classToCredential a where
}","name":"InitialDistribution InitialDistribution unInitialDistribution","module":"Cooked.Wallet","link":"Cooked-Wallet.html#t:InitialDistribution"},{"display_html":"typeWallet = MockWallet","name":"Wallet","module":"Cooked.Wallet","link":"Cooked-Wallet.html#t:Wallet"},{"display_html":"typePrivateKey = XPrv","name":"PrivateKey","module":"Cooked.Wallet","link":"Cooked-Wallet.html#t:PrivateKey"},{"display_html":"classPrettyCooked a 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":"dataTxSkelRedeemerwhere
","name":"MCEUnbalanceableError MCEUnbalNotEnoughFunds MCEUnbalNotEnoughReturning","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MCEUnbalanceableError"},{"display_html":"class (MonadFail m, MonadErrorMockChainError m) => MonadBlockChainBalancing m where
","name":"MonadBlockChainBalancing getParams datumFromHash utxosAtLedger validatorFromHash txOutByRefLedger","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MonadBlockChainBalancing"},{"display_html":"classMonadBlockChainBalancing m => MonadBlockChainWithoutValidation m where
","name":"MonadBlockChainWithoutValidation awaitSlot currentSlot allUtxosLedger","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MonadBlockChainWithoutValidation"},{"display_html":"classMonadBlockChainWithoutValidation m => MonadBlockChain m where
","name":"MonadBlockChain validateTxSkel","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MonadBlockChain"},{"display_html":"newtypeAsTrans 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":"typeTweak m = StateTTxSkel (ListT m)","name":"Tweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#t:Tweak"},{"display_html":"dataUntypedTweak 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":"dataPermutOutTweakMode
","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":"dataTamperDatumLbl = 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":"dataMalformDatumLbl = 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 (MaybeTxSkelOut)","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":"dataMockChainSt = MockChainSt {
}","name":"MockChainEnv MockChainEnv mceParams","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#t:MockChainEnv"},{"display_html":"newtypeMockChainT m a = MockChainT {
}","name":"MockChainT MockChainT unMockChain","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#t:MockChainT"},{"display_html":"typeMockChain = MockChainTIdentity","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 (EitherMockChainError (a, MockChainSt)) -> n (EitherMockChainError (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 (EitherMockChainError (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 (EitherMockChainError (a, UtxoState))","name":"runMockChainTFrom","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainTFrom"},{"display_html":"runMockChainT :: Monad m => MockChainT m a -> m (EitherMockChainError (a, UtxoState))","name":"runMockChainT","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainT"},{"display_html":"runMockChainRaw :: MockChainEnv -> MockChainSt -> MockChain a -> EitherMockChainError (a, MockChainSt)","name":"runMockChainRaw","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainRaw"},{"display_html":"runMockChainFrom :: InitialDistribution -> MockChain a -> EitherMockChainError (a, UtxoState)","name":"runMockChainFrom","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainFrom"},{"display_html":"runMockChain :: MockChain a -> EitherMockChainError (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 -> [(EitherMockChainError (a, UtxoState), MockChainLog)]","name":"interpretAndRun","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:interpretAndRun"},{"display_html":"dataMockChainLogEntry
}","name":"AsTrans AsTrans getTrans","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:AsTrans"},{"display_html":"classMonadBlockChainWithoutValidation m => MonadBlockChain m where
","name":"MonadBlockChainWithoutValidation allUtxosLedger awaitSlot currentSlot","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MonadBlockChainWithoutValidation"},{"display_html":"class (MonadFail m, MonadErrorMockChainError m) => MonadBlockChainBalancing m 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":"typeMockChain = MockChainTIdentity","name":"MockChain","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MockChain"},{"display_html":"newtypeMockChainT m a = MockChainT {
}","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 (EitherMockChainError (a, MockChainSt)) -> n (EitherMockChainError (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 (EitherMockChainError (a, MockChainSt))","name":"runMockChainTRaw","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainTRaw"},{"display_html":"runMockChainTFrom :: Monad m => InitialDistribution -> MockChainT m a -> m (EitherMockChainError (a, UtxoState))","name":"runMockChainTFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainTFrom"},{"display_html":"runMockChainT :: Monad m => MockChainT m a -> m (EitherMockChainError (a, UtxoState))","name":"runMockChainT","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainT"},{"display_html":"runMockChainRaw :: MockChainEnv -> MockChainSt -> MockChain a -> EitherMockChainError (a, MockChainSt)","name":"runMockChainRaw","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainRaw"},{"display_html":"runMockChainFrom :: InitialDistribution -> MockChain a -> EitherMockChainError (a, UtxoState)","name":"runMockChainFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainFrom"},{"display_html":"runMockChain :: MockChain a -> EitherMockChainError (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":"typeMonadModalBlockChain 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":"patternMCLogFail :: String -> MockChainLogEntry","name":"MCLogFail","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:MCLogFail"},{"display_html":"patternMCLogSubmittedTxSkel :: SkelContext -> TxSkel -> MockChainLogEntry","name":"MCLogSubmittedTxSkel","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:MCLogSubmittedTxSkel"},{"display_html":"patternMCLogNewTx :: 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 -> [(EitherMockChainError (a, UtxoState), MockChainLog)]","name":"interpretAndRun","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:interpretAndRun"},{"display_html":"runTweak :: Tweak InterpMockChain a -> TxSkel -> [EitherMockChainError (a, TxSkel)]","name":"runTweak","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runTweak"},{"display_html":"runTweakFrom :: MockChainEnv -> MockChainSt -> Tweak InterpMockChain a -> TxSkel -> [EitherMockChainError (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":"classIsProp prop 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":"dataPermutOutTweakMode
","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":"dataMalformDatumLbl = MalformDatumLbl","name":"MalformDatumLbl MalformDatumLbl","module":"Cooked.Tweak","link":"Cooked-Tweak.html#t:MalformDatumLbl"},{"display_html":"dataTamperDatumLbl = 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 (MaybeTxSkelOut)","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":"newtypeDatumHijackingLbl = 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":"dataDupTokenLbl = DupTokenLbl","name":"DupTokenLbl DupTokenLbl","module":"Cooked.Attack.DupToken","link":"Cooked-Attack-DupToken.html#t:DupTokenLbl"},{"display_html":"typeDoubleSatDelta = (Map TxOutRef TxSkelRedeemer, [TxSkelOut], TxSkelMints)","name":"DoubleSatDelta","module":"Cooked.Attack.DoubleSat","link":"Cooked-Attack-DoubleSat.html#t:DoubleSatDelta"},{"display_html":"dataDoubleSatLbl = 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":"newtypeAddTokenLbl = 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":"classMonad m => MonadModal m 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":"classMonadPlus m => InterpLtl modification builtin m where
","name":"MonadModal Modification modifyLtl","module":"Cooked.Ltl","link":"Cooked-Ltl.html#t:MonadModal"},{"display_html":"classIsAbstractOutput o","name":"IsAbstractOutput","module":"Cooked.Output","link":"Cooked-Output.html#t:IsAbstractOutput"},{"display_html":"type familyOwnerType o","name":"OwnerType","module":"Cooked.Output","link":"Cooked-Output.html#t:OwnerType"},{"display_html":"type familyDatumType o","name":"DatumType","module":"Cooked.Output","link":"Cooked-Output.html#t:DatumType"},{"display_html":"type familyValueType o","name":"ValueType","module":"Cooked.Output","link":"Cooked-Output.html#t:ValueType"},{"display_html":"type familyReferenceScriptType 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":"classToCredential a where
}","name":"InitialDistribution InitialDistribution unInitialDistribution","module":"Cooked.Wallet","link":"Cooked-Wallet.html#t:InitialDistribution"},{"display_html":"typeWallet = MockWallet","name":"Wallet","module":"Cooked.Wallet","link":"Cooked-Wallet.html#t:Wallet"},{"display_html":"typePrivateKey = XPrv","name":"PrivateKey","module":"Cooked.Wallet","link":"Cooked-Wallet.html#t:PrivateKey"},{"display_html":"classPrettyCooked a 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":"dataTxSkelRedeemerwhere
","name":"MCEUnbalanceableError MCEUnbalNotEnoughFunds MCEUnbalNotEnoughReturning","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MCEUnbalanceableError"},{"display_html":"class (MonadFail m, MonadErrorMockChainError m) => MonadBlockChainBalancing m where
","name":"MonadBlockChainBalancing getParams datumFromHash utxosAtLedger validatorFromHash txOutByRefLedger","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MonadBlockChainBalancing"},{"display_html":"classMonadBlockChainBalancing m => MonadBlockChainWithoutValidation m where
","name":"MonadBlockChainWithoutValidation awaitSlot currentSlot allUtxosLedger","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MonadBlockChainWithoutValidation"},{"display_html":"classMonadBlockChainWithoutValidation m => MonadBlockChain m where
","name":"MonadBlockChain validateTxSkel","module":"Cooked.MockChain.BlockChain","link":"Cooked-MockChain-BlockChain.html#t:MonadBlockChain"},{"display_html":"newtypeAsTrans 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":"typeTweak m = StateTTxSkel (ListT m)","name":"Tweak","module":"Cooked.Tweak.Common","link":"Cooked-Tweak-Common.html#t:Tweak"},{"display_html":"dataUntypedTweak 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":"dataPermutOutTweakMode
","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":"dataTamperDatumLbl = 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":"dataMalformDatumLbl = 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 (MaybeTxSkelOut)","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":"dataMockChainSt = MockChainSt {
}","name":"MockChainEnv MockChainEnv mceParams","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#t:MockChainEnv"},{"display_html":"newtypeMockChainT m a = MockChainT {
}","name":"MockChainT MockChainT unMockChain","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#t:MockChainT"},{"display_html":"typeMockChain = MockChainTIdentity","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 (EitherMockChainError (a, MockChainSt)) -> n (EitherMockChainError (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 (EitherMockChainError (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 (EitherMockChainError (a, UtxoState))","name":"runMockChainTFrom","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainTFrom"},{"display_html":"runMockChainT :: Monad m => MockChainT m a -> m (EitherMockChainError (a, UtxoState))","name":"runMockChainT","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainT"},{"display_html":"runMockChainRaw :: MockChainEnv -> MockChainSt -> MockChain a -> EitherMockChainError (a, MockChainSt)","name":"runMockChainRaw","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainRaw"},{"display_html":"runMockChainFrom :: InitialDistribution -> MockChain a -> EitherMockChainError (a, UtxoState)","name":"runMockChainFrom","module":"Cooked.MockChain.Direct","link":"Cooked-MockChain-Direct.html#v:runMockChainFrom"},{"display_html":"runMockChain :: MockChain a -> EitherMockChainError (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 -> [(EitherMockChainError (a, UtxoState), MockChainLog)]","name":"interpretAndRun","module":"Cooked.MockChain.Staged","link":"Cooked-MockChain-Staged.html#v:interpretAndRun"},{"display_html":"dataMockChainLogEntry
}","name":"AsTrans AsTrans getTrans","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:AsTrans"},{"display_html":"classMonadBlockChainWithoutValidation m => MonadBlockChain m where
","name":"MonadBlockChainWithoutValidation allUtxosLedger awaitSlot currentSlot","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MonadBlockChainWithoutValidation"},{"display_html":"class (MonadFail m, MonadErrorMockChainError m) => MonadBlockChainBalancing m 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":"typeMockChain = MockChainTIdentity","name":"MockChain","module":"Cooked.MockChain","link":"Cooked-MockChain.html#t:MockChain"},{"display_html":"newtypeMockChainT m a = MockChainT {
}","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 (EitherMockChainError (a, MockChainSt)) -> n (EitherMockChainError (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 (EitherMockChainError (a, MockChainSt))","name":"runMockChainTRaw","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainTRaw"},{"display_html":"runMockChainTFrom :: Monad m => InitialDistribution -> MockChainT m a -> m (EitherMockChainError (a, UtxoState))","name":"runMockChainTFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainTFrom"},{"display_html":"runMockChainT :: Monad m => MockChainT m a -> m (EitherMockChainError (a, UtxoState))","name":"runMockChainT","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainT"},{"display_html":"runMockChainRaw :: MockChainEnv -> MockChainSt -> MockChain a -> EitherMockChainError (a, MockChainSt)","name":"runMockChainRaw","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainRaw"},{"display_html":"runMockChainFrom :: InitialDistribution -> MockChain a -> EitherMockChainError (a, UtxoState)","name":"runMockChainFrom","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runMockChainFrom"},{"display_html":"runMockChain :: MockChain a -> EitherMockChainError (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":"typeMonadModalBlockChain 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":"patternMCLogFail :: String -> MockChainLogEntry","name":"MCLogFail","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:MCLogFail"},{"display_html":"patternMCLogSubmittedTxSkel :: SkelContext -> TxSkel -> MockChainLogEntry","name":"MCLogSubmittedTxSkel","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:MCLogSubmittedTxSkel"},{"display_html":"patternMCLogNewTx :: 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 -> [(EitherMockChainError (a, UtxoState), MockChainLog)]","name":"interpretAndRun","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:interpretAndRun"},{"display_html":"runTweak :: Tweak InterpMockChain a -> TxSkel -> [EitherMockChainError (a, TxSkel)]","name":"runTweak","module":"Cooked.MockChain","link":"Cooked-MockChain.html#v:runTweak"},{"display_html":"runTweakFrom :: MockChainEnv -> MockChainSt -> Tweak InterpMockChain a -> TxSkel -> [EitherMockChainError (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":"classIsProp prop 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":"dataPermutOutTweakMode
","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":"dataMalformDatumLbl = MalformDatumLbl","name":"MalformDatumLbl MalformDatumLbl","module":"Cooked.Tweak","link":"Cooked-Tweak.html#t:MalformDatumLbl"},{"display_html":"dataTamperDatumLbl = 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 (MaybeTxSkelOut)","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":"newtypeDatumHijackingLbl = 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":"dataDupTokenLbl = DupTokenLbl","name":"DupTokenLbl DupTokenLbl","module":"Cooked.Attack.DupToken","link":"Cooked-Attack-DupToken.html#t:DupTokenLbl"},{"display_html":"typeDoubleSatDelta = (Map TxOutRef TxSkelRedeemer, [TxSkelOut], TxSkelMints)","name":"DoubleSatDelta","module":"Cooked.Attack.DoubleSat","link":"Cooked-Attack-DoubleSat.html#t:DoubleSatDelta"},{"display_html":"dataDoubleSatLbl = 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":"newtypeAddTokenLbl = 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":"classMonad m => MonadModal m where
","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::
-MonadTweakm=>
+addTokenAttack::
+MonadTweakm=>-- | 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.VersionedPl.MintingPolicy->[(Pl.TokenName,Integer)])->-- | The wallet of the attacker. Any extra tokens will be paid to this wallet.Wallet->
-mPl.Value
+mPl.ValueaddTokenAttack :: (Versioned MintingPolicy -> [(TokenName, Integer)])
-> Wallet -> m Value
-addTokenAttackVersioned MintingPolicy -> [(TokenName, Integer)]
-extraTokensWallet
-attacker=do
-TxSkelMints
-oldMints<-Optic' A_Lens NoIx TxSkel TxSkelMints -> m TxSkelMints
+addTokenAttackVersioned MintingPolicy -> [(TokenName, Integer)]
+extraTokensWallet
+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)->
-letnewMints :: TxSkelMints
-newMints=(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)
+(\(TokenName
+tName,Integer
+amount)->
+letnewMints :: 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
txSkelMintsValueTxSkelMints
-newMints
+newMintsValue -> Value -> Value
forall a. Semigroup a => a -> a -> a
<>Value -> Value
forall a. AdditiveGroup a => a -> a
Pl.negate(TxSkelMints -> Value
txSkelMintsValueTxSkelMints
-oldMints)
+oldMints)inifValue
-incrementValue -> Value -> Bool
+incrementValue -> Value -> Bool
`Pl.geq`Value
forall a. Monoid a => a
mempty
@@ -112,7 +112,7 @@
Optic' k is TxSkel a -> a -> m ()
setTweakOptic' A_Lens NoIx TxSkel TxSkelMints
txSkelMintsLTxSkelMints
-newMints
+newMintsTxSkelOut -> m ()
forall (m :: * -> *). MonadTweak m => TxSkelOut -> m ()
addOutputTweak(TxSkelOut -> m ()) -> TxSkelOut -> m ()
@@ -120,28 +120,28 @@
$PubKeyHash -> Value -> TxSkelOut
paysPK(Wallet -> PubKeyHash
walletPKHashWallet
-attacker)Value
-increment
+attacker)Value
+incrementValue -> m Value
forall (m :: * -> *) a. Monad m => a -> m a
returnValue
-increment
+incrementelsem Value
forall (m :: * -> *) a. MonadTweak m => m a
failingTweak)(Versioned MintingPolicy -> [(TokenName, Integer)]
-extraTokensVersioned MintingPolicy
-policy)
+extraTokensVersioned MintingPolicy
+policy))(TxSkelMints
-> [(Versioned MintingPolicy,
(MintsRedeemer, NEMap TokenName (NonZero Integer)))]
forall k a. Map k a -> [(k, a)]
Map.toListTxSkelMints
-oldMints)
+oldMints)
-newtypeAddTokenLbl=AddTokenLblPl.TokenNamederiving(Int -> AddTokenLbl -> ShowS
+newtypeAddTokenLbl=AddTokenLblPl.TokenNamederiving(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::
-(MonadTweakm,
-IskA_Traversal,
-Show(Pl.DatumTypea),
-Pl.ToData(Pl.DatumTypea)
+redirectScriptOutputTweak::
+(MonadTweakm,
+IskA_Traversal,
+Show(Pl.DatumTypea),
+Pl.ToData(Pl.DatumTypea))=>
-Optic'kisTxSkel(ConcreteOutput(Pl.TypedValidatora)TxSkelOutDatumPl.Value(Pl.VersionedPl.Script))->
+Optic'kisTxSkel(ConcreteOutput(Pl.TypedValidatora)TxSkelOutDatumPl.Value(Pl.VersionedPl.Script))->-- | Return @Just@ the new validator, or @Nothing@ if you want to leave this-- output unchanged.
-(ConcreteOutput(Pl.TypedValidatora)TxSkelOutDatumPl.Value(Pl.VersionedPl.Script)->Maybe(Pl.TypedValidatora))->
+(ConcreteOutput(Pl.TypedValidatora)TxSkelOutDatumPl.Value(Pl.VersionedPl.Script)->Maybe(Pl.TypedValidatora))->-- | 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.TypedValidatora)TxSkelOutDatumPl.Value(Pl.VersionedPl.Script)]
+m[ConcreteOutput(Pl.TypedValidatora)TxSkelOutDatumPl.Value(Pl.VersionedPl.Script)]redirectScriptOutputTweak :: Optic'
k
is
@@ -64,16 +64,16 @@
-> (Integer -> Bool)
-> m [ConcreteOutput
(TypedValidator a) TxSkelOutDatum Value (Versioned Script)]
-redirectScriptOutputTweakOptic'
+redirectScriptOutputTweakOptic'
k
is
TxSkel
(ConcreteOutput
(TypedValidator a) TxSkelOutDatum Value (Versioned Script))
-opticConcreteOutput
+opticConcreteOutput
(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->caseConcreteOutput
+output->caseConcreteOutput
(TypedValidator a) TxSkelOutDatum Value (Versioned Script)
-> Maybe (TypedValidator a)
-changeConcreteOutput
+changeConcreteOutput
(TypedValidator a) TxSkelOutDatum Value (Versioned Script)
-outputof
+outputofMaybe (TypedValidator a)
Nothing->Maybe
(ConcreteOutput
(TypedValidator a) TxSkelOutDatum Value (Versioned Script))
forall a. Maybe a
Nothing
-JustTypedValidator a
-newValidator->ConcreteOutput
+JustTypedValidator 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)
-outputConcreteOutput
+outputConcreteOutput
(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::
-forallam.
-(MonadTweakm,
-Show(Pl.DatumTypea),
-PrettyCooked(Pl.DatumTypea),
-Pl.ToData(Pl.DatumTypea),
-Typeable(Pl.DatumTypea),
-Typeablea
+forallam.
+(MonadTweakm,
+Show(Pl.DatumTypea),
+PrettyCooked(Pl.DatumTypea),
+Pl.ToData(Pl.DatumTypea),
+Typeable(Pl.DatumTypea),
+Typeablea)=>-- | Predicate to select outputs to steal, depending on the intended-- recipient, the datum, and the value.
-(ConcreteOutput(Pl.TypedValidatora)TxSkelOutDatumPl.Value(Pl.VersionedPl.Script)->Bool)->
+(ConcreteOutput(Pl.TypedValidatora)TxSkelOutDatumPl.Value(Pl.VersionedPl.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.TypedValidatora)TxSkelOutDatumPl.Value(Pl.VersionedPl.Script)]
+m[ConcreteOutput(Pl.TypedValidatora)TxSkelOutDatumPl.Value(Pl.VersionedPl.Script)]datumHijackingAttack :: (ConcreteOutput
(TypedValidator a) TxSkelOutDatum Value (Versioned Script)
-> Bool)
-> (Integer -> Bool)
-> m [ConcreteOutput
(TypedValidator a) TxSkelOutDatum Value (Versioned Script)]
-datumHijackingAttackConcreteOutput
+datumHijackingAttackConcreteOutput
(TypedValidator a) TxSkelOutDatum Value (Versioned Script)
-> Bool
-changeInteger -> Bool
-select=do
-[ConcreteOutput
+changeInteger -> 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.TypedValidatora))
-(\ConcreteOutput
+txSkelOutOwnerTypeP@(Pl.TypedValidatora))
+(\ConcreteOutput
(TypedValidator a) TxSkelOutDatum Value (Versioned Script)
-output->ifConcreteOutput
+output->ifConcreteOutput
(TypedValidator a) TxSkelOutDatum Value (Versioned Script)
-> Bool
-changeConcreteOutput
+changeConcreteOutput
(TypedValidator a) TxSkelOutDatum Value (Versioned Script)
-outputthenTypedValidator a -> Maybe (TypedValidator a)
+outputthenTypedValidator a -> Maybe (TypedValidator a)
forall a. a -> Maybe a
JustTypedValidator a
-thiefelseMaybe (TypedValidator a)
+thiefelseMaybe (TypedValidator a)
forall a. Maybe a
Nothing)Integer -> Bool
-select
+selectBool -> 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
+redirectedDatumHijackingLbl -> 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.validatorAddressTypedValidator 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
+redirectedwhere
-thief :: TypedValidator a
-thief=TypedValidator a
+thief :: TypedValidator a
+thief=TypedValidator a
forall a. TypedValidator a
-datumHijackingTarget@a
+datumHijackingTarget@anewtypeDatumHijackingLbl=DatumHijackingLblPl.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.TypedValidatora
+datumHijackingTarget::Pl.TypedValidatoradatumHijackingTarget :: 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 -> ()
-tgtBuiltinData
+tgt::Pl.BuiltinData->Pl.BuiltinData->Pl.BuiltinData->()
+tgt :: BuiltinData -> BuiltinData -> BuiltinData -> ()
+tgtBuiltinData
_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.typeDoubleSatDelta=(MapPl.TxOutRefTxSkelRedeemer,[TxSkelOut],TxSkelMints)
-instance{-# OVERLAPPING#-}SemigroupDoubleSatDeltawhere
-(Map TxOutRef TxSkelRedeemer
-i,[TxSkelOut]
-o,TxSkelMints
-m)<> :: DoubleSatDelta -> DoubleSatDelta -> DoubleSatDelta
-<>(Map TxOutRef TxSkelRedeemer
-i',[TxSkelOut]
-o',TxSkelMints
-m')=
+instance{-# OVERLAPPING#-}SemigroupDoubleSatDeltawhere
+(Map TxOutRef TxSkelRedeemer
+i,[TxSkelOut]
+o,TxSkelMints
+m)<> :: DoubleSatDelta -> DoubleSatDelta -> DoubleSatDelta
+<>(Map TxOutRef TxSkelRedeemer
+i',[TxSkelOut]
+o',TxSkelMints
+m')=(Map TxOutRef TxSkelRedeemer
-iMap TxOutRef TxSkelRedeemer
+iMap 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
-mTxSkelMints -> TxSkelMints -> TxSkelMints
+mTxSkelMints -> 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#-}MonoidDoubleSatDeltawhere
-mempty :: DoubleSatDelta
+instance{-# OVERLAPPING#-}MonoidDoubleSatDeltawhere
+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::
-(MonadTweakm,Eqis,IskA_Traversal)=>
+doubleSatAttack::
+(MonadTweakm,Eqis,IskA_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(WithIxis)TxSkela->
+Optic'k(WithIxis)TxSkela->-- | 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]]
-groupingsOptic' k (WithIx is) TxSkel a
-opticis -> a -> m [(a, DoubleSatDelta)]
-changeWallet
-attacker=do
-[DoubleSatDelta]
-deltas<-([is] -> [[is]])
+doubleSatAttack[is] -> [[is]]
+groupingsOptic' k (WithIx is) TxSkel a
+opticis -> a -> m [(a, DoubleSatDelta)]
+changeWallet
+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]]
-groupingsOptic' k (WithIx is) TxSkel a
-opticis -> a -> m [(a, DoubleSatDelta)]
-change
-letdelta :: DoubleSatDelta
-delta=[DoubleSatDelta] -> DoubleSatDelta
-joinDoubleSatDeltas[DoubleSatDelta]
-deltas
+groupingsOptic' k (WithIx is) TxSkel a
+opticis -> a -> m [(a, DoubleSatDelta)]
+change
+letdelta :: DoubleSatDelta
+delta=[DoubleSatDelta] -> DoubleSatDelta
+joinDoubleSatDeltas[DoubleSatDelta]
+deltasDoubleSatDelta -> m ()
forall (m :: * -> *). MonadTweak m => DoubleSatDelta -> m ()
-addDoubleSatDeltaTweakDoubleSatDelta
-delta
-Value
-addedValue<-DoubleSatDelta -> m Value
+addDoubleSatDeltaTweakDoubleSatDelta
+delta
+Value
+addedValue<-DoubleSatDelta -> m Value
forall (m :: * -> *). MonadTweak m => DoubleSatDelta -> m Value
-deltaBalanceDoubleSatDelta
-delta
+deltaBalanceDoubleSatDelta
+deltaifValue
-addedValueValue -> Value -> Bool
+addedValueValue -> Value -> Bool
`Pl.gt`Value
forall a. Monoid a => a
mempty
@@ -186,8 +186,8 @@
$PubKeyHash -> Value -> TxSkelOut
paysPK(Wallet -> PubKeyHash
walletPKHashWallet
-attacker)Value
-addedValue
+attacker)Value
+addedValueelsem ()
forall (m :: * -> *) a. MonadTweak m => m a
failingTweak
@@ -197,14 +197,14 @@
DoubleSatLblwhere-- for each triple of additional inputs, outputs, and mints, calculate its balance
-deltaBalance::MonadTweakm=>DoubleSatDelta->mPl.Value
-deltaBalance :: DoubleSatDelta -> m Value
-deltaBalance(Map TxOutRef TxSkelRedeemer
-inputs,[TxSkelOut]
-outputs,TxSkelMints
-mints)=do
-Value
-inValue<-((TxOutRef, TxOut) -> Value) -> [(TxOutRef, TxOut)] -> Value
+deltaBalance::MonadTweakm=>DoubleSatDelta->mPl.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.keysMap 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
-inValueValue -> Value -> Value
+inValueValue -> Value -> Value
forall a. Semigroup a => a -> a -> a
<>Value -> Value
forall a. AdditiveGroup a => a -> a
Pl.negateValue
-outValueValue -> Value -> Value
+outValueValue -> Value -> Value
forall a. Semigroup a => a -> a -> a
<>Value
-mintValue
+mintValuewhere
-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
txSkelMintsValueTxSkelMints
-mints
+mints-- Helper tweak to add a 'DoubleSatDelta' to a transaction
-addDoubleSatDeltaTweak::MonadTweakm=>DoubleSatDelta->m()
-addDoubleSatDeltaTweak :: DoubleSatDelta -> m ()
-addDoubleSatDeltaTweak(Map TxOutRef TxSkelRedeemer
-ins,[TxSkelOut]
-outs,TxSkelMints
-mints)=
+addDoubleSatDeltaTweak::MonadTweakm=>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.toListMap 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
+outsm () -> 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)]
txSkelMintsToListTxSkelMints
-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
mconcatdataDoubleSatLbl=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::
-MonadTweakm=>
+dupTokenAttack::
+MonadTweakm=>-- | 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->
-mPl.Value
+mPl.ValuedupTokenAttack :: (AssetClass -> Integer -> Integer) -> Wallet -> m Value
-dupTokenAttackAssetClass -> Integer -> Integer
-changeWallet
-attacker=do
-Value
-totalIncrement<-m Value
+dupTokenAttackAssetClass -> Integer -> Integer
+changeWallet
+attacker=do
+Value
+totalIncrement<-m Value
forall (m :: * -> *). MonadTweak m => m Value
-changeMintAmountsTweak
+changeMintAmountsTweakTxSkelOut -> m ()
forall (m :: * -> *). MonadTweak m => TxSkelOut -> m ()
addOutputTweak(TxSkelOut -> m ()) -> TxSkelOut -> m ()
@@ -46,8 +46,8 @@
$PubKeyHash -> Value -> TxSkelOut
paysPK(Wallet -> PubKeyHash
walletPKHashWallet
-attacker)Value
-totalIncrement
+attacker)Value
+totalIncrementDupTokenLbl -> m ()
forall (m :: * -> *) x. (MonadTweak m, LabelConstrs x) => x -> m ()
addLabelTweakDupTokenLbl
@@ -55,13 +55,13 @@
Value -> m Value
forall (m :: * -> *) a. Monad m => a -> m a
returnValue
-totalIncrement
+totalIncrementwhere
-changeMintAmountsTweak::MonadTweakm=>mPl.Value
-changeMintAmountsTweak :: m Value
-changeMintAmountsTweak=do
-[(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)]
-oldMintsList<-Optic'
+changeMintAmountsTweak::MonadTweakm=>mPl.Value
+changeMintAmountsTweak :: m Value
+changeMintAmountsTweak=do
+[(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)]
+oldMintsList<-Optic'
A_Getter
'[]
TxSkel
@@ -115,98 +115,98 @@
toTxSkelMints
-> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)]
txSkelMintsToList
-letnewMintsList :: [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)]
-newMintsList=
+letnewMintsList :: [(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.VersionedMintingPolicy
-policyLanguage
-version,MintsRedeemer
-redeemer,TokenName
-tName,Integer
-oldAmount)->
-letac :: AssetClass
-ac=CurrencySymbol -> TokenName -> AssetClass
+(\(Pl.VersionedMintingPolicy
+policyLanguage
+version,MintsRedeemer
+redeemer,TokenName
+tName,Integer
+oldAmount)->
+letac :: 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.mintingPolicyHashMintingPolicy
-policy)TokenName
-tName
-newAmount :: Integer
-newAmount=AssetClass -> Integer -> Integer
-changeAssetClass
-acInteger
-oldAmount
+policy)TokenName
+tName
+newAmount :: Integer
+newAmount=AssetClass -> Integer -> Integer
+changeAssetClass
+acInteger
+oldAmountin(MintingPolicy -> Language -> Versioned MintingPolicy
forall script. script -> Language -> Versioned script
Pl.VersionedMintingPolicy
-policyLanguage
-version,MintsRedeemer
-redeemer,TokenName
-tName,Integer -> Integer -> Integer
+policyLanguage
+version,MintsRedeemer
+redeemer,TokenName
+tName,Integer -> Integer -> Integer
forall a. Ord a => a -> a -> a
maxInteger
-newAmountInteger
-oldAmount)
+newAmountInteger
+oldAmount))[(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)]
-oldMintsList
+oldMintsListBool -> 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
-letnewMints :: TxSkelMints
-newMints=[(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)]
+oldMintsList
+letnewMints :: 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
txSkelMintsValueTxSkelMints
-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
+oldMintsListLens' TxSkel TxSkelMints -> TxSkelMints -> m ()
forall (m :: * -> *) k (is :: IxList) a.
(MonadTweak m, Is k A_Setter) =>
Optic' k is TxSkel a -> a -> m ()
setTweakLens' TxSkel TxSkelMints
txSkelMintsLTxSkelMints
-newMints
+newMintsValue -> 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
-newValueValue -> Value -> Value
+newValueValue -> Value -> Value
forall a. Semigroup a => a -> a -> a
<>Value -> Value
forall a. AdditiveGroup a => a -> a
Pl.negateValue
-oldValue
+oldValuedataDupTokenLbl=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.
-dataLtla
+dataLtla=-- | The "do nothing" modification that never failsLtlTruth|-- | The modification that never applies (i.e. always fails)LtlFalsity|-- | The modification that applies a given atomic modification at the current time step
-LtlAtoma
+LtlAtoma|-- | 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(Ltla)(Ltla)
+LtlOr(Ltla)(Ltla)|-- | 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(Ltla)(Ltla)
+LtlAnd(Ltla)(Ltla)|-- | Assert that the given formula holds at the next time step.
-LtlNext(Ltla)
+LtlNext(Ltla)|-- | 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(Ltla)(Ltla)
+LtlUntil(Ltla)(Ltla)|-- | 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(Ltla)(Ltla)
-deriving(Int -> Ltl a -> ShowS
+LtlRelease(Ltla)(Ltla)
+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::Monoida=>Ltla->[(a,Ltla)]
+nowLater::Monoida=>Ltla->[(a,Ltla)]nowLater :: Ltl a -> [(a, Ltl a)]
nowLaterLtl a
LtlTruth=[(a
@@ -112,100 +112,100 @@
LtlTruth)]nowLaterLtl a
LtlFalsity=[]
-nowLater(LtlAtoma
-g)=[(a
-g,Ltl a
+nowLater(LtlAtoma
+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)]
nowLaterLtl 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)]
nowLaterLtl a
-b
-nowLater(Ltl a
-a`LtlAnd`Ltl a
-b)=
+b
+nowLater(Ltl a
+a`LtlAnd`Ltl a
+b)=[(a
-fa -> a -> a
+fa -> 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
-cLtl a -> Ltl a -> Ltl a
+cLtl 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)]
nowLaterLtl 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)]
nowLaterLtl a
-b
+b]
-nowLater(LtlNextLtl a
-a)=[(a
+nowLater(LtlNextLtl 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
-bLtl a -> Ltl a -> Ltl a
+bLtl a -> Ltl a -> Ltl a
forall a. Ltl a -> Ltl a -> Ltl a
`LtlOr`(Ltl a
-aLtl a -> Ltl a -> Ltl a
+aLtl 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
-aLtl a -> Ltl a -> Ltl a
+aLtl 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
-bLtl a -> Ltl a -> Ltl a
+bLtl a -> Ltl a -> Ltl a
forall a. Ltl a -> Ltl a -> Ltl a
`LtlAnd`(Ltl a
-aLtl a -> Ltl a -> Ltl a
+aLtl 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
-aLtl a -> Ltl a -> Ltl a
+aLtl 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::Ltla->Bool
+finished::Ltla->Boolfinished :: Ltl a -> Bool
finishedLtl a
LtlTruth=Bool
@@ -216,26 +216,26 @@
finished(LtlAtoma
_)=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
finishedLtl a
-aBool -> Bool -> Bool
+aBool -> Bool -> Bool
&&Ltl a -> Bool
forall a. Ltl a -> Bool
finishedLtl 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
finishedLtl a
-aBool -> Bool -> Bool
+aBool -> Bool -> Bool
||Ltl a -> Bool
forall a. Ltl a -> Bool
finishedLtl a
-b
+bfinished(LtlNextLtl 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::Monoida=>[Ltla]->[(a,[Ltla])]
+nowLaterList::Monoida=>[Ltla]->[(a,[Ltla])]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)]
nowLaterwhere
-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
-ga -> a -> a
+ga -> a -> a
forall a. Semigroup a => a -> a -> a
<>a
-f,a
-ca -> [a] -> [a]
+f,a
+ca -> [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::Ltla->Ltla
+ltlSimpl::Ltla->LtlaltlSimpl :: Ltl a -> Ltl a
-ltlSimplLtl a
-expr=
-let(Ltl a
-expr',Bool
-progress)=Ltl a -> (Ltl a, Bool)
+ltlSimplLtl a
+expr=
+let(Ltl a
+expr',Bool
+progress)=Ltl a -> (Ltl a, Bool)
forall a. Ltl a -> (Ltl a, Bool)
-simplLtl a
-expr
+simplLtl a
+exprinifBool
-progressthenLtl a
-expr'elseLtl a
-expr
+progressthenLtl a
+expr'elseLtl a
+exprwhere
-simpl::Ltla->(Ltla,Bool)
-simpl :: Ltl a -> (Ltl a, Bool)
-simpl(LtlAndLtl a
-aLtl a
-b)=Ltl a -> Ltl a -> (Ltl a, Bool)
+simpl::Ltla->(Ltla,Bool)
+simpl :: Ltl a -> (Ltl a, Bool)
+simpl(LtlAndLtl a
+aLtl a
+b)=Ltl a -> Ltl a -> (Ltl a, Bool)
forall a. Ltl a -> Ltl a -> (Ltl a, Bool)
-simplAndLtl a
-aLtl a
-b
-simpl(LtlOrLtl a
-aLtl a
-b)=Ltl a -> Ltl a -> (Ltl a, Bool)
+simplAndLtl a
+aLtl a
+b
+simpl(LtlOrLtl a
+aLtl a
+b)=Ltl a -> Ltl a -> (Ltl a, Bool)
forall a. Ltl a -> Ltl a -> (Ltl a, Bool)
-simplOrLtl a
-aLtl a
-b
-simpl(LtlNextLtl a
-a)=
-let(Ltl a
-a',Bool
-pa)=Ltl a -> (Ltl a, Bool)
+simplOrLtl a
+aLtl a
+b
+simpl(LtlNextLtl a
+a)=
+let(Ltl a
+a',Bool
+pa)=Ltl a -> (Ltl a, Bool)
forall a. Ltl a -> (Ltl a, Bool)
-simplLtl a
-a
+simplLtl a
+ainifBool
-pa
+pathen(Ltl a -> Ltl a
forall a. Ltl a -> Ltl a
LtlNextLtl a
-a',Bool
+a',Bool
True)else(Ltl a -> Ltl a
forall a. Ltl a -> Ltl a
LtlNextLtl a
-a,Bool
+a,Bool
False)
-simpl(LtlUntilLtl a
-aLtl a
-b)=(Ltl a -> Ltl a -> Ltl a) -> Ltl a -> Ltl a -> (Ltl a, Bool)
+simpl(LtlUntilLtl a
+aLtl 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)
-recurse2Ltl a -> Ltl a -> Ltl a
+recurse2Ltl a -> Ltl a -> Ltl a
forall a. Ltl a -> Ltl a -> Ltl a
LtlUntilLtl a
-aLtl a
-b
-simpl(LtlReleaseLtl a
-aLtl a
-b)=(Ltl a -> Ltl a -> Ltl a) -> Ltl a -> Ltl a -> (Ltl a, Bool)
+aLtl a
+b
+simpl(LtlReleaseLtl a
+aLtl 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)
-recurse2Ltl a -> Ltl a -> Ltl a
+recurse2Ltl a -> Ltl a -> Ltl a
forall a. Ltl a -> Ltl a -> Ltl a
LtlReleaseLtl a
-aLtl a
-b
-simplLtl a
-x=(Ltl a
-x,Bool
+aLtl a
+b
+simplLtl a
+x=(Ltl a
+x,Bool
False)
-simplAnd::Ltla->Ltla->(Ltla,Bool)
-simplAnd :: Ltl a -> Ltl a -> (Ltl a, Bool)
-simplAndLtl a
-aLtl a
-b=
-let(Ltl a
-a',Bool
-pa)=Ltl a -> (Ltl a, Bool)
+simplAnd::Ltla->Ltla->(Ltla,Bool)
+simplAnd :: Ltl a -> Ltl a -> (Ltl a, Bool)
+simplAndLtl a
+aLtl a
+b=
+let(Ltl a
+a',Bool
+pa)=Ltl a -> (Ltl a, Bool)
forall a. Ltl a -> (Ltl a, Bool)
-simplLtl a
-a
-(Ltl a
-b',Bool
-pb)=Ltl a -> (Ltl a, Bool)
+simplLtl a
+a
+(Ltl a
+b',Bool
+pb)=Ltl a -> (Ltl a, Bool)
forall a. Ltl a -> (Ltl a, Bool)
-simplLtl a
-b
+simplLtl a
+bincase(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)
_->ifBool
-paBool -> Bool -> Bool
+paBool -> Bool -> Bool
||Bool
-pbthen(Ltl a -> Ltl a -> Ltl a
+pbthen(Ltl a -> Ltl a -> Ltl a
forall a. Ltl a -> Ltl a -> Ltl a
LtlAndLtl 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
LtlAndLtl a
-aLtl a
-b,Bool
+aLtl a
+b,Bool
False)
-simplOr::Ltla->Ltla->(Ltla,Bool)
-simplOr :: Ltl a -> Ltl a -> (Ltl a, Bool)
-simplOrLtl a
-aLtl a
-b=
-let(Ltl a
-a',Bool
-pa)=Ltl a -> (Ltl a, Bool)
+simplOr::Ltla->Ltla->(Ltla,Bool)
+simplOr :: Ltl a -> Ltl a -> (Ltl a, Bool)
+simplOrLtl a
+aLtl a
+b=
+let(Ltl a
+a',Bool
+pa)=Ltl a -> (Ltl a, Bool)
forall a. Ltl a -> (Ltl a, Bool)
-simplLtl a
-a
-(Ltl a
-b',Bool
-pb)=Ltl a -> (Ltl a, Bool)
+simplLtl a
+a
+(Ltl a
+b',Bool
+pb)=Ltl a -> (Ltl a, Bool)
forall a. Ltl a -> (Ltl a, Bool)
-simplLtl a
-b
+simplLtl a
+bincase(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)
_->ifBool
-paBool -> Bool -> Bool
+paBool -> Bool -> Bool
||Bool
-pbthen(Ltl a -> Ltl a -> Ltl a
+pbthen(Ltl a -> Ltl a -> Ltl a
forall a. Ltl a -> Ltl a -> Ltl a
LtlOrLtl 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
LtlOrLtl a
-aLtl a
-b,Bool
+aLtl a
+b,Bool
False)
-recurse2::
-(Ltla->Ltla->Ltla)->
-Ltla->
-Ltla->
-(Ltla,Bool)
-recurse2 :: (Ltl a -> Ltl a -> Ltl a) -> Ltl a -> Ltl a -> (Ltl a, Bool)
-recurse2Ltl a -> Ltl a -> Ltl a
-fLtl a
-aLtl a
-b=
-let(Ltl a
-a',Bool
-pa)=Ltl a -> (Ltl a, Bool)
+recurse2::
+(Ltla->Ltla->Ltla)->
+Ltla->
+Ltla->
+(Ltla,Bool)
+recurse2 :: (Ltl a -> Ltl a -> Ltl a) -> Ltl a -> Ltl a -> (Ltl a, Bool)
+recurse2Ltl a -> Ltl a -> Ltl a
+fLtl a
+aLtl a
+b=
+let(Ltl a
+a',Bool
+pa)=Ltl a -> (Ltl a, Bool)
forall a. Ltl a -> (Ltl a, Bool)
-simplLtl a
-a
-(Ltl a
-b',Bool
-pb)=Ltl a -> (Ltl a, Bool)
+simplLtl a
+a
+(Ltl a
+b',Bool
+pb)=Ltl a -> (Ltl a, Bool)
forall a. Ltl a -> (Ltl a, Bool)
-simplLtl a
-b
+simplLtl a
+binifBool
-paBool -> Bool -> Bool
+paBool -> Bool -> Bool
||Bool
-pb
+pbthen(Ltl a -> Ltl a -> Ltl a
-fLtl a
-a'Ltl a
-b',Bool
+fLtl a
+a'Ltl a
+b',Bool
True)else(Ltl a -> Ltl a -> Ltl a
-fLtl a
-aLtl a
-b,Bool
+fLtl a
+aLtl 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.
-dataLtlOp(modification::*)(builtin::*->*)::*->*where
+dataLtlOp(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::Ltlmodification->LtlOpmodificationbuiltin()
+StartLtl::Ltlmodification->LtlOpmodificationbuiltin()-- | 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::LtlOpmodificationbuiltin()
-Builtin::builtina->LtlOpmodificationbuiltina
+StopLtl::LtlOpmodificationbuiltin()
+Builtin::builtina->LtlOpmodificationbuiltina-- | The freer monad on @op@. We think of this as the AST of a computation with-- operations of types @op a@.
-dataStaged(op::*->*)::*->*where
-Return::a->Stagedopa
-Instr::opa->(a->Stagedopb)->Stagedopb
+dataStaged(op::*->*)::*->*where
+Return::a->Stagedopa
+Instr::opa->(a->Stagedopb)->Stagedopb
-instanceFunctor(Stagedop)where
-fmap :: (a -> b) -> Staged op a -> Staged op b
-fmapa -> b
-f(Returna
-x)=b -> Staged op b
+instanceFunctor(Stagedop)where
+fmap :: (a -> b) -> Staged op a -> Staged op b
+fmapa -> b
+f(Returna
+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
-fa
-x
-fmapa -> b
-f(Instrop a
-opa -> Staged op a
-cont)=op a -> (a -> Staged op b) -> Staged op b
+fa
+x
+fmapa -> b
+f(Instrop a
+opa -> 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
Instrop 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
fmapa -> 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)
-instanceApplicative(Stagedop)where
-pure :: a -> Staged op a
+instanceApplicative(Stagedop)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
-instanceMonad(Stagedop)where
-(Returna
-x)>>= :: Staged op a -> (a -> Staged op b) -> Staged op b
->>=a -> Staged op b
-f=a -> Staged op b
-fa
-x
-(Instrop a
-ia -> Staged op a
-m)>>=a -> Staged op b
-f=op a -> (a -> Staged op b) -> Staged op b
+instanceMonad(Stagedop)where
+(Returna
+x)>>= :: Staged op a -> (a -> Staged op b) -> Staged op b
+>>=a -> Staged op b
+f=a -> Staged op b
+fa
+x
+(Instrop a
+ia -> 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
Instrop 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.
-classMonadPlusm=>InterpLtlmodificationbuiltinmwhere
-interpBuiltin::builtina->StateT[Ltlmodification]ma
+classMonadPlusm=>InterpLtlmodificationbuiltinmwhere
+interpBuiltin::builtina->StateT[Ltlmodification]ma-- | Interpret a 'Staged' computation into a suitable domain, using the function-- 'interpBuiltin' to interpret the builtins.
-interpLtl::
-(InterpLtlmodificationbuiltinm)=>
-Staged(LtlOpmodificationbuiltin)a->
-StateT[Ltlmodification]ma
+interpLtl::
+(InterpLtlmodificationbuiltinm)=>
+Staged(LtlOpmodificationbuiltin)a->
+StateT[Ltlmodification]mainterpLtl :: Staged (LtlOp modification builtin) a
-> StateT [Ltl modification] m a
-interpLtl(Returna
-a)=a -> StateT [Ltl modification] m a
+interpLtl(Returna
+a)=a -> StateT [Ltl modification] m a
forall (m :: * -> *) a. Monad m => a -> m a
returna
-a
-interpLtl(Instr(StartLtlLtl modification
-x)a -> Staged (LtlOp modification builtin) a
-f)=StateT [Ltl modification] m [Ltl modification]
+a
+interpLtl(Instr(StartLtlLtl modification
+x)a -> Staged (LtlOp modification builtin) a
+f)=StateT [Ltl modification] m [Ltl modification]
forall s (m :: * -> *). MonadState s m => m s
getStateT [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
-xLtl modification -> [Ltl modification] -> [Ltl modification]
+xLtl 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
+finterpLtl(InstrLtlOp modification builtin a
-StopLtla -> Staged (LtlOp modification builtin) a
-f)=do
-[Ltl modification]
-xs<-StateT [Ltl modification] m [Ltl modification]
+StopLtla -> Staged (LtlOp modification builtin) a
+f)=do
+[Ltl modification]
+xs<-StateT [Ltl modification] m [Ltl modification]
forall s (m :: * -> *). MonadState s m => m s
getcase[Ltl modification]
-xsof
+xsof[]->String -> StateT [Ltl modification] m a
forall a. HasCallStack => String -> a
errorString
"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->ifLtl modification -> Bool
forall a. Ltl a -> Bool
finishedLtl modification
-x
+xthendo[Ltl modification] -> StateT [Ltl modification] m ()
forall s (m :: * -> *). MonadState s m => s -> m ()
put[Ltl modification]
-rest
+restStaged (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()elseStateT [Ltl modification] m a
forall (m :: * -> *) a. MonadPlus m => m a
mzero
-interpLtl(Instr(Builtinbuiltin a
-b)a -> Staged (LtlOp modification builtin) a
-f)=builtin a -> StateT [Ltl modification] m a
+interpLtl(Instr(Builtinbuiltin 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
interpBuiltinbuiltin a
-bStateT [Ltl modification] m a
+bStateT [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::
-(InterpLtlmodificationbuiltinm)=>
-Staged(LtlOpmodificationbuiltin)a->
-StateT[Ltlmodification]ma
+interpLtlAndPruneUnfinished::
+(InterpLtlmodificationbuiltinm)=>
+Staged(LtlOpmodificationbuiltin)a->
+StateT[Ltlmodification]mainterpLtlAndPruneUnfinished :: Staged (LtlOp modification builtin) a
-> StateT [Ltl modification] m a
-interpLtlAndPruneUnfinishedStaged (LtlOp modification builtin) a
-f=do
-a
-res<-Staged (LtlOp modification builtin) a
+interpLtlAndPruneUnfinishedStaged (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
interpLtlStaged (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
getif(Ltl modification -> Bool) -> [Ltl modification] -> Bool
@@ -790,10 +790,10 @@
allLtl modification -> Bool
forall a. Ltl a -> Bool
finished[Ltl modification]
-modsthena -> StateT [Ltl modification] m a
+modsthena -> StateT [Ltl modification] m a
forall (m :: * -> *) a. Monad m => a -> m a
returna
-reselseStateT [Ltl modification] m a
+reselseStateT [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.
-classMonadm=>MonadModalmwhere
-typeModificationm::Type
-modifyLtl::Ltl(Modificationm)->ma->ma
+classMonadm=>MonadModalmwhere
+typeModificationm::Type
+modifyLtl::Ltl(Modificationm)->ma->ma
-instanceMonadModal(Staged(LtlOpmodificationbuiltin))where
-typeModification(Staged(LtlOpmodificationbuiltin))=modification
-modifyLtl :: Ltl (Modification (Staged (LtlOp modification builtin)))
+instanceMonadModal(Staged(LtlOpmodificationbuiltin))where
+typeModification(Staged(LtlOpmodificationbuiltin))=modification
+modifyLtl :: Ltl (Modification (Staged (LtlOp modification builtin)))
-> Staged (LtlOp modification builtin) a
-> Staged (LtlOp modification builtin) a
-modifyLtlLtl (Modification (Staged (LtlOp modification builtin)))
-xStaged (LtlOp modification builtin) a
-tr=LtlOp modification builtin ()
+modifyLtlLtl (Modification (Staged (LtlOp modification builtin)))
+xStaged (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 ()
StartLtlLtl modification
Ltl (Modification (Staged (LtlOp modification builtin)))
-x)() -> Staged (LtlOp modification builtin) ()
+x)() -> Staged (LtlOp modification builtin) ()
forall a (op :: * -> *). a -> Staged op a
ReturnStaged (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
-trStaged (LtlOp modification builtin) a
+trStaged (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
returna
-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 @@
importqualifiedPlutus.V2.Ledger.ApiasPV2importqualifiedPlutusTx.NumericasPl
-balancedTxSkel::MonadBlockChainBalancingm=>TxSkel->m(TxSkel,Fee,SetPV2.TxOutRef)
+balancedTxSkel::MonadBlockChainBalancingm=>TxSkel->m(TxSkel,Fee,SetPV2.TxOutRef)balancedTxSkel :: TxSkel -> m (TxSkel, Fee, Set TxOutRef)
-balancedTxSkelTxSkel
-skelUnbal=do
-letbalancingWallet :: Wallet
-balancingWallet=
+balancedTxSkelTxSkel
+skelUnbal=do
+letbalancingWallet :: Wallet
+balancingWallet=caseTxOpts -> 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
-skelUnbalof
+skelUnbalofBalancingWallet
BalanceWithFirstSigner->caseTxSkel -> [Wallet]
txSkelSignersTxSkel
-skelUnbalof
+skelUnbalof[]->[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
-BalanceWithWallet
-bWallet->Wallet
-bWallet
-letcollateralWallet :: Wallet
-collateralWallet=Wallet
-balancingWallet
-(TxSkel
-skel,Fee
-fee)<-
+bw
+BalanceWithWallet
+bWallet->Wallet
+bWallet
+letcollateralWallet :: Wallet
+collateralWallet=Wallet
+balancingWallet
+(TxSkel
+skel,Fee
+fee)<-ifTxOpts -> 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
+skelUnbalthenWallet -> TxSkel -> m (TxSkel, Fee)
forall (m :: * -> *).
@@ -93,39 +93,39 @@
Wallet -> TxSkel -> m (TxSkel, Fee)
setFeeAndBalanceWallet
-balancingWallet
+balancingWalletTxSkel
-skelUnbal
+skelUnbalelse(TxSkel, Fee) -> m (TxSkel, Fee)
forall (m :: * -> *) a. Monad m => a -> m a
return(TxSkel
-skelUnbal,Integer -> Fee
+skelUnbal,Integer -> Fee
FeeInteger
0)
-Set TxOutRef
-collateralInputs<-Wallet -> m (Set TxOutRef)
+Set TxOutRef
+collateralInputs<-Wallet -> m (Set TxOutRef)
forall (m :: * -> *).
MonadBlockChainBalancing m =>
Wallet -> m (Set TxOutRef)
calcCollateralWallet
-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::MonadBlockChainBalancingm=>(TxSkel,Fee,SetPV2.TxOutRef)->m(C.TxC.BabbageEra)
+balancedTx::MonadBlockChainBalancingm=>(TxSkel,Fee,SetPV2.TxOutRef)->m(C.TxC.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)
txSkelInputDataTxSkel
-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)
txSkelInputUtxosPV2TxSkel
-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)
txSkelReferenceInputUtxosPV2TxSkel
-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)
txOutByRefTxOutRef
-oref
+orefcaseMaybe TxOut
-mTxOutof
+mTxOutofMaybe 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"
-JustTxOut
-txOut->(TxOutRef, TxOut) -> m (TxOutRef, TxOut)
+JustTxOut
+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.toListSet 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
-insMap TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut
+insMap TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut
forall a. Semigroup a => a -> a -> a
<>Map TxOutRef TxOut
-insRefMap TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut
+insRefMap 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))
txSkelInputValidatorsTxSkel
-skel
+skelcaseGenTxParams
-> 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
-paramsMap DatumHash Datum
-consumedDataMap TxOutRef TxOut
-consumedOrReferencedTxOutsMap ValidatorHash (Versioned Validator)
-consumedValidatorsTxSkel
-skelof
-LeftGenerateTxError
-err->MockChainError -> m (Tx BabbageEra)
+fee}Params
+paramsMap DatumHash Datum
+consumedDataMap TxOutRef TxOut
+consumedOrReferencedTxOutsMap ValidatorHash (Versioned Validator)
+consumedValidatorsTxSkel
+skelof
+LeftGenerateTxError
+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
-RightTx BabbageEra
-tx->Tx BabbageEra -> m (Tx BabbageEra)
+err
+RightTx BabbageEra
+tx->Tx BabbageEra -> m (Tx BabbageEra)
forall (m :: * -> *) a. Monad m => a -> m a
returnTx 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::MonadBlockChainBalancingm=>TxSkel->mTxSkel
+ensureTxSkelOutsMinAda::MonadBlockChainBalancingm=>TxSkel->mTxSkelensureTxSkelOutsMinAda :: TxSkel -> m TxSkel
-ensureTxSkelOutsMinAdaTxSkel
-skel=do
-Params
-theParams<-Maybe EmulatorParamsModification -> Params -> Params
+ensureTxSkelOutsMinAdaTxSkel
+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
-ensureTxSkelOutHasMinAdaParams
-theParams)([TxSkelOut] -> Either GenerateTxError [TxSkelOut])
+ensureTxSkelOutHasMinAdaParams
+theParams)([TxSkelOut] -> Either GenerateTxError [TxSkelOut])
-> [TxSkelOut] -> Either GenerateTxError [TxSkelOut]
forall a b. (a -> b) -> a -> b
$TxSkel
-skelTxSkel -> Optic' A_Lens NoIx TxSkel [TxSkelOut] -> [TxSkelOut]
+skelTxSkel -> 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]
txSkelOutsLof
-LeftGenerateTxError
-err->MockChainError -> m TxSkel
+LeftGenerateTxError
+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
MCEGenerationErrorGenerateTxError
-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
-skelTxSkel -> (TxSkel -> TxSkel) -> TxSkel
+skelTxSkel -> (TxSkel -> TxSkel) -> TxSkel
forall a b. a -> (a -> b) -> b
&Optic' A_Lens NoIx TxSkel [TxSkelOut]
txSkelOutsLOptic' 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
+newTxSkelOutswhere
-ensureTxSkelOutHasMinAda::Emulator.Params->TxSkelOut->EitherGenerateTxErrorTxSkelOut
-ensureTxSkelOutHasMinAda :: Params -> TxSkelOut -> Either GenerateTxError TxSkelOut
-ensureTxSkelOutHasMinAdaParams
-theParamstxSkelOut :: TxSkelOut
-txSkelOut@(Payso
-output)=do
-TxOut CtxTx BabbageEra
-cardanoTxOut<-Params
+ensureTxSkelOutHasMinAda::Emulator.Params->TxSkelOut->EitherGenerateTxErrorTxSkelOut
+ensureTxSkelOutHasMinAda :: Params -> TxSkelOut -> Either GenerateTxError TxSkelOut
+ensureTxSkelOutHasMinAdaParams
+theParamstxSkelOut :: TxSkelOut
+txSkelOut@(Payso
+output)=do
+TxOut CtxTx BabbageEra
+cardanoTxOut<-Params
-> TxSkelOut -> Either GenerateTxError (TxOut CtxTx BabbageEra)
txSkelOutToCardanoTxOutParams
-theParamsTxSkelOut
-txSkelOut
-letPl.LovelaceInteger
-oldAda=o
-outputo -> Optic' A_Lens NoIx o Ada -> Ada
+theParamsTxSkelOut
+txSkelOut
+letPl.LovelaceInteger
+oldAda=o
+outputo -> 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.CoinInteger
-requiredAda=
+CardanoLedger.CoinInteger
+requiredAda=PParams (BabbageEra StandardCrypto)
-> TxOut (BabbageEra StandardCrypto) -> Coin
forall era. CLI era => PParams era -> TxOut era -> Coin
CardanoLedger.evaluateMinLovelaceOutput(Params -> PParams
Emulator.emulatorPParamsParams
-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
-outputo -> (o -> o) -> o
+outputo -> (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
maxInteger
-oldAdaInteger
-requiredAda)
+oldAdaInteger
+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#L124ifInteger
-oldAdaInteger -> Integer -> Bool
+oldAdaInteger -> Integer -> Bool
forall a. Ord a => a -> a -> Bool
<Integer
-requiredAda
+requiredAdathenParams -> TxSkelOut -> Either GenerateTxError TxSkelOut
-ensureTxSkelOutHasMinAdaParams
-theParamsTxSkelOut
-updatedTxSkelOut
+ensureTxSkelOutHasMinAdaParams
+theParamsTxSkelOut
+updatedTxSkelOutelseTxSkelOut -> Either GenerateTxError TxSkelOut
forall (m :: * -> *) a. Monad m => a -> m a
returnTxSkelOut
-txSkelOut
+txSkelOut
-txSkelInputUtxosPV2::MonadBlockChainBalancingm=>TxSkel->m(MapPV2.TxOutRefPV2.TxOut)
+txSkelInputUtxosPV2::MonadBlockChainBalancingm=>TxSkel->m(MapPV2.TxOutRefPV2.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::MonadBlockChainBalancingm=>TxSkel->m(MapPV2.TxOutRefLedger.TxOut)
+txSkelInputUtxos::MonadBlockChainBalancingm=>TxSkel->m(MapPV2.TxOutRefLedger.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::MonadBlockChainBalancingm=>TxSkel->m(MapPV2.TxOutRefPV2.TxOut)
+txSkelReferenceInputUtxosPV2::MonadBlockChainBalancingm=>TxSkel->m(MapPV2.TxOutRefPV2.TxOut)txSkelReferenceInputUtxosPV2 :: TxSkel -> m (Map TxOutRef TxOut)
-txSkelReferenceInputUtxosPV2TxSkel
-skel=(TxOut -> TxOut) -> Map TxOutRef TxOut -> Map TxOutRef TxOut
+txSkelReferenceInputUtxosPV2TxSkel
+skel=(TxOut -> TxOut) -> Map TxOutRef TxOut -> Map TxOutRef TxOut
forall a b k. (a -> b) -> Map k a -> Map k b
Map.mapTxOut -> TxOut
txOutV2FromLedger(Map TxOutRef TxOut -> Map TxOutRef TxOut)
@@ -497,12 +497,12 @@
MonadBlockChainBalancing m =>
TxSkel -> m (Map TxOutRef TxOut)
txSkelReferenceInputUtxosTxSkel
-skel
+skel
-txSkelReferenceInputUtxos::MonadBlockChainBalancingm=>TxSkel->m(MapPV2.TxOutRefLedger.TxOut)
+txSkelReferenceInputUtxos::MonadBlockChainBalancingm=>TxSkel->m(MapPV2.TxOutRefLedger.TxOut)txSkelReferenceInputUtxos :: TxSkel -> m (Map TxOutRef TxOut)
-txSkelReferenceInputUtxosTxSkel
-skel=
+txSkelReferenceInputUtxosTxSkel
+skel=[TxOutRef] -> m (Map TxOutRef TxOut)
forall (m :: * -> *).
MonadBlockChainBalancing m =>
@@ -516,12 +516,12 @@
forall a b. (a -> Maybe b) -> [a] -> [b]
mapMaybe(\case
-TxSkelRedeemerForReferencedScriptTxOutRef
-orefredeemer
+TxSkelRedeemerForReferencedScriptTxOutRef
+orefredeemer
_->TxOutRef -> Maybe TxOutRef
forall a. a -> Maybe a
JustTxOutRef
-oref
+orefTxSkelRedeemer
_->Maybe TxOutRef
forall a. Maybe a
@@ -534,7 +534,7 @@
forall a b. (a -> b) -> a -> b
$TxSkel -> Map TxOutRef TxSkelRedeemer
txSkelInsTxSkel
-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::MonadBlockChainBalancingm=>TxSkel->m(MapPV2.ValidatorHash(Pl.VersionedPV2.Validator))
+txSkelInputValidators::MonadBlockChainBalancingm=>TxSkel->m(MapPV2.ValidatorHash(Pl.VersionedPV2.Validator))txSkelInputValidators :: TxSkel -> m (Map ValidatorHash (Versioned Validator))
-txSkelInputValidatorsTxSkel
-skel=do
-[(TxOutRef, TxOut)]
-utxos<-Map TxOutRef TxOut -> [(TxOutRef, TxOut)]
+txSkelInputValidatorsTxSkel
+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)->caseTxOut -> Address
+(\(TxOutRef
+_oref,TxOut
+out)->caseTxOut -> Address
forall o.
(IsAbstractOutput o, ToCredential (OwnerType o)) =>
o -> Address
outputAddressTxOut
-outof
-PV2.Address(PV2.ScriptCredentialValidatorHash
-valHash)Maybe StakingCredential
+outof
+PV2.Address(PV2.ScriptCredentialValidatorHash
+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))
validatorFromHashValidatorHash
-valHash
+valHashcaseMaybe (Versioned Validator)
-mValof
+mValofMaybe (Versioned Validator)
Nothing->MockChainError -> m (Maybe (ValidatorHash, Versioned Validator))
@@ -616,9 +616,9 @@
[Char]
"txSkelInputValidators: unkown validator hash on transaction input"ValidatorHash
-valHash
-JustVersioned Validator
-val->Maybe (ValidatorHash, Versioned Validator)
+valHash
+JustVersioned 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
+utxosMap 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::MonadBlockChainBalancingm=>[PV2.TxOutRef]->m(MapPV2.TxOutRefPV2.TxOut)
+lookupUtxosPV2::MonadBlockChainBalancingm=>[PV2.TxOutRef]->m(MapPV2.TxOutRefPV2.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.mapTxOut -> TxOut
txOutV2FromLedger(Map TxOutRef TxOut -> Map TxOutRef TxOut)
@@ -690,12 +690,12 @@
MonadBlockChainBalancing m =>
[TxOutRef] -> m (Map TxOutRef TxOut)
lookupUtxos[TxOutRef]
-outRefs
+outRefs
-lookupUtxos::MonadBlockChainBalancingm=>[PV2.TxOutRef]->m(MapPV2.TxOutRefLedger.TxOut)
+lookupUtxos::MonadBlockChainBalancingm=>[PV2.TxOutRef]->m(MapPV2.TxOutRefLedger.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)
txOutByRefLedgerTxOutRef
-oRef
-TxOut
-out<-caseMaybe TxOut
-mOutof
+oRef
+TxOut
+out<-caseMaybe TxOut
+mOutofMaybe TxOut
Nothing->MockChainError -> m TxOut
@@ -732,34 +732,34 @@
[Char]
"lookupUtxos: unknown TxOutRef"TxOutRef
-oRef
-JustTxOut
-out->TxOut -> m TxOut
+oRef
+JustTxOut
+out->TxOut -> m TxOut
forall (m :: * -> *) a. Monad m => a -> m a
returnTxOut
-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::MonadBlockChainBalancingm=>TxSkel->mPV2.Value
+txSkelInputValue::MonadBlockChainBalancingm=>TxSkel->mPV2.ValuetxSkelInputValue :: TxSkel -> m Value
-txSkelInputValueTxSkel
-skel=do
-Map TxOutRef TxOut
-txSkelInputs<-TxSkel -> m (Map TxOutRef TxOut)
+txSkelInputValueTxSkel
+skel=do
+Map TxOutRef TxOut
+txSkelInputs<-TxSkel -> m (Map TxOutRef TxOut)
forall (m :: * -> *).
MonadBlockChainBalancing m =>
TxSkel -> m (Map TxOutRef TxOut)
txSkelInputUtxosTxSkel
-skel
+skelValue -> 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::MonadBlockChainBalancingm=>TxSkel->m(MapPV2.DatumHashPV2.Datum)
+txSkelInputData::MonadBlockChainBalancingm=>TxSkel->m(MapPV2.DatumHashPV2.Datum)txSkelInputData :: TxSkel -> m (Map DatumHash Datum)
-txSkelInputDataTxSkel
-skel=do
-[TxOut]
-txSkelInputs<-Map TxOutRef TxOut -> [TxOut]
+txSkelInputDataTxSkel
+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)
txSkelInputUtxosPV2TxSkel
-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->caseTxOut
-outputTxOut -> Optic' A_Lens NoIx TxOut OutputDatum -> OutputDatum
+outputTxOut -> 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 @@
returnMaybe (DatumHash, Datum)
forall a. Maybe a
Nothing
-PV2.OutputDatumDatum
-datum->
-letdHash :: DatumHash
-dHash=Datum -> DatumHash
+PV2.OutputDatumDatum
+datum->
+letdHash :: DatumHash
+dHash=Datum -> DatumHash
Pl.datumHashDatum
-datum
+datumin(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
-datumFromHashWithErrorDatumHash
-dHash
-PV2.OutputDatumHashDatumHash
-dHash->
+datumFromHashWithErrorDatumHash
+dHash
+PV2.OutputDatumHashDatumHash
+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
-datumFromHashWithErrorDatumHash
-dHash
+datumFromHashWithErrorDatumHash
+dHash)[TxOut]
-txSkelInputs
+txSkelInputsMap 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
+mDatumswhere
-datumFromHashWithError::MonadBlockChainBalancingm=>Pl.DatumHash->mPV2.Datum
-datumFromHashWithError :: DatumHash -> m Datum
-datumFromHashWithErrorDatumHash
-dHash=do
-Maybe Datum
-mDatum<-DatumHash -> m (Maybe Datum)
+datumFromHashWithError::MonadBlockChainBalancingm=>Pl.DatumHash->mPV2.Datum
+datumFromHashWithError :: DatumHash -> m Datum
+datumFromHashWithErrorDatumHash
+dHash=do
+Maybe Datum
+mDatum<-DatumHash -> m (Maybe Datum)
forall (m :: * -> *).
MonadBlockChainBalancing m =>
DatumHash -> m (Maybe Datum)
datumFromHashDatumHash
-dHash
+dHashcaseMaybe Datum
-mDatumof
+mDatumofMaybe Datum
Nothing->MockChainError -> m Datum
@@ -908,20 +908,20 @@
[Char]
"txSkelInputData: Transaction input with un-resolvable datum hash"DatumHash
-dHash
-JustDatum
-datum->Datum -> m Datum
+dHash
+JustDatum
+datum->Datum -> m Datum
forall (m :: * -> *) a. Monad m => a -> m a
returnDatum
-datum
+datumgetEmulatorUTxO::MapPV2.TxOutRefLedger.TxOut->EitherLedger.ToCardanoError(Emulator.UTxOEmulator.EmulatorEra)getEmulatorUTxO :: Map TxOutRef TxOut
-> Either ToCardanoError (UTxO (BabbageEra StandardCrypto))
-getEmulatorUTxOMap TxOutRef TxOut
-m=
+getEmulatorUTxOMap 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.toCardanoTxInTxOutRef
-kEither
+kEither
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.toCtxUTxOTxOutTxOut
-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.toListMap 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::MonadBlockChainBalancingm=>Wallet->TxSkel->m(TxSkel,Fee)
+setFeeAndBalance::MonadBlockChainBalancingm=>Wallet->TxSkel->m(TxSkel,Fee)setFeeAndBalance :: Wallet -> TxSkel -> m (TxSkel, Fee)
-setFeeAndBalanceWallet
-balanceWalletTxSkel
-skel0=do
+setFeeAndBalanceWallet
+balanceWalletTxSkel
+skel0=do-- do the min Ada adjustment if it's requested
-TxSkel
-skel<-
+TxSkel
+skel<-ifTxOpts -> 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
+skel0thenTxSkel -> m TxSkel
forall (m :: * -> *).
MonadBlockChainBalancing m =>
TxSkel -> m TxSkel
ensureTxSkelOutsMinAdaTxSkel
-skel0
+skel0elseTxSkel -> m TxSkel
forall (m :: * -> *) a. Monad m => a -> m a
returnTxSkel
-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
-<$>letbalanceWalletAddress :: Address
-balanceWalletAddress=Wallet -> Address
+<$>letbalanceWalletAddress :: Address
+balanceWalletAddress=Wallet -> Address
walletAddressWallet
-balanceWallet
-noDatumPredicate :: TxOut -> Bool
-noDatumPredicate=(\caseOutputDatum
+balanceWallet
+noDatumPredicate :: TxOut -> Bool
+noDatumPredicate=(\caseOutputDatum
PV2.NoOutputDatum->Bool
True;OutputDatum
_->Bool
@@ -1066,14 +1066,14 @@
txSkelOpts(TxSkel -> BalancingUtxos) -> TxSkel -> BalancingUtxos
forall a b. (a -> b) -> a -> b
$TxSkel
-skel0of
+skel0ofBalancingUtxos
BalancingUtxosAll->Address -> m [(TxOutRef, TxOut)]
forall (m :: * -> *).
MonadBlockChainBalancing m =>
Address -> m [(TxOutRef, TxOut)]
utxosAtLedgerAddress
-balanceWalletAddress
+balanceWalletAddressBalancingUtxos
BalancingUtxosDatumless->UtxoSearch m TxOut -> m [(TxOutRef, TxOut)]
forall (m :: * -> *) a.
@@ -1084,20 +1084,20 @@
MonadBlockChainBalancing m =>
Address -> UtxoSearch m TxOut
utxosAtLedgerSearchAddress
-balanceWalletAddressUtxoSearch m TxOut -> (TxOut -> Bool) -> UtxoSearch m TxOut
+balanceWalletAddressUtxoSearch 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)]
utxosAtLedgerAddress
-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)]
utxosAtLedgerAddress
-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)
txSkelInputUtxosTxSkel
-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)
txSkelReferenceInputUtxosTxSkel
-skel
-letindex :: Either ToCardanoError (UTxO (BabbageEra StandardCrypto))
-index=Map TxOutRef TxOut
+skel
+letindex :: 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
-txSkelReferencedUtxosMap TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut
+txSkelReferencedUtxosMap TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut
forall a. Semigroup a => a -> a -> a
<>Map TxOutRef TxOut
-txSkelUtxosMap TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut
+txSkelUtxosMap TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut
forall a. Semigroup a => a -> a -> a
<>Map TxOutRef TxOut
-balancePKUtxos
+balancePKUtxoscaseEither ToCardanoError (UTxO (BabbageEra StandardCrypto))
-indexof
-LeftToCardanoError
-err->MockChainError -> m (TxSkel, Fee)
+indexof
+LeftToCardanoError
+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]
showToCardanoError
-err
-RightUTxO (BabbageEra StandardCrypto)
-cUtxoIndex->do
+err
+RightUTxO (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.
-letstartingFee :: Fee
-startingFee=Integer -> Fee
+letstartingFee :: Fee
+startingFee=Integer -> Fee
FeeInteger
3000000Int
@@ -1210,11 +1210,11 @@
-> UTxO (BabbageEra StandardCrypto)
-> TxSkel
-> m (TxSkel, Fee)
-calcFeeInt
+calcFeeInt
5Fee
-startingFeeUTxO (BabbageEra StandardCrypto)
-cUtxoIndexTxSkel
-skel
+startingFeeUTxO (BabbageEra StandardCrypto)
+cUtxoIndexTxSkel
+skelm (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
-letminFee :: Fee
-minFee=Integer -> Fee
+letminFee :: Fee
+minFee=Integer -> Fee
FeeInteger
10-- forall tx. Pl.minFee tx = 10 lovelaceinInt
@@ -1246,88 +1246,88 @@
-> UTxO (BabbageEra StandardCrypto)
-> TxSkel
-> m (TxSkel, Fee)
-calcFeeInt
+calcFeeInt
5Fee
-minFeeUTxO (BabbageEra StandardCrypto)
-cUtxoIndexTxSkel
-skel
+minFeeUTxO (BabbageEra StandardCrypto)
+cUtxoIndexTxSkel
+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
throwErrorMockChainError
-e
+ewhere-- Inspired by https://github.com/input-output-hk/plutus-apps/blob/d4255f05477fd8477ee9673e850ebb9ebb8c9657/plutus-contract/src/Wallet/Emulator/Wallet.hs#L329
-calcFee::
-MonadBlockChainBalancingm=>
+calcFee::
+MonadBlockChainBalancingm=>Int->Fee->Emulator.UTxOEmulator.EmulatorEra->TxSkel->
-m(TxSkel,Fee)
-calcFee :: Int
+m(TxSkel,Fee)
+calcFee :: Int
-> Fee
-> UTxO (BabbageEra StandardCrypto)
-> TxSkel
-> m (TxSkel, Fee)
-calcFeeInt
-nFee
-feeUTxO (BabbageEra StandardCrypto)
-cUtxoIndexTxSkel
-skel=do
-TxSkel
-attemptedSkel<-Wallet -> TxSkel -> Fee -> m TxSkel
+calcFeeInt
+nFee
+feeUTxO (BabbageEra StandardCrypto)
+cUtxoIndexTxSkel
+skel=do
+TxSkel
+attemptedSkel<-Wallet -> TxSkel -> Fee -> m TxSkel
forall (m :: * -> *).
MonadBlockChainBalancing m =>
Wallet -> TxSkel -> Fee -> m TxSkel
balanceTxFromAuxWallet
-balanceWalletTxSkel
-skelFee
-fee
-Map DatumHash Datum
-managedData<-TxSkel -> m (Map DatumHash Datum)
+balanceWalletTxSkel
+skelFee
+fee
+Map DatumHash Datum
+managedData<-TxSkel -> m (Map DatumHash Datum)
forall (m :: * -> *).
MonadBlockChainBalancing m =>
TxSkel -> m (Map DatumHash Datum)
txSkelInputDataTxSkel
-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)
txSkelInputUtxosPV2TxSkel
-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)
txSkelReferenceInputUtxosPV2TxSkel
-skel
+skelMap 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
-insMap TxOutRef TxOut -> Map TxOutRef TxOut -> Map TxOutRef TxOut
+insMap 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))
txSkelInputValidatorsTxSkel
-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
estimateTxSkelFeeParams
-theParamsUTxO (BabbageEra StandardCrypto)
-cUtxoIndexMap DatumHash Datum
-managedDataMap TxOutRef TxOut
-managedTxOutsMap ValidatorHash (Versioned Validator)
-managedValidatorsTxSkel
-attemptedSkelFee
-feeof
+theParamsUTxO (BabbageEra StandardCrypto)
+cUtxoIndexMap DatumHash Datum
+managedDataMap TxOutRef TxOut
+managedTxOutsMap ValidatorHash (Versioned Validator)
+managedValidatorsTxSkel
+attemptedSkelFee
+feeof-- necessary to capture script failure for failed cases
-Lefterr :: MockChainError
-err@MCEValidationError{}->MockChainError -> m (TxSkel, Fee)
+Lefterr :: MockChainError
+err@MCEValidationError{}->MockChainError -> m (TxSkel, Fee)
forall e (m :: * -> *) a. MonadError e m => e -> m a
throwErrorMockChainError
-err
-LeftMockChainError
-err->MockChainError -> m (TxSkel, Fee)
+err
+LeftMockChainError
+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
MCECalcFeeMockChainError
-err
-RightFee
-newFee
+err
+RightFee
+newFee|Fee
-newFeeFee -> Fee -> Bool
+newFeeFee -> 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
-nInt -> Int -> Bool
+nInt -> 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
maxFee
-newFeeFee
-fee)-- maximum number of iterations
+newFeeFee
+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
-nInt -> Int -> Int
+calcFee(Int
+nInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1)Fee
-newFeeUTxO (BabbageEra StandardCrypto)
-cUtxoIndexTxSkel
-skel
+newFeeUTxO (BabbageEra StandardCrypto)
+cUtxoIndexTxSkel
+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
-estimateTxSkelFeeParams
-paramsUTxO (BabbageEra StandardCrypto)
-cUtxoIndexMap DatumHash Datum
-managedDataMap TxOutRef TxOut
-managedTxOutsMap ValidatorHash (Versioned Validator)
-managedValidatorsTxSkel
-skelFee
-fee=do
-TxBodyContent BuildTx BabbageEra
-txBodyContent<-
+estimateTxSkelFeeParams
+paramsUTxO (BabbageEra StandardCrypto)
+cUtxoIndexMap DatumHash Datum
+managedDataMap TxOutRef TxOut
+managedTxOutsMap ValidatorHash (Versioned Validator)
+managedValidatorsTxSkel
+skelFee
+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
-paramsMap DatumHash Datum
-managedDataMap TxOutRef TxOut
-managedTxOutsMap ValidatorHash (Versioned Validator)
-managedValidatorsTxSkel
-skel
-letnkeys :: Word
-nkeys=TxBodyContent BuildTx BabbageEra -> Word
+fee}Params
+paramsMap DatumHash Datum
+managedDataMap TxOutRef TxOut
+managedTxOutsMap ValidatorHash (Versioned Validator)
+managedValidatorsTxSkel
+skel
+letnkeys :: Word
+nkeys=TxBodyContent BuildTx BabbageEra -> Word
forall era. TxBodyContent BuildTx era -> Word
C.estimateTransactionKeyWitnessCountTxBodyContent 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
-LeftValidationErrorInPhase
-err->ValidationErrorInPhase -> MockChainError
+LeftValidationErrorInPhase
+err->ValidationErrorInPhase -> MockChainError
MCEValidationErrorValidationErrorInPhase
-err
-RightToCardanoError
-err->GenerateTxError -> MockChainError
+err
+RightToCardanoError
+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.makeTransactionBodyParams
-paramsUTxO (BabbageEra StandardCrypto)
-cUtxoIndex(TxBodyContent BuildTx BabbageEra -> CardanoBuildTx
+paramsUTxO (BabbageEra StandardCrypto)
+cUtxoIndex(TxBodyContent BuildTx BabbageEra -> CardanoBuildTx
Ledger.CardanoBuildTxTxBodyContent BuildTx BabbageEra
-txBodyContent)
+txBodyContent)caseProtocolParameters -> TxBody BabbageEra -> Word -> Word -> Lovelace
forall era.
IsShelleyBasedEra era =>
ProtocolParameters -> TxBody era -> Word -> Word -> Lovelace
C.evaluateTransactionFee(Params -> ProtocolParameters
Emulator.pProtocolParamsParams
-params)TxBody BabbageEra
-txBodyWord
-nkeysWord
+params)TxBody BabbageEra
+txBodyWord
+nkeysWord
0of
-C.LovelaceInteger
-fee->Fee -> Either MockChainError Fee
+C.LovelaceInteger
+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
FeeInteger
-fee
+fee-- | Calculates the collateral for a transaction
-calcCollateral::MonadBlockChainBalancingm=>Wallet->m(SetPV2.TxOutRef)
+calcCollateral::MonadBlockChainBalancingm=>Wallet->m(SetPV2.TxOutRef)calcCollateral :: Wallet -> m (Set TxOutRef)
-calcCollateralWallet
-w=do
-[(TxOutRef, ConcreteOutput Credential () Ada ScriptHash)]
-souts<-
+calcCollateralWallet
+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
walletAddressWallet
-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::MonadBlockChainBalancingm=>Wallet->TxSkel->Fee->mTxSkel
+balanceTxFromAux::MonadBlockChainBalancingm=>Wallet->TxSkel->Fee->mTxSkelbalanceTxFromAux :: Wallet -> TxSkel -> Fee -> m TxSkel
-balanceTxFromAuxWallet
-balanceWalletTxSkel
-txskelFee
-fee=do
-bres :: BalanceTxRes
-bres@(BalanceTxRes{[(TxOutRef, TxOut)]
+balanceTxFromAuxWallet
+balanceWalletTxSkel
+txskelFee
+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
calcBalanceTxWallet
-balanceWalletTxSkel
-txskelFee
-fee
+balanceWalletTxSkel
+txskelFee
+feecasePubKeyHash -> BalanceTxRes -> TxSkel -> Maybe TxSkel
applyBalanceTx(Wallet -> PubKeyHash
walletPKHashWallet
-balanceWallet)BalanceTxRes
-bresTxSkel
-txskelof
-JustTxSkel
-txskel'->TxSkel -> m TxSkel
+balanceWallet)BalanceTxRes
+bresTxSkel
+txskelof
+JustTxSkel
+txskel'->TxSkel -> m TxSkel
forall (m :: * -> *) a. Monad m => a -> m a
returnTxSkel
-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
+txskelwhere
-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)dataBalanceTxRes=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::MonadBlockChainBalancingm=>Wallet->TxSkel->Fee->mBalanceTxRes
+calcBalanceTx::MonadBlockChainBalancingm=>Wallet->TxSkel->Fee->mBalanceTxRescalcBalanceTx :: Wallet -> TxSkel -> Fee -> m BalanceTxRes
-calcBalanceTxWallet
-balanceWalletTxSkel
-skelFee
-fee=do
-Value
-inValue<-(Value -> Value -> Value
+calcBalanceTxWallet
+balanceWalletTxSkel
+skelFee
+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
txSkelMintsTxSkel
-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
txSkelInputValueTxSkel
-skel-- transaction inputs + minted value
-letoutValue :: Value
-outValue=TxSkel -> Fee -> Value
+skel-- transaction inputs + minted value
+letoutValue :: Value
+outValue=TxSkel -> Fee -> Value
txSkelOutputValueTxSkel
-skelFee
-fee-- transaction outputs + fee + burned value
-difference :: Value
-difference=Value
-outValueValue -> Value -> Value
+skelFee
+fee-- transaction outputs + fee + burned value
+difference :: Value
+difference=Value
+outValueValue -> Value -> Value
forall a. Semigroup a => a -> a -> a
<>Value -> Value
forall a. AdditiveGroup a => a -> a
Pl.negateValue
-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
positivePartValue
-difference
+difference-- This will be paid to 'balancePK' in any case:
-initialExcess :: Value
-initialExcess=Value -> Value
+initialExcess :: Value
+initialExcess=Value -> Value
negativePartValue
-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
txSkelInsTxSkel
-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
walletAddressWallet
-balanceWallet)
+balanceWallet)case[(TxOutRef, TxOut)]
-> [(TxOutRef, TxOut)] -> Value -> Value -> Maybe BalanceTxRes
-selectNewInputs[(TxOutRef, TxOut)]
-candidateUtxos[]Value
-initialExcessValue
-missingValueof
+selectNewInputs[(TxOutRef, TxOut)]
+candidateUtxos[]Value
+initialExcessValue
+missingValueofMaybe BalanceTxRes
Nothing->MockChainError -> m BalanceTxRes
@@ -1907,29 +1907,29 @@
MCEUnbalanceable(Wallet -> Value -> MCEUnbalanceableError
MCEUnbalNotEnoughFundsWallet
-balanceWalletValue
-missingValue)
+balanceWalletValue
+missingValue)TxSkel
-skel
-JustBalanceTxRes
-bTxRes->BalanceTxRes -> m BalanceTxRes
+skel
+JustBalanceTxRes
+bTxRes->BalanceTxRes -> m BalanceTxRes
forall (m :: * -> *) a. Monad m => a -> m a
returnBalanceTxRes
-bTxRes
+bTxReswhere
-selectNewInputs::
+selectNewInputs::[(PV2.TxOutRef,PV2.TxOut)]->[(PV2.TxOutRef,PV2.TxOut)]->PV2.Value->PV2.Value->MaybeBalanceTxRes
-selectNewInputs :: [(TxOutRef, TxOut)]
+selectNewInputs :: [(TxOutRef, TxOut)]
-> [(TxOutRef, TxOut)] -> Value -> Value -> Maybe BalanceTxRes
-selectNewInputs[(TxOutRef, TxOut)]
-available[(TxOutRef, TxOut)]
-chosenValue
-excessValue
-missing=
+selectNewInputs[(TxOutRef, TxOut)]
+available[(TxOutRef, TxOut)]
+chosenValue
+excessValue
+missing=caseOptic' 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
viewOptic' An_Iso NoIx Value [(AssetClass, Integer)]
flattenValueIValue
-missingof
+missingof[]->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)]
-chosenValue
-excess[(TxOutRef, TxOut)]
-available
-(AssetClass
-ac,Integer
+chosenValue
+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.assetClassValueAssetClass
-acInteger
+acInteger
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)]
-availableof
+availableofMaybe 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.
-JustInt
-i->
-let([(TxOutRef, TxOut)]
-left,(TxOutRef, TxOut)
-theChosenUtxo:[(TxOutRef, TxOut)]
-right)=Int
+JustInt
+i->
+let([(TxOutRef, TxOut)]
+left,(TxOutRef, TxOut)
+theChosenUtxo:[(TxOutRef, TxOut)]
+right)=Int
-> [(TxOutRef, TxOut)]
-> ([(TxOutRef, TxOut)], [(TxOutRef, TxOut)])
forall a. Int -> [a] -> ([a], [a])
splitAtInt
-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
-missingValue -> Value -> Value
+theChosenUtxo
+theChosenDifference :: Value
+theChosenDifference=Value
+missingValue -> Value -> Value
forall a. Semigroup a => a -> a -> a
<>Value -> Value
forall a. AdditiveGroup a => a -> a
Pl.negateValue
-theChosenValue
-excess' :: Value
-excess'=Value
-excessValue -> Value -> Value
+theChosenValue
+excess' :: Value
+excess'=Value
+excessValue -> Value -> Value
forall a. Semigroup a => a -> a -> a
<>Value -> Value
negativePartValue
-theChosenDifference
-missing' :: Value
-missing'=Value -> Value
+theChosenDifference
+missing' :: Value
+missing'=Value -> Value
positivePartValue
-theChosenDifference
+theChosenDifferencein-- 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->MaybeTxSkelapplyBalanceTx :: PubKeyHash -> BalanceTxRes -> TxSkel -> Maybe TxSkel
-applyBalanceTxPubKeyHash
-balancePK(BalanceTxRes[(TxOutRef, TxOut)]
-newInputsValue
-returnValue[(TxOutRef, TxOut)]
-availableUtxos)TxSkel
-skel=do
+applyBalanceTxPubKeyHash
+balancePK(BalanceTxRes[(TxOutRef, TxOut)]
+newInputsValue
+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]
txSkelOutsTxSkel
-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,ConcreteOutputPV2.PubKeyHash()Pl.AdaPV2.ScriptHash)]
-candidateOutputsWithIndices :: [(Int, ConcreteOutput PubKeyHash () Ada ScriptHash)]
-candidateOutputsWithIndices=
+candidateOutputsWithIndices::[(Int,ConcreteOutputPV2.PubKeyHash()Pl.AdaPV2.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,Payso
-output)->
+(\(Int
+i,Payso
+output)->case(PubKeyHash
-> o
-> Maybe
@@ -2119,7 +2119,7 @@
(ValueType output)
(ReferenceScriptType output))
isPKOutputFromPubKeyHash
-balancePK
+balancePK(o
-> Maybe
(ConcreteOutput
@@ -2207,20 +2207,20 @@
toOutputWithReferenceScriptHash)o
-outputof
+outputofMaybe (ConcreteOutput PubKeyHash () Ada ScriptHash)
Nothing->Maybe (Int, ConcreteOutput PubKeyHash () Ada ScriptHash)
forall a. Maybe a
Nothing
-JustConcreteOutput PubKeyHash () Ada ScriptHash
-output'->(Int, ConcreteOutput PubKeyHash () Ada ScriptHash)
+JustConcreteOutput 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
fromIntegralInt
-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::MaybeInt
-mBestOutputIndex :: Maybe Int
-mBestOutputIndex=case((Int, ConcreteOutput PubKeyHash () Ada ScriptHash)
+mBestOutputIndex::MaybeInt
+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)]
-candidateOutputsWithIndicesof
+candidateOutputsWithIndicesof[]->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
JustInt
-best
+best
-ins :: Map TxOutRef TxSkelRedeemer
-ins=TxSkel -> Map TxOutRef TxSkelRedeemer
+ins :: Map TxOutRef TxSkelRedeemer
+ins=TxSkel -> Map TxOutRef TxSkelRedeemer
txSkelInsTxSkel
-skel
-(Map TxOutRef TxSkelRedeemer
-newIns,[TxSkelOut]
-newOuts)<-
+skel
+(Map TxOutRef TxSkelRedeemer
+newIns,[TxSkelOut]
+newOuts)<-caseMaybe Int
-mBestOutputIndexof
-JustInt
-i->
-let([TxSkelOut]
-left,TxSkelOut
-bestTxOut:[TxSkelOut]
-right)=Int -> [TxSkelOut] -> ([TxSkelOut], [TxSkelOut])
+mBestOutputIndexof
+JustInt
+i->
+let([TxSkelOut]
+left,TxSkelOut
+bestTxOut:[TxSkelOut]
+right)=Int -> [TxSkelOut] -> ([TxSkelOut], [TxSkelOut])
forall a. Int -> [a] -> ([a], [a])
splitAtInt
-i[TxSkelOut]
-outs
+i[TxSkelOut]
+outsincaseTxOpts -> BalanceOutputPolicy
txOptBalanceOutputPolicy(TxOpts -> BalanceOutputPolicy) -> TxOpts -> BalanceOutputPolicy
forall a b. (a -> b) -> a -> b
$TxSkel -> TxOpts
txSkelOptsTxSkel
-skelof
+skelofBalanceOutputPolicy
AdjustExistingOutput->
-letbestTxOutValue :: Value
-bestTxOutValue=TxSkelOut -> Value
+letbestTxOutValue :: Value
+bestTxOutValue=TxSkelOut -> Value
txSkelOutValueTxSkelOut
-bestTxOut
-adjustedValue :: Value
-adjustedValue=Value
-bestTxOutValueValue -> Value -> Value
+bestTxOut
+adjustedValue :: Value
+adjustedValue=Value
+bestTxOutValueValue -> Value -> Value
forall a. Semigroup a => a -> a -> a
<>Value
-returnValue
+returnValueinifValue
-adjustedValueValue -> Value -> Bool
+adjustedValueValue -> Value -> Bool
`Pl.geq`Ada -> Value
Pl.toValueAda
Ledger.minAdaTxOutEstimated-- TODO make thid dependen on the atual TxOut
@@ -2337,7 +2337,7 @@
forall a. a -> Maybe a
Just-- (1)(Map TxOutRef TxSkelRedeemer
-insMap TxOutRef TxSkelRedeemer
+insMap 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
-bestTxOutTxSkelOut -> (TxSkelOut -> TxSkelOut) -> TxSkelOut
+bestTxOutTxSkelOut -> (TxSkelOut -> TxSkelOut) -> TxSkelOut
forall a b. a -> (a -> b) -> b
&Lens' TxSkelOut Value
txSkelOutValueLLens' 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)elseMap TxOutRef TxSkelRedeemer
-> [TxSkelOut]
-> [(TxOutRef, TxOut)]
-> Value
-> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut])
-tryAdditionalInputsMap TxOutRef TxSkelRedeemer
-ins[TxSkelOut]
-outs[(TxOutRef, TxOut)]
-availableUtxosValue
-returnValue
+tryAdditionalInputsMap TxOutRef TxSkelRedeemer
+ins[TxSkelOut]
+outs[(TxOutRef, TxOut)]
+availableUtxosValue
+returnValueBalanceOutputPolicy
DontAdjustExistingOutput->Map TxOutRef TxSkelRedeemer
-> [TxSkelOut] -> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut])
-tryAdditionalOutputMap TxOutRef TxSkelRedeemer
-ins[TxSkelOut]
-outs
+tryAdditionalOutputMap TxOutRef TxSkelRedeemer
+ins[TxSkelOut]
+outsMaybe Int
Nothing->-- There's no "best possible transaction output" in the sense described-- above.Map TxOutRef TxSkelRedeemer
-> [TxSkelOut] -> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut])
-tryAdditionalOutputMap TxOutRef TxSkelRedeemer
-ins[TxSkelOut]
-outs
+tryAdditionalOutputMap TxOutRef TxSkelRedeemer
+ins[TxSkelOut]
+outsTxSkel -> Maybe TxSkel
forall (m :: * -> *) a. Monad m => a -> m a
returnTxSkel
-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::MapPV2.TxOutRefTxSkelRedeemer->[TxSkelOut]->Maybe(MapPV2.TxOutRefTxSkelRedeemer,[TxSkelOut])
-tryAdditionalOutput :: Map TxOutRef TxSkelRedeemer
+tryAdditionalOutput :: Map TxOutRef TxSkelRedeemer
-> [TxSkelOut] -> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut])
-tryAdditionalOutputMap TxOutRef TxSkelRedeemer
-ins[TxSkelOut]
-outs=
+tryAdditionalOutputMap TxOutRef TxSkelRedeemer
+ins[TxSkelOut]
+outs=ifValue -> Ada
Pl.fromValueValue
-returnValueAda -> Ada -> Bool
+returnValueAda -> 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
-insMap TxOutRef TxSkelRedeemer
+insMap 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
paysPKPubKeyHash
-balancePKValue
-returnValue]
+balancePKValue
+returnValue])elseMap TxOutRef TxSkelRedeemer
-> [TxSkelOut]
-> [(TxOutRef, TxOut)]
-> Value
-> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut])
-tryAdditionalInputsMap TxOutRef TxSkelRedeemer
-ins[TxSkelOut]
-outs[(TxOutRef, TxOut)]
-availableUtxosValue
-returnValue
+tryAdditionalInputsMap TxOutRef TxSkelRedeemer
+ins[TxSkelOut]
+outs[(TxOutRef, TxOut)]
+availableUtxosValue
+returnValue
-tryAdditionalInputs::
+tryAdditionalInputs::MapPV2.TxOutRefTxSkelRedeemer->[TxSkelOut]->[(PV2.TxOutRef,PV2.TxOut)]->Pl.Value->Maybe(MapPV2.TxOutRefTxSkelRedeemer,[TxSkelOut])
-tryAdditionalInputs :: Map TxOutRef TxSkelRedeemer
+tryAdditionalInputs :: Map TxOutRef TxSkelRedeemer
-> [TxSkelOut]
-> [(TxOutRef, TxOut)]
-> Value
-> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut])
-tryAdditionalInputsMap TxOutRef TxSkelRedeemer
-ins[TxSkelOut]
-outs[(TxOutRef, TxOut)]
-availableValue
-return=
+tryAdditionalInputsMap TxOutRef TxSkelRedeemer
+ins[TxSkelOut]
+outs[(TxOutRef, TxOut)]
+availableValue
+return=case[(TxOutRef, TxOut)]
-availableof
+availableof[]->Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut])
forall a. Maybe a
Nothing
-(TxOutRef
-newTxOutRef,TxOut
-newTxOut):[(TxOutRef, TxOut)]
-newAvailable->
-letadditionalValue :: Value
-additionalValue=TxOut -> Value
+(TxOutRef
+newTxOutRef,TxOut
+newTxOut):[(TxOutRef, TxOut)]
+newAvailable->
+letadditionalValue :: Value
+additionalValue=TxOut -> Value
forall o. (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value
outputValueTxOut
-newTxOut
-newReturn :: Value
-newReturn=Value
-additionalValueValue -> Value -> Value
+newTxOut
+newReturn :: Value
+newReturn=Value
+additionalValueValue -> 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
+insMap 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.singletonTxOutRef
-newTxOutRefTxSkelRedeemer
+newTxOutRefTxSkelRedeemer
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
paysPKPubKeyHash
-balancePKValue
-newReturn]
+balancePKValue
+newReturn]inifValue
-newReturnValue -> Value -> Bool
+newReturnValue -> Value -> Bool
`Pl.geq`Ada -> Value
Pl.toValueAda
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)elseMap TxOutRef TxSkelRedeemer
-> [TxSkelOut]
-> [(TxOutRef, TxOut)]
-> Value
-> Maybe (Map TxOutRef TxSkelRedeemer, [TxSkelOut])
-tryAdditionalInputsMap TxOutRef TxSkelRedeemer
-newIns[TxSkelOut]
-newOuts[(TxOutRef, TxOut)]
-newAvailableValue
-newReturn
+tryAdditionalInputsMap TxOutRef TxSkelRedeemer
+newIns[TxSkelOut]
+newOuts[(TxOutRef, TxOut)]
+newAvailableValue
+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::(Showerr,Eqerr)=>err->MockChainError
+OtherMockChainError::(Showerr,Eqerr)=>err->MockChainErrordataMCEUnbalanceableError=-- | 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 spendPV2.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)
-derivinginstanceShowMockChainError
+derivinginstanceShowMockChainError
-instanceEqMockChainErrorwhere
-== :: MockChainError -> MockChainError -> Bool
+instanceEqMockChainErrorwhere
+== :: MockChainError -> MockChainError -> Bool
(==)=MockChainError -> MockChainError -> Bool
forall a. HasCallStack => a
undefined-- | Contains methods needed for balancing.
-class(MonadFailm,MonadErrorMockChainErrorm)=>MonadBlockChainBalancingmwhere
+class(MonadFailm,MonadErrorMockChainErrorm)=>MonadBlockChainBalancingmwhere-- | Returns the parameters of the chain.
-getParams::mEmulator.Params
+getParams::mEmulator.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(MaybePV2.Datum)
+datumFromHash::PV2.DatumHash->m(MaybePV2.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.VersionedPV2.Validator))
+validatorFromHash::PV2.ValidatorHash->m(Maybe(Pl.VersionedPV2.Validator))-- | Returns an output given a reference to it
-txOutByRefLedger::PV2.TxOutRef->m(MaybeLedger.TxOut)
+txOutByRefLedger::PV2.TxOutRef->m(MaybeLedger.TxOut)
-classMonadBlockChainBalancingm=>MonadBlockChainWithoutValidationmwhere
+classMonadBlockChainBalancingm=>MonadBlockChainWithoutValidationmwhere-- | 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::mLedger.Slot
+currentSlot::mLedger.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->mLedger.Slot
+awaitSlot::Ledger.Slot->mLedger.Slot-- | The main abstraction of the blockchain.
-classMonadBlockChainWithoutValidationm=>MonadBlockChainmwhere
+classMonadBlockChainWithoutValidationm=>MonadBlockChainmwhere-- | 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->mLedger.CardanoTx
+validateTxSkel::TxSkel->mLedger.CardanoTx
-allUtxos::MonadBlockChainWithoutValidationm=>m[(PV2.TxOutRef,PV2.TxOut)]
+allUtxos::MonadBlockChainWithoutValidationm=>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::MonadBlockChainBalancingm=>PV2.Address->m[(PV2.TxOutRef,PV2.TxOut)]
+utxosAt::MonadBlockChainBalancingm=>PV2.Address->m[(PV2.TxOutRef,PV2.TxOut)]utxosAt :: Address -> m [(TxOutRef, TxOut)]
-utxosAtAddress
-address=((TxOutRef, TxOut) -> (TxOutRef, TxOut))
+utxosAtAddress
+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)]
utxosAtLedgerAddress
-address
+address
-txOutByRef::MonadBlockChainBalancingm=>PV2.TxOutRef->m(MaybePV2.TxOut)
+txOutByRef::MonadBlockChainBalancingm=>PV2.TxOutRef->m(MaybePV2.TxOut)txOutByRef :: TxOutRef -> m (Maybe TxOut)
-txOutByRefTxOutRef
-oref=(TxOut -> TxOut) -> Maybe TxOut -> Maybe TxOut
+txOutByRefTxOutRef
+oref=(TxOut -> TxOut) -> Maybe TxOut -> Maybe TxOut
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmapTxOut -> TxOut
txOutV2FromLedger(Maybe TxOut -> Maybe TxOut) -> m (Maybe TxOut) -> m (Maybe TxOut)
@@ -219,7 +219,7 @@
MonadBlockChainBalancing m =>
TxOutRef -> m (Maybe TxOut)
txOutByRefLedgerTxOutRef
-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.fromCardanoTxInTxIn
-txOutRef,TxOut -> TxOut
+txOutRef,TxOut -> TxOut
txOutV2FromLedgerTxOut
-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::
-(IsAbstractOutputout,
-ToOutputDatum(DatumTypeout),
-MonadBlockChainBalancingm
+resolveDatum::
+(IsAbstractOutputout,
+ToOutputDatum(DatumTypeout),
+MonadBlockChainBalancingm)=>
-out->
-m(Maybe(ConcreteOutput(OwnerTypeout)PV2.Datum(ValueTypeout)(ReferenceScriptTypeout)))
+out->
+m(Maybe(ConcreteOutput(OwnerTypeout)PV2.Datum(ValueTypeout)(ReferenceScriptTypeout)))resolveDatum :: out
-> m (Maybe
(ConcreteOutput
(OwnerType out) Datum (ValueType out) (ReferenceScriptType out)))
-resolveDatumout
-out=
+resolveDatumout
+out=caseout -> OutputDatum
forall o.
(IsAbstractOutput o, ToOutputDatum (DatumType o)) =>
o -> OutputDatum
outputOutputDatumout
-outof
-PV2.OutputDatumHashDatumHash
-datumHash->do
-Maybe Datum
-mDatum<-DatumHash -> m (Maybe Datum)
+outof
+PV2.OutputDatumHashDatumHash
+datumHash->do
+Maybe Datum
+mDatum<-DatumHash -> m (Maybe Datum)
forall (m :: * -> *).
MonadBlockChainBalancing m =>
DatumHash -> m (Maybe Datum)
datumFromHashDatumHash
-datumHash
+datumHashcaseMaybe Datum
-mDatumof
+mDatumofMaybe Datum
Nothing->Maybe
(ConcreteOutput
@@ -303,8 +303,8 @@
(OwnerType out) Datum (ValueType out) (ReferenceScriptType out))
forall a. Maybe a
Nothing
-JustDatum
-datum->
+JustDatum
+datum->Maybe
(ConcreteOutput
(OwnerType out) Datum (ValueType out) (ReferenceScriptType out))
@@ -363,7 +363,7 @@
-> ConcreteOutput ownerType datumType valueType referenceScriptType
ConcreteOutput(out
-outout -> Optic' A_Lens NoIx out (OwnerType out) -> OwnerType out
+outout -> 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
-outout
+outout
-> 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
-outout -> Optic' A_Lens NoIx out (ValueType out) -> ValueType out
+outout -> 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
-outout
+outout
-> 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.OutputDatumDatum
-datum->
+PV2.OutputDatumDatum
+datum->Maybe
(ConcreteOutput
(OwnerType out) Datum (ValueType out) (ReferenceScriptType out))
@@ -462,7 +462,7 @@
-> ConcreteOutput ownerType datumType valueType referenceScriptType
ConcreteOutput(out
-outout -> Optic' A_Lens NoIx out (OwnerType out) -> OwnerType out
+outout -> 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
-outout
+outout
-> 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
-outout -> Optic' A_Lens NoIx out (ValueType out) -> ValueType out
+outout -> 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
-outout
+outout
-> 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::
-(IsAbstractOutputout,
-ToOutputDatum(DatumTypeout),
-MonadBlockChainBalancingm,
-PV2.FromDataa
+resolveTypedDatum::
+(IsAbstractOutputout,
+ToOutputDatum(DatumTypeout),
+MonadBlockChainBalancingm,
+PV2.FromDataa)=>
-out->
-m(Maybe(ConcreteOutput(OwnerTypeout)a(ValueTypeout)(ReferenceScriptTypeout)))
+out->
+m(Maybe(ConcreteOutput(OwnerTypeout)a(ValueTypeout)(ReferenceScriptTypeout)))resolveTypedDatum :: out
-> m (Maybe
(ConcreteOutput
(OwnerType out) a (ValueType out) (ReferenceScriptType out)))
-resolveTypedDatumout
-out=do
-Maybe
+resolveTypedDatumout
+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)))
resolveDatumout
-out
+outcaseMaybe
(ConcreteOutput
(OwnerType out) Datum (ValueType out) (ReferenceScriptType out))
-mOutof
+mOutofMaybe
(ConcreteOutput
(OwnerType out) Datum (ValueType out) (ReferenceScriptType out))
@@ -566,9 +566,9 @@
(OwnerType out) a (ValueType out) (ReferenceScriptType out))
forall a. Maybe a
Nothing
-JustConcreteOutput
+JustConcreteOutput
(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
-<*>(letPV2.DatumBuiltinData
-datum=ConcreteOutput
+<*>(letPV2.DatumBuiltinData
+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 @@
outputDatumLinBuiltinData -> Maybe a
forall a. FromData a => BuiltinData -> Maybe a
PV2.fromBuiltinDataBuiltinData
-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::
-(IsAbstractOutputout,
-ToCredential(OwnerTypeout),
-MonadBlockChainBalancingm
+resolveValidator::
+(IsAbstractOutputout,
+ToCredential(OwnerTypeout),
+MonadBlockChainBalancingm)=>
-out->
-m(Maybe(ConcreteOutput(Pl.VersionedPV2.Validator)(DatumTypeout)(ValueTypeout)(ReferenceScriptTypeout)))
+out->
+m(Maybe(ConcreteOutput(Pl.VersionedPV2.Validator)(DatumTypeout)(ValueTypeout)(ReferenceScriptTypeout)))resolveValidator :: out
-> m (Maybe
(ConcreteOutput
@@ -812,12 +812,12 @@
(DatumType out)
(ValueType out)
(ReferenceScriptType out)))
-resolveValidatorout
-out=
+resolveValidatorout
+out=caseOwnerType out -> Credential
forall a. ToCredential a => a -> Credential
toCredential(out
-outout -> Optic' A_Lens NoIx out (OwnerType out) -> OwnerType out
+outout -> 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.ScriptCredentialValidatorHash
-valHash->do
-Maybe (Versioned Validator)
-mVal<-ValidatorHash -> m (Maybe (Versioned Validator))
+PV2.ScriptCredentialValidatorHash
+valHash->do
+Maybe (Versioned Validator)
+mVal<-ValidatorHash -> m (Maybe (Versioned Validator))
forall (m :: * -> *).
MonadBlockChainBalancing m =>
ValidatorHash -> m (Maybe (Versioned Validator))
validatorFromHashValidatorHash
-valHash
+valHashcaseMaybe (Versioned Validator)
-mValof
+mValofMaybe (Versioned Validator)
Nothing->Maybe
(ConcreteOutput
@@ -879,8 +879,8 @@
(ReferenceScriptType out))
forall a. Maybe a
Nothing
-JustVersioned Validator
-val->
+JustVersioned Validator
+val->Maybe
(ConcreteOutput
(Versioned Validator)
@@ -984,9 +984,9 @@
-> ConcreteOutput ownerType datumType valueType referenceScriptType
ConcreteOutputVersioned Validator
-val
+val(out
-outout
+outout
-> 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
-outout -> Optic' A_Lens NoIx out (ValueType out) -> ValueType out
+outout -> 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
-outout -> Optic' A_Lens NoIx out (DatumType out) -> DatumType out
+outout -> 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
-outout
+outout
-> 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::
-(IsAbstractOutputout,
-ToScriptHash(ReferenceScriptTypeout),
-MonadBlockChainBalancingm
+resolveReferenceScript::
+(IsAbstractOutputout,
+ToScriptHash(ReferenceScriptTypeout),
+MonadBlockChainBalancingm)=>
-out->
-m(Maybe(ConcreteOutput(OwnerTypeout)(DatumTypeout)(ValueTypeout)(Pl.VersionedPV2.Validator)))
+out->
+m(Maybe(ConcreteOutput(OwnerTypeout)(DatumTypeout)(ValueTypeout)(Pl.VersionedPV2.Validator)))resolveReferenceScript :: out
-> m (Maybe
(ConcreteOutput
@@ -1041,14 +1041,14 @@
(DatumType out)
(ValueType out)
(Versioned Validator)))
-resolveReferenceScriptout
-out=
+resolveReferenceScriptout
+out=caseout -> Maybe ScriptHash
forall o.
(IsAbstractOutput o, ToScriptHash (ReferenceScriptType o)) =>
o -> Maybe ScriptHash
outputReferenceScriptHashout
-outof
+outofMaybe ScriptHash
Nothing->Maybe
(ConcreteOutput
@@ -1071,18 +1071,18 @@
(Versioned Validator))
forall a. Maybe a
Nothing
-Just(PV2.ScriptHashBuiltinByteString
-hash)->do
-Maybe (Versioned Validator)
-mVal<-ValidatorHash -> m (Maybe (Versioned Validator))
+Just(PV2.ScriptHashBuiltinByteString
+hash)->do
+Maybe (Versioned Validator)
+mVal<-ValidatorHash -> m (Maybe (Versioned Validator))
forall (m :: * -> *).
MonadBlockChainBalancing m =>
ValidatorHash -> m (Maybe (Versioned Validator))
validatorFromHash(BuiltinByteString -> ValidatorHash
PV2.ValidatorHashBuiltinByteString
-hash)
+hash)caseMaybe (Versioned Validator)
-mValof
+mValofMaybe (Versioned Validator)
Nothing->Maybe
(ConcreteOutput
@@ -1105,8 +1105,8 @@
(Versioned Validator))
forall a. Maybe a
Nothing
-JustVersioned Validator
-val->
+JustVersioned Validator
+val->Maybe
(ConcreteOutput
(OwnerType out)
@@ -1210,7 +1210,7 @@
-> ConcreteOutput ownerType datumType valueType referenceScriptType
ConcreteOutput(out
-outout -> Optic' A_Lens NoIx out (OwnerType out) -> OwnerType out
+outout -> 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
-outout
+outout
-> 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
-outout -> Optic' A_Lens NoIx out (ValueType out) -> ValueType out
+outout -> 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
-outout -> Optic' A_Lens NoIx out (DatumType out) -> DatumType out
+outout -> 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
JustVersioned Validator
-val)
+val)
-outputDatumFromTxOutRef::MonadBlockChainWithoutValidationm=>PV2.TxOutRef->m(MaybePV2.OutputDatum)
+outputDatumFromTxOutRef::MonadBlockChainWithoutValidationm=>PV2.TxOutRef->m(MaybePV2.OutputDatum)outputDatumFromTxOutRef :: TxOutRef -> m (Maybe OutputDatum)
-outputDatumFromTxOutRefTxOutRef
-oref=do
-Maybe TxOut
-mOut<-TxOutRef -> m (Maybe TxOut)
+outputDatumFromTxOutRefTxOutRef
+oref=do
+Maybe TxOut
+mOut<-TxOutRef -> m (Maybe TxOut)
forall (m :: * -> *).
MonadBlockChainBalancing m =>
TxOutRef -> m (Maybe TxOut)
txOutByRefTxOutRef
-oref
+orefcaseMaybe TxOut
-mOutof
+mOutofMaybe TxOut
Nothing->Maybe OutputDatum -> m (Maybe OutputDatum)
forall (m :: * -> *) a. Monad m => a -> m a
returnMaybe OutputDatum
forall a. Maybe a
Nothing
-JustTxOut
-out->Maybe OutputDatum -> m (Maybe OutputDatum)
+JustTxOut
+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
outputOutputDatumTxOut
-out
+out
-datumFromTxOutRef::MonadBlockChainWithoutValidationm=>PV2.TxOutRef->m(MaybePV2.Datum)
+datumFromTxOutRef::MonadBlockChainWithoutValidationm=>PV2.TxOutRef->m(MaybePV2.Datum)datumFromTxOutRef :: TxOutRef -> m (Maybe Datum)
-datumFromTxOutRefTxOutRef
-oref=do
-Maybe OutputDatum
-mOutputDatum<-TxOutRef -> m (Maybe OutputDatum)
+datumFromTxOutRefTxOutRef
+oref=do
+Maybe OutputDatum
+mOutputDatum<-TxOutRef -> m (Maybe OutputDatum)
forall (m :: * -> *).
MonadBlockChainWithoutValidation m =>
TxOutRef -> m (Maybe OutputDatum)
outputDatumFromTxOutRefTxOutRef
-oref
+orefcaseMaybe OutputDatum
-mOutputDatumof
+mOutputDatumofMaybe OutputDatum
Nothing->Maybe Datum -> m (Maybe Datum)
forall (m :: * -> *) a. Monad m => a -> m a
@@ -1312,35 +1312,35 @@
returnMaybe Datum
forall a. Maybe a
Nothing
-Just(PV2.OutputDatumDatum
-datum)->Maybe Datum -> m (Maybe Datum)
+Just(PV2.OutputDatumDatum
+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
JustDatum
-datum
-Just(PV2.OutputDatumHashDatumHash
-datumHash)->do
-Maybe Datum
-mDatum<-DatumHash -> m (Maybe Datum)
+datum
+Just(PV2.OutputDatumHashDatumHash
+datumHash)->do
+Maybe Datum
+mDatum<-DatumHash -> m (Maybe Datum)
forall (m :: * -> *).
MonadBlockChainBalancing m =>
DatumHash -> m (Maybe Datum)
datumFromHashDatumHash
-datumHash
+datumHashcaseMaybe Datum
-mDatumof
-JustDatum
-datum->Maybe Datum -> m (Maybe Datum)
+mDatumof
+JustDatum
+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
JustDatum
-datum
+datumMaybe 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.FromDataa,MonadBlockChainWithoutValidationm)=>PV2.TxOutRef->m(Maybea)
+typedDatumFromTxOutRef::(PV2.FromDataa,MonadBlockChainWithoutValidationm)=>PV2.TxOutRef->m(Maybea)typedDatumFromTxOutRef :: TxOutRef -> m (Maybe a)
-typedDatumFromTxOutRefTxOutRef
-oref=do
-Maybe Datum
-mDatum<-TxOutRef -> m (Maybe Datum)
+typedDatumFromTxOutRefTxOutRef
+oref=do
+Maybe Datum
+mDatum<-TxOutRef -> m (Maybe Datum)
forall (m :: * -> *).
MonadBlockChainWithoutValidation m =>
TxOutRef -> m (Maybe Datum)
datumFromTxOutRefTxOutRef
-oref
+orefcaseMaybe Datum
-mDatumof
+mDatumofMaybe Datum
Nothing->Maybe a -> m (Maybe a)
forall (m :: * -> *) a. Monad m => a -> m a
returnMaybe a
forall a. Maybe a
Nothing
-Just(PV2.DatumBuiltinData
-datum)->Maybe a -> m (Maybe a)
+Just(PV2.DatumBuiltinData
+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.fromBuiltinDataBuiltinData
-datum
+datum
-valueFromTxOutRef::MonadBlockChainWithoutValidationm=>PV2.TxOutRef->m(MaybePV2.Value)
+valueFromTxOutRef::MonadBlockChainWithoutValidationm=>PV2.TxOutRef->m(MaybePV2.Value)valueFromTxOutRef :: TxOutRef -> m (Maybe Value)
-valueFromTxOutRefTxOutRef
-oref=do
-Maybe TxOut
-mOut<-TxOutRef -> m (Maybe TxOut)
+valueFromTxOutRefTxOutRef
+oref=do
+Maybe TxOut
+mOut<-TxOutRef -> m (Maybe TxOut)
forall (m :: * -> *).
MonadBlockChainBalancing m =>
TxOutRef -> m (Maybe TxOut)
txOutByRefTxOutRef
-oref
+orefcaseMaybe TxOut
-mOutof
+mOutofMaybe TxOut
Nothing->Maybe Value -> m (Maybe Value)
forall (m :: * -> *) a. Monad m => a -> m a
returnMaybe Value
forall a. Maybe a
Nothing
-JustTxOut
-out->Maybe Value -> m (Maybe Value)
+JustTxOut
+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
outputValueTxOut
-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::(MonadBlockChainWithoutValidationm)=>Integer->mLedger.Slot
+waitNSlots::(MonadBlockChainWithoutValidationm)=>Integer->mLedger.SlotwaitNSlots :: Integer -> m Slot
-waitNSlotsInteger
-n=
+waitNSlotsInteger
+n=ifInteger
-nInteger -> Integer -> Bool
+nInteger -> 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
fromIntegralInteger
-n)
+n)-- | Returns the closed ms interval corresponding to the current slot
-currentTime::(MonadBlockChainWithoutValidationm)=>m(PV2.POSIXTime,PV2.POSIXTime)
+currentTime::(MonadBlockChainWithoutValidationm)=>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::(MonadBlockChainWithoutValidationm)=>Ledger.Slot->m(PV2.POSIXTime,PV2.POSIXTime)
+slotToTimeInterval::(MonadBlockChainWithoutValidationm)=>Ledger.Slot->m(PV2.POSIXTime,PV2.POSIXTime)slotToTimeInterval :: Slot -> m (POSIXTime, POSIXTime)
-slotToTimeIntervalSlot
-slot=do
-SlotConfig
-slotConfig<-Params -> SlotConfig
+slotToTimeIntervalSlot
+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 @@
getParamscaseSlotConfig -> Slot -> POSIXTimeRange
Emulator.slotToPOSIXTimeRangeSlotConfig
-slotConfigSlot
-slotof
+slotConfigSlot
+slotofPV2.Interval
-(PV2.LowerBound(PV2.FinitePOSIXTime
-l)Bool
-leftclosed)
-(PV2.UpperBound(PV2.FinitePOSIXTime
-r)Bool
-rightclosed)->
+(PV2.LowerBound(PV2.FinitePOSIXTime
+l)Bool
+leftclosed)
+(PV2.UpperBound(PV2.FinitePOSIXTime
+r)Bool
+rightclosed)->(POSIXTime, POSIXTime) -> m (POSIXTime, POSIXTime)
forall (m :: * -> *) a. Monad m => a -> m a
return(ifBool
-leftclosedthenPOSIXTime
-lelsePOSIXTime
-lPOSIXTime -> POSIXTime -> POSIXTime
+leftclosedthenPOSIXTime
+lelsePOSIXTime
+lPOSIXTime -> POSIXTime -> POSIXTime
forall a. Num a => a -> a -> a
+POSIXTime
1,ifBool
-rightclosedthenPOSIXTime
-relsePOSIXTime
-rPOSIXTime -> POSIXTime -> POSIXTime
+rightclosedthenPOSIXTime
+relsePOSIXTime
+rPOSIXTime -> 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::(MonadBlockChainWithoutValidationm)=>PV2.POSIXTime->mLedger.Slot
+getEnclosingSlot::(MonadBlockChainWithoutValidationm)=>PV2.POSIXTime->mLedger.SlotgetEnclosingSlot :: POSIXTime -> m Slot
-getEnclosingSlotPOSIXTime
-t=do
-SlotConfig
-slotConfig<-Params -> SlotConfig
+getEnclosingSlotPOSIXTime
+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.posixTimeToEnclosingSlotSlotConfig
-slotConfigPOSIXTime
-t
+slotConfigPOSIXTime
+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::(MonadBlockChainWithoutValidationm)=>PV2.POSIXTime->mLedger.Slot
+awaitEnclosingSlot::(MonadBlockChainWithoutValidationm)=>PV2.POSIXTime->mLedger.SlotawaitEnclosingSlot :: 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::MonadBlockChainWithoutValidationm=>PV2.POSIXTime->mLedger.SlotRange
+slotRangeBefore::MonadBlockChainWithoutValidationm=>PV2.POSIXTime->mLedger.SlotRangeslotRangeBefore :: POSIXTime -> m SlotRange
-slotRangeBeforePOSIXTime
-t=do
-Slot
-n<-POSIXTime -> m Slot
+slotRangeBeforePOSIXTime
+t=do
+Slot
+n<-POSIXTime -> m Slot
forall (m :: * -> *).
MonadBlockChainWithoutValidation m =>
POSIXTime -> m Slot
getEnclosingSlotPOSIXTime
-t
+t(POSIXTime
-_,POSIXTime
-b)<-Slot -> m (POSIXTime, POSIXTime)
+_,POSIXTime
+b)<-Slot -> m (POSIXTime, POSIXTime)
forall (m :: * -> *).
MonadBlockChainWithoutValidation m =>
Slot -> m (POSIXTime, POSIXTime)
slotToTimeIntervalSlot
-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.ifPOSIXTime
-tPOSIXTime -> POSIXTime -> Bool
+tPOSIXTime -> POSIXTime -> Bool
forall a. Eq a => a -> a -> Bool
==POSIXTime
-b
+bthenSlotRange -> 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.toSlot
-n
+nelseSlotRange -> 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
-nSlot -> Slot -> Slot
+nSlot -> 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::MonadBlockChainWithoutValidationm=>PV2.POSIXTime->mLedger.SlotRange
+slotRangeAfter::MonadBlockChainWithoutValidationm=>PV2.POSIXTime->mLedger.SlotRangeslotRangeAfter :: POSIXTime -> m SlotRange
-slotRangeAfterPOSIXTime
-t=do
-Slot
-n<-POSIXTime -> m Slot
+slotRangeAfterPOSIXTime
+t=do
+Slot
+n<-POSIXTime -> m Slot
forall (m :: * -> *).
MonadBlockChainWithoutValidation m =>
POSIXTime -> m Slot
getEnclosingSlotPOSIXTime
-t
-(POSIXTime
-a,POSIXTime
+t
+(POSIXTime
+a,POSIXTime
_)<-Slot -> m (POSIXTime, POSIXTime)
forall (m :: * -> *).
MonadBlockChainWithoutValidation m =>
Slot -> m (POSIXTime, POSIXTime)
slotToTimeIntervalSlot
-n
+nifPOSIXTime
-tPOSIXTime -> POSIXTime -> Bool
+tPOSIXTime -> POSIXTime -> Bool
forall a. Eq a => a -> a -> Bool
==POSIXTime
-a
+athenSlotRange -> 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.fromSlot
-n
+nelseSlotRange -> 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
-nSlot -> Slot -> Slot
+nSlot -> 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.
-newtypeAsTranst(m::Type->Type)a=AsTrans{AsTrans t m a -> t m a
-getTrans::tma}
-derivingnewtype(a -> AsTrans t m b -> AsTrans t m a
+newtypeAsTranst(m::Type->Type)a=AsTrans{AsTrans t m a -> t m a
+getTrans::tma}
+derivingnewtype(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(MonadTranst,MonadFailm,Monad(tm))=>MonadFail(AsTranstm)where
-fail :: String -> AsTrans t m a
+instance(MonadTranst,MonadFailm,Monad(tm))=>MonadFail(AsTranstm)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(MonadTransControlt,MonadErrorMockChainErrorm,Monad(tm))=>MonadErrorMockChainError(AsTranstm)where
-throwError :: MockChainError -> AsTrans t m a
+instance(MonadTransControlt,MonadErrorMockChainErrorm,Monad(tm))=>MonadErrorMockChainError(AsTranstm)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
-catchErrorAsTrans t m a
-actMockChainError -> 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
+catchErrorAsTrans t m a
+actMockChainError -> 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)
-runAsTrans t m a
-act)(AsTrans t m a -> m (StT t a)
+runAsTrans 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(MonadTranst,MonadBlockChainBalancingm,Monad(tm),MonadErrorMockChainError(AsTranstm))=>MonadBlockChainBalancing(AsTranstm)where
-getParams :: AsTrans t m Params
-getParams=m Params -> AsTrans t m Params
+instance(MonadTranst,MonadBlockChainBalancingm,Monad(tm),MonadErrorMockChainError(AsTranstm))=>MonadBlockChainBalancing(AsTranstm)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
liftm 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(MonadTranst,MonadBlockChainWithoutValidationm,Monad(tm),MonadErrorMockChainError(AsTranstm))=>MonadBlockChainWithoutValidation(AsTranstm)where
-allUtxosLedger :: AsTrans t m [(TxOutRef, TxOut)]
-allUtxosLedger=m [(TxOutRef, TxOut)] -> AsTrans t m [(TxOutRef, TxOut)]
+instance(MonadTranst,MonadBlockChainWithoutValidationm,Monad(tm),MonadErrorMockChainError(AsTranstm))=>MonadBlockChainWithoutValidation(AsTranstm)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
liftm 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(MonadTranst,MonadBlockChainm,MonadBlockChainWithoutValidation(AsTranstm))=>MonadBlockChain(AsTranstm)where
-validateTxSkel :: TxSkel -> AsTrans t m CardanoTx
-validateTxSkel=m CardanoTx -> AsTrans t m CardanoTx
+instance(MonadTranst,MonadBlockChainm,MonadBlockChainWithoutValidation(AsTranstm))=>MonadBlockChain(AsTranstm)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
-derivingvia(AsTrans(WriterTw)m)instance(Monoidw,MonadBlockChainBalancingm)=>MonadBlockChainBalancing(WriterTwm)
+derivingvia(AsTrans(WriterTw)m)instance(Monoidw,MonadBlockChainBalancingm)=>MonadBlockChainBalancing(WriterTwm)
-derivingvia(AsTrans(WriterTw)m)instance(Monoidw,MonadBlockChainWithoutValidationm)=>MonadBlockChainWithoutValidation(WriterTwm)
+derivingvia(AsTrans(WriterTw)m)instance(Monoidw,MonadBlockChainWithoutValidationm)=>MonadBlockChainWithoutValidation(WriterTwm)
-derivingvia(AsTrans(WriterTw)m)instance(Monoidw,MonadBlockChainm)=>MonadBlockChain(WriterTwm)
+derivingvia(AsTrans(WriterTw)m)instance(Monoidw,MonadBlockChainm)=>MonadBlockChain(WriterTwm)
-derivingvia(AsTrans(ReaderTr)m)instanceMonadBlockChainBalancingm=>MonadBlockChainBalancing(ReaderTrm)
+derivingvia(AsTrans(ReaderTr)m)instanceMonadBlockChainBalancingm=>MonadBlockChainBalancing(ReaderTrm)
-derivingvia(AsTrans(ReaderTr)m)instanceMonadBlockChainWithoutValidationm=>MonadBlockChainWithoutValidation(ReaderTrm)
+derivingvia(AsTrans(ReaderTr)m)instanceMonadBlockChainWithoutValidationm=>MonadBlockChainWithoutValidation(ReaderTrm)
-derivingvia(AsTrans(ReaderTr)m)instanceMonadBlockChainm=>MonadBlockChain(ReaderTrm)
+derivingvia(AsTrans(ReaderTr)m)instanceMonadBlockChainm=>MonadBlockChain(ReaderTrm)
-derivingvia(AsTrans(StateTs)m)instanceMonadBlockChainBalancingm=>MonadBlockChainBalancing(StateTsm)
+derivingvia(AsTrans(StateTs)m)instanceMonadBlockChainBalancingm=>MonadBlockChainBalancing(StateTsm)
-derivingvia(AsTrans(StateTs)m)instanceMonadBlockChainWithoutValidationm=>MonadBlockChainWithoutValidation(StateTsm)
+derivingvia(AsTrans(StateTs)m)instanceMonadBlockChainWithoutValidationm=>MonadBlockChainWithoutValidation(StateTsm)
-derivingvia(AsTrans(StateTs)m)instanceMonadBlockChainm=>MonadBlockChain(StateTsm)
+derivingvia(AsTrans(StateTs)m)instanceMonadBlockChainm=>MonadBlockChain(StateTsm)-- '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...
-instanceMonadBlockChainBalancingm=>MonadBlockChainBalancing(ListTm)where
-getParams :: ListT m Params
-getParams=m Params -> ListT m Params
+instanceMonadBlockChainBalancingm=>MonadBlockChainBalancing(ListTm)where
+getParams :: ListT m Params
+getParams=m Params -> ListT m Params
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
liftm 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
-instanceMonadBlockChainWithoutValidationm=>MonadBlockChainWithoutValidation(ListTm)where
-allUtxosLedger :: ListT m [(TxOutRef, TxOut)]
-allUtxosLedger=m [(TxOutRef, TxOut)] -> ListT m [(TxOutRef, TxOut)]
+instanceMonadBlockChainWithoutValidationm=>MonadBlockChainWithoutValidation(ListTm)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
liftm 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
-instanceMonadBlockChainm=>MonadBlockChain(ListTm)where
-validateTxSkel :: TxSkel -> ListT m CardanoTx
-validateTxSkel=m CardanoTx -> ListT m CardanoTx
+instanceMonadBlockChainm=>MonadBlockChain(ListTm)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->UtxoStatemcstToUtxoState :: MockChainSt -> UtxoState
-mcstToUtxoStateMockChainSt{UtxoIndex
+mcstToUtxoStateMockChainSt{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.insertWithUtxoPayloadSet -> UtxoPayloadSet -> UtxoPayloadSet
forall a. Semigroup a => a -> a -> a
(<>)Address
-addressUtxoPayloadSet
-utxoValueSetMap Address UtxoPayloadSet
-acc)Map Address UtxoPayloadSet
+addressUtxoPayloadSet
+utxoValueSetMap 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.fromCardanoTxInTxIn
-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
+mcstIndexwhere
-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
-letmRefScript :: Maybe ScriptHash
-mRefScript=TxOut -> Maybe ScriptHash
+letmRefScript :: Maybe ScriptHash
+mRefScript=TxOut -> Maybe ScriptHash
forall o.
(IsAbstractOutput o, ToScriptHash (ReferenceScriptType o)) =>
o -> Maybe ScriptHash
outputReferenceScriptHashTxOut
-out
-TxSkelOutDatum
-txSkelOutDatum<-
+out
+TxSkelOutDatum
+txSkelOutDatum<-caseOutputDatum
-txOutDatumof
+txOutDatumofOutputDatum
Pl.NoOutputDatum->TxSkelOutDatum -> Maybe TxSkelOutDatum
forall a. a -> Maybe a
JustTxSkelOutDatum
TxSkelOutNoDatum
-Pl.OutputDatumDatum
-datum->(TxSkelOutDatum, Integer) -> TxSkelOutDatum
+Pl.OutputDatumDatum
+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.datumHashDatum
-datum)Map DatumHash (TxSkelOutDatum, Integer)
-mcstDatums
-Pl.OutputDatumHashDatumHash
-hash->(TxSkelOutDatum, Integer) -> TxSkelOutDatum
+datum)Map DatumHash (TxSkelOutDatum, Integer)
+mcstDatums
+Pl.OutputDatumHashDatumHash
+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.lookupDatumHash
-hashMap DatumHash (TxSkelOutDatum, Integer)
-mcstDatums
+hashMap 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
UtxoPayloadTxOutRef
-txOutRefValue
-txOutValueTxSkelOutDatum
-txSkelOutDatumMaybe ScriptHash
-mRefScript]
+txOutRefValue
+txOutValueTxSkelOutDatum
+txSkelOutDatumMaybe 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)
-instanceEqMockChainStwhere
-(MockChainStUtxoIndex
-index1Map DatumHash (TxSkelOutDatum, Integer)
-datums1Map ValidatorHash (Versioned Validator)
-validators1Slot
-currentSlot1)
-== :: MockChainSt -> MockChainSt -> Bool
-==(MockChainStUtxoIndex
-index2Map DatumHash (TxSkelOutDatum, Integer)
-datums2Map ValidatorHash (Versioned Validator)
-validators2Slot
-currentSlot2)=
+instanceEqMockChainStwhere
+(MockChainStUtxoIndex
+index1Map DatumHash (TxSkelOutDatum, Integer)
+datums1Map ValidatorHash (Versioned Validator)
+validators1Slot
+currentSlot1)
+== :: MockChainSt -> MockChainSt -> Bool
+==(MockChainStUtxoIndex
+index2Map DatumHash (TxSkelOutDatum, Integer)
+datums2Map ValidatorHash (Versioned Validator)
+validators2Slot
+currentSlot2)=[Bool] -> Bool
forall (t :: * -> *). Foldable t => t Bool -> Bool
and[UtxoIndex
-index1UtxoIndex -> UtxoIndex -> Bool
+index1UtxoIndex -> UtxoIndex -> Bool
forall a. Eq a => a -> a -> Bool
==UtxoIndex
-index2,
+index2,Map DatumHash (TxSkelOutDatum, Integer)
-datums1Map DatumHash (TxSkelOutDatum, Integer)
+datums1Map 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)
-validators1Map ValidatorHash (Versioned Validator)
+validators1Map ValidatorHash (Versioned Validator)
-> Map ValidatorHash (Versioned Validator) -> Bool
forall a. Eq a => a -> a -> Bool
==Map ValidatorHash (Versioned Validator)
-validators2,
+validators2,Slot
-currentSlot1Slot -> Slot -> Bool
+currentSlot1Slot -> Slot -> Bool
forall a. Eq a => a -> a -> Bool
==Slot
-currentSlot2
+currentSlot2]instanceDefaultLedger.Slotwhere
-def :: Slot
+def :: Slot
def=Integer -> Slot
Ledger.SlotInteger
0newtypeMockChainEnv=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)instanceDefaultMockChainEnvwhere
-def :: MockChainEnv
-def=Params -> MockChainEnv
+def :: MockChainEnv
+def=Params -> MockChainEnv
MockChainEnvParams
forall a. Default a => a
def
-newtypeMockChainTma=MockChainT
+newtypeMockChainTma=MockChainT{MockChainT m a
-> ReaderT
MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) a
-unMockChain::ReaderTMockChainEnv(StateTMockChainSt(ExceptTMockChainErrorm))a}
-derivingnewtype(a -> MockChainT m b -> MockChainT m a
+unMockChain::ReaderTMockChainEnv(StateTMockChainSt(ExceptTMockChainErrorm))a}
+derivingnewtype(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,MonadStateMockChainSt,MonadErrorMockChainError,MonadReaderMockChainEnv)
+Applicative,MonadStateMockChainSt,MonadErrorMockChainError,MonadReaderMockChainEnv)typeMockChain=MockChainTIdentity-- | Custom monad instance made to increase the slot count automatically
-instance(Monadm)=>Monad(MockChainTm)where
-return :: a -> MockChainT m a
+instance(Monadm)=>Monad(MockChainTm)where
+return :: a -> MockChainT m a
return=a -> MockChainT m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
-MockChainTReaderT
+MockChainTReaderT
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
-xReaderT
+xReaderT
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(Monadm)=>MonadFail(MockChainTm)where
-fail :: String -> MockChainT m a
+instance(Monadm)=>MonadFail(MockChainTm)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 @@
FailWithinstanceMonadTransMockChainTwhere
-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(Monadm,Alternativem)=>Alternative(MockChainTm)where
-empty :: MockChainT m a
+instance(Monadm,Alternativem)=>Alternative(MockChainTm)where
+empty :: MockChainT m a
empty=ReaderT
MockChainEnv (StateT MockChainSt (ExceptT MockChainError m)) a
-> MockChainT m a
@@ -593,7 +593,7 @@
ExceptTm (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::
-(Monadm)=>
-(foralla.ma->ma->ma)->
-MockChainTmx->
-MockChainTmx->
-MockChainTmx
+combineMockChainT::
+(Monadm)=>
+(foralla.ma->ma->ma)->
+MockChainTmx->
+MockChainTmx->
+MockChainTmxcombineMockChainT :: (forall a. m a -> m a -> m a)
-> MockChainT m x -> MockChainT m x -> MockChainT m x
-combineMockChainTforall a. m a -> m a -> m a
-fMockChainT m x
-maMockChainT m x
-mb=ReaderT
+combineMockChainTforall a. m a -> m a -> m a
+fMockChainT m x
+maMockChainT 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->
-letresA :: m (Either MockChainError (x, MockChainSt))
-resA=ExceptT MockChainError m (x, MockChainSt)
+$\MockChainSt
+s->
+letresA :: 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
unMockChainMockChainT 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
unMockChainMockChainT m x
-mb)MockChainEnv
-r)MockChainSt
-s
+mb)MockChainEnv
+r)MockChainSt
+sinm (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
-fm (Either MockChainError (x, MockChainSt))
-resAm (Either MockChainError (x, MockChainSt))
-resB
+fm (Either MockChainError (x, MockChainSt))
+resAm (Either MockChainError (x, MockChainSt))
+resB
-mapMockChainT::
-(m(EitherMockChainError(a,MockChainSt))->n(EitherMockChainError(b,MockChainSt)))->
-MockChainTma->
-MockChainTnb
+mapMockChainT::
+(m(EitherMockChainError(a,MockChainSt))->n(EitherMockChainError(b,MockChainSt)))->
+MockChainTma->
+MockChainTnbmapMockChainT :: (m (Either MockChainError (a, MockChainSt))
-> n (Either MockChainError (b, MockChainSt)))
-> MockChainT m a -> MockChainT n b
-mapMockChainTm (Either MockChainError (a, MockChainSt))
+mapMockChainTm (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
mapExceptTm (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::
-(Monadm)=>
+runMockChainTRaw::
+(Monadm)=>MockChainEnv->MockChainSt->
-MockChainTma->
-m(EitherMockChainError(a,MockChainSt))
+MockChainTma->
+m(EitherMockChainError(a,MockChainSt))runMockChainTRaw :: MockChainEnv
-> MockChainSt
-> MockChainT m a
-> m (Either MockChainError (a, MockChainSt))
-runMockChainTRawMockChainEnv
-e0MockChainSt
-i0=
+runMockChainTRawMockChainEnv
+e0MockChainSt
+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)
runStateTMockChainSt
-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
runReaderTMockChainEnv
-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::
-(Monadm)=>
+runMockChainTFrom::
+(Monadm)=>InitialDistribution->
-MockChainTma->
-m(EitherMockChainError(a,UtxoState))
+MockChainTma->
+m(EitherMockChainError(a,UtxoState))runMockChainTFrom :: InitialDistribution
-> MockChainT m a -> m (Either MockChainError (a, UtxoState))
-runMockChainTFromInitialDistribution
-i0=
+runMockChainTFromInitialDistribution
+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
mockChainSt0FromInitialDistribution
-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::(Monadm)=>MockChainTma->m(EitherMockChainError(a,UtxoState))
+runMockChainT::(Monadm)=>MockChainTma->m(EitherMockChainError(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->MockChaina->EitherMockChainError(a,MockChainSt)
+runMockChainRaw::MockChainEnv->MockChainSt->MockChaina->EitherMockChainError(a,MockChainSt)runMockChainRaw :: MockChainEnv
-> MockChainSt
-> MockChain a
-> Either MockChainError (a, MockChainSt)
-runMockChainRawMockChainEnv
-e0MockChainSt
-i0=Identity (Either MockChainError (a, MockChainSt))
+runMockChainRawMockChainEnv
+e0MockChainSt
+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))
runMockChainTRawMockChainEnv
-e0MockChainSt
-i0
+e0MockChainSt
+i0-- | See 'runMockChainTFrom'
-runMockChainFrom::
-InitialDistribution->MockChaina->EitherMockChainError(a,UtxoState)
+runMockChainFrom::
+InitialDistribution->MockChaina->EitherMockChainError(a,UtxoState)runMockChainFrom :: InitialDistribution
-> MockChain a -> Either MockChainError (a, UtxoState)
-runMockChainFromInitialDistribution
-i0=Identity (Either MockChainError (a, UtxoState))
+runMockChainFromInitialDistribution
+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))
runMockChainTFromInitialDistribution
-i0
+i0-- | See 'runMockChainT'
-runMockChain::MockChaina->EitherMockChainError(a,UtxoState)
+runMockChain::MockChaina->EitherMockChainError(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->MockChainStmockChainSt0From :: InitialDistribution -> MockChainSt
-mockChainSt0FromInitialDistribution
-i0=UtxoIndex
+mockChainSt0FromInitialDistribution
+i0=UtxoIndex
-> Map DatumHash (TxSkelOutDatum, Integer)
-> Map ValidatorHash (Versioned Validator)
-> Slot
-> MockChainSt
MockChainSt(InitialDistribution -> UtxoIndex
utxoIndex0FromInitialDistribution
-i0)Map DatumHash (TxSkelOutDatum, Integer)
+i0)Map DatumHash (TxSkelOutDatum, Integer)
forall k a. Map k a
Map.emptyMap ValidatorHash (Versioned Validator)
forall k a. Map k a
@@ -1055,40 +1055,40 @@
definstanceDefaultMockChainStwhere
-def :: MockChainSt
-def=MockChainSt
+def :: MockChainSt
+def=MockChainSt
mockChainSt0utxoIndex0From::InitialDistribution->Ledger.UtxoIndexutxoIndex0From :: InitialDistribution -> UtxoIndex
-utxoIndex0FromInitialDistribution
-i0=Blockchain -> UtxoIndex
+utxoIndex0FromInitialDistribution
+i0=Blockchain -> UtxoIndex
Ledger.initialise[[CardanoTx -> OnChainTx
Ledger.Valid(CardanoTx -> OnChainTx) -> CardanoTx -> OnChainTx
forall a b. (a -> b) -> a -> b
$InitialDistribution -> CardanoTx
-initialTxForInitialDistribution
-i0]]
+initialTxForInitialDistribution
+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
-initialTxForInitialDistribution
-initDist=Tx BabbageEra -> CardanoTx
+initialTxFor::InitialDistribution->Ledger.CardanoTx
+initialTxFor :: InitialDistribution -> CardanoTx
+initialTxForInitialDistribution
+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.TxTxBody BabbageEra
-body[]
+body[]where
-body::C.TxBodyC.BabbageEra
-body :: TxBody BabbageEra
-body=
+body::C.TxBodyC.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
-initUtxosForWallet
-w)[Value]
-vs)[(Wallet, [Value])]
-initDist',
+initUtxosForWallet
+w)[Value]
+vs)[(Wallet, [Value])]
+initDist',txIns :: TxIns BuildTx BabbageEra
C.txIns=[(NetworkId -> Hash GenesisUTxOKey -> TxIn
C.genesisUTxOPseudoTxInNetworkId
-theNetworkIdHash GenesisUTxOKey
-genesisKeyHash,Witness WitCtxTxIn BabbageEra
+theNetworkIdHash GenesisUTxOKey
+genesisKeyHash,Witness WitCtxTxIn BabbageEra
-> BuildTxWith BuildTx (Witness WitCtxTxIn BabbageEra)
forall a. a -> BuildTxWith BuildTx a
C.BuildTxWithWitness 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.KeyWitnessKeyWitnessInCtx 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.HashC.GenesisUTxOKey
-genesisKeyHash :: Hash GenesisUTxOKey
-genesisKeyHash=
+genesisKeyHash::C.HashC.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]
unInitialDistributionInitialDistribution
-initDist
+initDist
-initUtxosFor :: Wallet -> Value -> TxOut CtxTx BabbageEra
-initUtxosForWallet
-wValue
-v=Address -> Value -> Maybe () -> TxOut CtxTx BabbageEra
+initUtxosFor :: Wallet -> Value -> TxOut CtxTx BabbageEra
+initUtxosForWallet
+wValue
+v=Address -> Value -> Maybe () -> TxOut CtxTx BabbageEra
forall a.
ToData a =>
Address -> Value -> Maybe a -> TxOut CtxTx BabbageEra
-txOut(Wallet -> Address
+txOut(Wallet -> Address
walletAddressWallet
-w)Value
-v(Maybe ()
+w)Value
+v(Maybe ()
forall a. Maybe a
Nothing@())
-fromRight'::Showe=>Eitherea->a
-fromRight' :: Either e a -> a
-fromRight'Either e a
-x=caseEither e a
-xof
-Lefte
-err->String -> a
+fromRight'::Showe=>Eitherea->a
+fromRight' :: Either e a -> a
+fromRight'Either e a
+x=caseEither e a
+xof
+Lefte
+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
showe
-err
-Righta
-res->a
-res
+err
+Righta
+res->a
+res
-txOut :: Address -> Value -> Maybe a -> TxOut CtxTx BabbageEra
-txOutAddress
-addrValue
-valueMaybe a
-datum=Address -> Value -> OutputDatum -> TxOut CtxTx BabbageEra
-toCardanoTxOut'Address
-addrValue
-valueOutputDatum
-datum'
+txOut :: Address -> Value -> Maybe a -> TxOut CtxTx BabbageEra
+txOutAddress
+addrValue
+valueMaybe a
+datum=Address -> Value -> OutputDatum -> TxOut CtxTx BabbageEra
+toCardanoTxOut'Address
+addrValue
+valueOutputDatum
+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.TxOutC.CtxTxC.BabbageEra
-toCardanoTxOut' :: Address -> Value -> OutputDatum -> TxOut CtxTx BabbageEra
-toCardanoTxOut'Address
-addrValue
-valueOutputDatum
-datum=
+toCardanoTxOut' :: Address -> Value -> OutputDatum -> TxOut CtxTx BabbageEra
+toCardanoTxOut'Address
+addrValue
+valueOutputDatum
+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.toCardanoTxOutNetworkId
-theNetworkId
+theNetworkId(Address -> Value -> OutputDatum -> Maybe ScriptHash -> TxOut
PV2.TxOutAddress
-addrValue
-valueOutputDatum
-datumMaybe ScriptHash
+addrValue
+valueOutputDatum
+datumMaybe 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.fromCardanoTxInTxIn
-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.TxOutC.CtxUTxOera->C.TxOutC.CtxTxera
-toCtxTxTxOut :: TxOut CtxUTxO era -> TxOut CtxTx era
-toCtxTxTxOut(C.TxOutAddressInEra era
-addrTxOutValue era
-valTxOutDatum CtxUTxO era
-dReferenceScript era
-refS)=
-letdat :: TxOutDatum CtxTx era
-dat=caseTxOutDatum CtxUTxO era
-dof
+toCtxTxTxOut::C.TxOutC.CtxUTxOera->C.TxOutC.CtxTxera
+toCtxTxTxOut :: TxOut CtxUTxO era -> TxOut CtxTx era
+toCtxTxTxOut(C.TxOutAddressInEra era
+addrTxOutValue era
+valTxOutDatum CtxUTxO era
+dReferenceScript era
+refS)=
+letdat :: TxOutDatum CtxTx era
+dat=caseTxOutDatum CtxUTxO era
+dofTxOutDatum CtxUTxO era
C.TxOutDatumNone->TxOutDatum CtxTx era
forall ctx era. TxOutDatum ctx era
C.TxOutDatumNone
-C.TxOutDatumHashScriptDataSupportedInEra era
-sHash ScriptData
-h->ScriptDataSupportedInEra era
+C.TxOutDatumHashScriptDataSupportedInEra era
+sHash ScriptData
+h->ScriptDataSupportedInEra era
-> Hash ScriptData -> TxOutDatum CtxTx era
forall era ctx.
ScriptDataSupportedInEra era
-> Hash ScriptData -> TxOutDatum ctx era
C.TxOutDatumHashScriptDataSupportedInEra era
-sHash ScriptData
-h
-C.TxOutDatumInlineReferenceTxInsScriptsInlineDatumsSupportedInEra era
-sScriptData
-sd->ReferenceTxInsScriptsInlineDatumsSupportedInEra era
+sHash ScriptData
+h
+C.TxOutDatumInlineReferenceTxInsScriptsInlineDatumsSupportedInEra era
+sScriptData
+sd->ReferenceTxInsScriptsInlineDatumsSupportedInEra era
-> ScriptData -> TxOutDatum CtxTx era
forall era ctx.
ReferenceTxInsScriptsInlineDatumsSupportedInEra era
-> ScriptData -> TxOutDatum ctx era
C.TxOutDatumInlineReferenceTxInsScriptsInlineDatumsSupportedInEra era
-sScriptData
-sd
+sScriptData
+sdinAddressInEra era
-> TxOutValue era
-> TxOutDatum CtxTx era
@@ -1453,20 +1453,20 @@
-> ReferenceScript era
-> TxOut ctx era
C.TxOutAddressInEra era
-addrTxOutValue era
-valTxOutDatum CtxTx era
-datReferenceScript era
-refS
+addrTxOutValue era
+valTxOutDatum CtxTx era
+datReferenceScript era
+refS
-instanceMonadm=>MonadBlockChainBalancing(MockChainTm)where
-getParams :: MockChainT m Params
+instanceMonadm=>MonadBlockChainBalancing(MockChainTm)where
+getParams :: MockChainT m Params
getParams=(MockChainEnv -> Params) -> MockChainT m Params
forall r (m :: * -> *) a. MonadReader r m => (r -> a) -> m a
asksMockChainEnv -> Params
mceParams
-validatorFromHash :: ValidatorHash -> MockChainT m (Maybe (Versioned Validator))
-validatorFromHashValidatorHash
-valHash=(MockChainSt -> Maybe (Versioned Validator))
+validatorFromHash :: ValidatorHash -> MockChainT m (Maybe (Versioned Validator))
+validatorFromHashValidatorHash
+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.lookupValidatorHash
-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)
-txOutByRefLedgerTxOutRef
-outref=(MockChainSt -> Maybe TxOut) -> MockChainT m (Maybe TxOut)
+txOutByRefLedger :: TxOutRef -> MockChainT m (Maybe TxOut)
+txOutByRefLedgerTxOutRef
+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.lookupTxOutRef
-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)
-datumFromHashDatumHash
-datumHash=(TxSkelOutDatum -> Maybe Datum
+datumFromHash :: DatumHash -> MockChainT m (Maybe Datum)
+datumFromHashDatumHash
+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.lookupDatumHash
-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
getsMockChainSt -> Map DatumHash (TxSkelOutDatum, Integer)
mcstDatums
-utxosAtLedger :: Address -> MockChainT m [(TxOutRef, TxOut)]
-utxosAtLedgerAddress
-addr=((TxOutRef, TxOut) -> Bool)
+utxosAtLedger :: Address -> MockChainT m [(TxOutRef, TxOut)]
+utxosAtLedgerAddress
+addr=((TxOutRef, TxOut) -> Bool)
-> [(TxOutRef, TxOut)] -> [(TxOutRef, TxOut)]
forall a. (a -> Bool) -> [a] -> [a]
filter((Address
-addrAddress -> Address -> Bool
+addrAddress -> 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
-instanceMonadm=>MonadBlockChainWithoutValidation(MockChainTm)where
-allUtxosLedger :: MockChainT m [(TxOutRef, TxOut)]
-allUtxosLedger=(MockChainSt -> [(TxOutRef, TxOut)])
+instanceMonadm=>MonadBlockChainWithoutValidation(MockChainTm)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
getsMockChainSt -> Slot
mcstCurrentSlot
-awaitSlot :: Slot -> MockChainT m Slot
-awaitSlotSlot
-s=(MockChainSt -> MockChainSt) -> MockChainT m ()
+awaitSlot :: Slot -> MockChainT m Slot
+awaitSlotSlot
+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
maxSlot
-s(MockChainSt -> Slot
+s(MockChainSt -> Slot
mcstCurrentSlotMockChainSt
-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
-instanceMonadm=>MonadBlockChain(MockChainTm)where
-validateTxSkel :: TxSkel -> MockChainT m CardanoTx
-validateTxSkelTxSkel
-skelUnbal=do
-(TxSkel
-skel,Fee
-fee,Set TxOutRef
-collateralInputs)<-TxSkel -> MockChainT m (TxSkel, Fee, Set TxOutRef)
+instanceMonadm=>MonadBlockChain(MockChainTm)where
+validateTxSkel :: TxSkel -> MockChainT m CardanoTx
+validateTxSkelTxSkel
+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)
balancedTxSkelTxSkel
-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)
txSkelInputDataTxSkel
-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
runTransactionValidationParams
-theParams
+theParamsTx BabbageEra
-tx
+tx(TxOpts -> [RawModTx]
txOptUnsafeModTx(TxOpts -> [RawModTx]) -> TxOpts -> [RawModTx]
forall a b. (a -> b) -> a -> b
$TxSkel -> TxOpts
txSkelOptsTxSkel
-skel)
+skel)Map DatumHash Datum
-consumedData
+consumedData(TxSkel -> Map DatumHash TxSkelOutDatum
txSkelOutputDataTxSkel
-skel)
+skel)(TxSkel -> Map ValidatorHash (Versioned Validator)
txSkelOutValidatorsTxSkel
-skelMap ValidatorHash (Versioned Validator)
+skelMap ValidatorHash (Versioned Validator)
-> Map ValidatorHash (Versioned Validator)
-> Map ValidatorHash (Versioned Validator)
forall a. Semigroup a => a -> a -> a
<>TxSkel -> Map ValidatorHash (Versioned Validator)
txSkelOutReferenceScriptsTxSkel
-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
txSkelOptsTxSkel
-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
mcstCurrentSlotMockChainSt
-stSlot -> Slot -> Slot
+stSlot -> Slot -> Slot
forall a. Num a => a -> a -> a
+Slot
1})CardanoTx -> MockChainT m CardanoTx
forall (m :: * -> *) a. Monad m => a -> m a
returnCardanoTx
-someCardanoTx
+someCardanoTx
-runTransactionValidation::
-Monadm=>
+runTransactionValidation::
+Monadm=>-- | 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.MapPl.ValidatorHash(Pl.VersionedPl.Validator)->
-MockChainTmLedger.CardanoTx
+MockChainTmLedger.CardanoTxrunTransactionValidation :: Params
-> Tx BabbageEra
-> [RawModTx]
@@ -1772,58 +1772,58 @@
-> Map DatumHash TxSkelOutDatum
-> Map ValidatorHash (Versioned Validator)
-> MockChainT m CardanoTx
-runTransactionValidationParams
-theParamsTx BabbageEra
-cardanoTx[RawModTx]
-rawModTxMap DatumHash Datum
-consumedDataMap DatumHash TxSkelOutDatum
-producedDataMap ValidatorHash (Versioned Validator)
-outputValidators=do
-UtxoIndex
-utxoIndex<-(MockChainSt -> UtxoIndex) -> MockChainT m UtxoIndex
+runTransactionValidationParams
+theParamsTx BabbageEra
+cardanoTx[RawModTx]
+rawModTxMap DatumHash Datum
+consumedDataMap DatumHash TxSkelOutDatum
+producedDataMap ValidatorHash (Versioned Validator)
+outputValidators=do
+UtxoIndex
+utxoIndex<-(MockChainSt -> UtxoIndex) -> MockChainT m UtxoIndex
forall s (m :: * -> *) a. MonadState s m => (s -> a) -> m a
getsMockChainSt -> UtxoIndex
mcstIndex
-Slot
-theSlot<-MockChainT m Slot
+Slot
+theSlot<-MockChainT m Slot
forall (m :: * -> *). MonadBlockChainWithoutValidation m => m Slot
currentSlot
-letcardanoIndex::CardanoLedger.UTxOEmulator.EmulatorEra
-cardanoIndex :: UTxO EmulatorEra
-cardanoIndex=UtxoIndex -> UTxO EmulatorEra
+letcardanoIndex::CardanoLedger.UTxOEmulator.EmulatorEra
+cardanoIndex :: UTxO EmulatorEra
+cardanoIndex=UtxoIndex -> UTxO EmulatorEra
Ledger.fromPlutusIndexUtxoIndex
-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.CardanoEmulatorEraTxTx BabbageEra
-cardanoTx
+cardanoTx
-mValidationError::EitherLedger.ValidationErrorInPhaseLedger.ValidationSuccess
-mValidationError :: Either ValidationErrorInPhase ValidationSuccess
-mValidationError=Params
+mValidationError::EitherLedger.ValidationErrorInPhaseLedger.ValidationSuccess
+mValidationError :: Either ValidationErrorInPhase ValidationSuccess
+mValidationError=Params
-> Slot
-> UTxO EmulatorEra
-> CardanoTx
-> Either ValidationErrorInPhase ValidationSuccess
Emulator.validateCardanoTxParams
-theParamsSlot
-theSlotUTxO EmulatorEra
-cardanoIndexCardanoTx
-txWrapped
+theParamsSlot
+theSlotUTxO EmulatorEra
+cardanoIndexCardanoTx
+txWrapped
-newUtxoIndex::Ledger.UtxoIndex
-newUtxoIndex :: UtxoIndex
-newUtxoIndex=caseEither ValidationErrorInPhase ValidationSuccess
-mValidationErrorof
+newUtxoIndex::Ledger.UtxoIndex
+newUtxoIndex :: UtxoIndex
+newUtxoIndex=caseEither ValidationErrorInPhase ValidationSuccess
+mValidationErrorofLeft(ValidationPhase
Ledger.Phase1,ValidationError
_)->UtxoIndex
-utxoIndex
+utxoIndexLeft(ValidationPhase
Ledger.Phase2,ValidationError
_)->
@@ -1831,21 +1831,21 @@
-- the indexCardanoTx -> UtxoIndex -> UtxoIndex
Ledger.insertCollateralCardanoTx
-txWrappedUtxoIndex
-utxoIndex
+txWrappedUtxoIndex
+utxoIndexRightValidationSuccess
_->CardanoTx -> UtxoIndex -> UtxoIndex
Ledger.insertCardanoTx
-txWrappedUtxoIndex
-utxoIndex
+txWrappedUtxoIndex
+utxoIndexcaseEither ValidationErrorInPhase ValidationSuccess
-mValidationErrorof
-LeftValidationErrorInPhase
-err->MockChainError -> MockChainT m CardanoTx
+mValidationErrorof
+LeftValidationErrorInPhase
+err->MockChainError -> MockChainT m CardanoTx
forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError(ValidationErrorInPhase -> MockChainError
MCEValidationErrorValidationErrorInPhase
-err)
+err)RightValidationSuccess
_->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)
mcstDatumsMockChainSt
-stMap DatumHash (TxSkelOutDatum, Integer)
+stMap 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)
mcstValidatorsMockChainSt
-stMap ValidatorHash (Versioned Validator)
+stMap 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.CardanoEmulatorEraTxTx BabbageEra
-cardanoTx)
+cardanoTx)where
-addMcstDatums :: Map k (a, a) -> Map k a -> Map k (a, a)
-addMcstDatumsMap k (a, a)
-storedMap k a
-new=((a, a) -> (a, a) -> (a, a))
+addMcstDatums :: Map k (a, a) -> Map k a -> Map k (a, a)
+addMcstDatumsMap k (a, a)
+storedMap 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
-n1a -> a -> a
+Map.unionWith(\(a
+d,a
+n1)(a
+_,a
+n2)->(a
+d,a
+n1a -> 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
_->ifInteger
-nInteger -> Integer -> Bool
+nInteger -> Integer -> Bool
forall a. Eq a => a -> a -> Bool
==Integer
1thenMaybe (a, Integer)
@@ -1948,8 +1948,8 @@
Nothingelse(a, Integer) -> Maybe (a, Integer)
forall a. a -> Maybe a
Just(a
-d,Integer
-nInteger -> Integer -> Integer
+d,Integer
+nInteger -> 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 @@
=ToCardanoErrorStringPl.ToCardanoError|TxBodyErrorStringC.TxBodyError|GenerateTxErrorGeneralString
-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 @@
}instanceDefaultGenTxParamswhere
-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)
-generateTxBodyContentGenTxParams{Set TxOutRef
+generateTxBodyContentGenTxParams{Set TxOutRef
Fee
gtpFee :: Fee
gtpCollateralIns :: Set TxOutRef
gtpFee :: GenTxParams -> Fee
gtpCollateralIns :: GenTxParams -> Set TxOutRef
-..}Params
-theParamsMap DatumHash Datum
-managedDataMap TxOutRef TxOut
-managedTxOutsMap ValidatorHash (Versioned Validator)
-managedValidatorsTxSkel
-skel=do
-[(TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn BabbageEra))]
-txIns<-((TxOutRef, TxSkelRedeemer)
+..}Params
+theParamsMap DatumHash Datum
+managedDataMap TxOutRef TxOut
+managedTxOutsMap ValidatorHash (Versioned Validator)
+managedValidatorsTxSkel
+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
txSkelInsTxSkel
-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
-TxSkelRedeemerForReferencedScriptTxOutRef
-orefredeemer
+TxSkelRedeemerForReferencedScriptTxOutRef
+orefredeemer
_->TxOutRef -> Maybe TxOutRef
forall a. a -> Maybe a
JustTxOutRef
-oref
+orefTxSkelRedeemer
_->Maybe TxOutRef
forall a. Maybe a
@@ -191,26 +191,26 @@
forall a b. (a -> b) -> a -> b
$TxSkel -> Map TxOutRef TxSkelRedeemer
txSkelInsTxSkel
-skel)
+skel)[TxOutRef] -> [TxOutRef] -> [TxOutRef]
forall a. [a] -> [a] -> [a]
++Set TxOutRef -> [TxOutRef]
forall a. Set a -> [a]
Set.toList(TxSkel -> Set TxOutRef
txSkelInsReferenceTxSkel
-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.toListSet 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)
txSkelOutToCardanoTxOutParams
-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]
txSkelOutsTxSkel
-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
txSkelValidityRangeTxSkel
-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
txSkelMintsTxSkel
-skel
-TxExtraKeyWitnesses BabbageEra
-txExtraKeyWits<-
-letsigners :: [Wallet]
-signers=TxSkel -> [Wallet]
+skel
+TxExtraKeyWitnesses BabbageEra
+txExtraKeyWits<-
+letsigners :: [Wallet]
+signers=TxSkel -> [Wallet]
txSkelSignersTxSkel
-skel
+skelinif[Wallet] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null[Wallet]
-signers
+signersthenGenerateTxError
-> 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->doPl.TxOutAddress
-_Value
-outValueOutputDatum
+_Value
+outValueOutputDatum
_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
showTxOutRef
-txOutRef)
+txOutRef)(TxOutRef -> Map TxOutRef TxOut -> Maybe TxOut
forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookupTxOutRef
-txOutRefMap TxOutRef TxOut
-managedTxOuts)
+txOutRefMap TxOutRef TxOut
+managedTxOuts)Value -> Either GenerateTxError Value
forall a b. b -> Either a b
RightValue
-outValue
+outValue)([TxOutRef] -> Either GenerateTxError [Value])
-> [TxOutRef] -> Either GenerateTxError [Value]
@@ -434,7 +434,7 @@
$Set TxOutRef -> [TxOutRef]
forall a. Set a -> [a]
Set.toListSet 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 collateraltxReturnCollateral :: TxReturnCollateral CtxTx BabbageEra
C.txReturnCollateral=TxReturnCollateral CtxTx BabbageEra
@@ -496,10 +496,10 @@
forall a b. (a -> b) -> a -> b
$Fee -> Integer
feeLovelaceFee
-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 welltxExtraKeyWits :: 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 welltxWithdrawals :: 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 welltxCertificates :: 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 welltxUpdateProposal :: TxUpdateProposal BabbageEra
-C.txUpdateProposal=TxUpdateProposal BabbageEra
+C.txUpdateProposal=TxUpdateProposal BabbageEra
forall era. TxUpdateProposal era
C.TxUpdateProposalNone,-- That's what plutus-apps does as welltxMintValue :: 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->Maybea->Eitherea
-throwOnNothing :: e -> Maybe a -> Either e a
-throwOnNothinge
-err=Either e a -> (a -> Either e a) -> Maybe a -> Either e a
+throwOnNothing::e->Maybea->Eitherea
+throwOnNothing :: e -> Maybe a -> Either e a
+throwOnNothinge
+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
Lefte
-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)->EitherGenerateTxError
@@ -581,18 +581,18 @@
C.BuildTx(C.WitnessC.WitCtxTxInC.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)
-mkWitnessTxSkelRedeemer
-txSkelRedeemer
+mkWitnessTxSkelRedeemer
+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.BuildTxWithWitness 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.toCardanoTxInTxOutRef
-txOutRef
+txOutRefwhere
-resolveScriptOutputOwnerAndDatum::
+resolveScriptOutputOwnerAndDatum::EitherGenerateTxError(Pl.ValidatorHash,Pl.VersionedPl.Validator,C.ScriptDatumC.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
GenerateTxErrorGeneralString
"txSkelInToTxIn: Unknown txOutRef")(TxOutRef -> Map TxOutRef TxOut -> Maybe TxOut
forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookupTxOutRef
-txOutRefMap TxOutRef TxOut
-managedTxOuts)
-ValidatorHash
-validatorHash<-
+txOutRefMap TxOutRef TxOut
+managedTxOuts)
+ValidatorHash
+validatorHash<-caseTxOut -> Address
forall o.
(IsAbstractOutput o, ToCredential (OwnerType o)) =>
o -> Address
outputAddressTxOut
-txOutof
-(Pl.Address(Pl.ScriptCredentialValidatorHash
-validatorHash)Maybe StakingCredential
+txOutof
+(Pl.Address(Pl.ScriptCredentialValidatorHash
+validatorHash)Maybe StakingCredential
_)->ValidatorHash -> Either GenerateTxError ValidatorHash
forall a b. b -> Either a b
RightValidatorHash
-validatorHash
+validatorHashAddress
_->GenerateTxError -> Either GenerateTxError ValidatorHash
forall a b. a -> Either a b
Left(String -> GenerateTxError
GenerateTxErrorGeneralString
"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
GenerateTxErrorGeneralString
"txSkelInToTxIn: Unknown validator")
@@ -684,35 +684,35 @@
-> Maybe (Versioned Validator)
forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookupValidatorHash
-validatorHashMap ValidatorHash (Versioned Validator)
-managedValidators)
-ScriptDatum WitCtxTxIn
-datum<-
+validatorHashMap ValidatorHash (Versioned Validator)
+managedValidators)
+ScriptDatum WitCtxTxIn
+datum<-caseTxOut -> OutputDatum
forall o.
(IsAbstractOutput o, ToOutputDatum (DatumType o)) =>
o -> OutputDatum
outputOutputDatumTxOut
-txOutof
+txOutofOutputDatum
Pl.NoOutputDatum->GenerateTxError -> Either GenerateTxError (ScriptDatum WitCtxTxIn)
forall a b. a -> Either a b
Left(String -> GenerateTxError
GenerateTxErrorGeneralString
"txSkelInToTxIn: No datum found on script output")
-Pl.OutputDatumDatum
-_datum->ScriptDatum WitCtxTxIn
+Pl.OutputDatumDatum
+_datum->ScriptDatum WitCtxTxIn
-> Either GenerateTxError (ScriptDatum WitCtxTxIn)
forall a b. b -> Either a b
RightScriptDatum WitCtxTxIn
C.InlineScriptDatum
-Pl.OutputDatumHashDatumHash
-datumHash->
+Pl.OutputDatumHashDatumHash
+datumHash->GenerateTxError
-> Maybe (ScriptDatum WitCtxTxIn)
-> Either GenerateTxError (ScriptDatum WitCtxTxIn)
forall e a. e -> Maybe a -> Either e a
-throwOnNothing
+throwOnNothing(String -> GenerateTxError
GenerateTxErrorGeneralString
"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.lookupDatumHash
-datumHashMap DatumHash Datum
-managedData)
+datumHashMap 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->EitherGenerateTxError(C.WitnessC.WitCtxTxInC.BabbageEra)
-mkWitness :: TxSkelRedeemer
+mkWitness::TxSkelRedeemer->EitherGenerateTxError(C.WitnessC.WitCtxTxInC.BabbageEra)
+mkWitness :: TxSkelRedeemer
-> Either GenerateTxError (Witness WitCtxTxIn BabbageEra)
-mkWitnessTxSkelRedeemer
+mkWitnessTxSkelRedeemer
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.KeyWitnessKeyWitnessInCtx WitCtxTxIn
C.KeyWitnessForSpending
-mkWitness(TxSkelRedeemerForReferencedScriptTxOutRef
-validatorOrefredeemer
-redeemer)=do
-(ValidatorHash
-validatorHash,Versioned Validator
-validator,ScriptDatum WitCtxTxIn
-datum)<-Either
+mkWitness(TxSkelRedeemerForReferencedScriptTxOutRef
+validatorOrefredeemer
+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
GenerateTxErrorGeneralString
"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.lookupTxOutRef
-validatorOrefMap TxOutRef TxOut
-managedTxOutsMaybe TxOut -> (TxOut -> Maybe ScriptHash) -> Maybe ScriptHash
+validatorOrefMap TxOutRef TxOut
+managedTxOutsMaybe 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
-scriptHashAtOrefScriptHash -> ScriptHash -> Bool
+scriptHashAtOrefScriptHash -> ScriptHash -> Bool
forall a. Eq a => a -> a -> Bool
/=ValidatorHash -> ScriptHash
forall a. ToScriptHash a => a -> ScriptHash
toScriptHashValidatorHash
-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
GenerateTxErrorGeneralString
"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.toCardanoTxInTxOutRef
-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.toCardanoScriptHashValidatorHash
-validatorHash)
-letscriptWitnessBuilder :: ScriptDatum WitCtxTxIn
+validatorHash)
+letscriptWitnessBuilder :: ScriptDatum WitCtxTxIn
-> ScriptData
-> ExecutionUnits
-> ScriptWitness WitCtxTxIn BabbageEra
-scriptWitnessBuilder=caseVersioned Validator
-validatorof
+scriptWitnessBuilder=caseVersioned Validator
+validatorofPl.VersionedValidator
_Language
Pl.PlutusV1->
@@ -888,10 +888,10 @@
forall lang.
TxIn -> Maybe ScriptHash -> PlutusScriptOrReferenceInput lang
C.PReferenceScriptTxIn
-validatorTxIn(ScriptHash -> Maybe ScriptHash
+validatorTxIn(ScriptHash -> Maybe ScriptHash
forall a. a -> Maybe a
JustScriptHash
-scriptHash))
+scriptHash))Pl.VersionedValidator
_Language
Pl.PlutusV2->
@@ -920,10 +920,10 @@
forall lang.
TxIn -> Maybe ScriptHash -> PlutusScriptOrReferenceInput lang
C.PReferenceScriptTxIn
-validatorTxIn(ScriptHash -> Maybe ScriptHash
+validatorTxIn(ScriptHash -> Maybe ScriptHash
forall a. a -> Maybe a
JustScriptHash
-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
+scriptWitnessBuilderScriptDatum 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.toBuiltinDataredeemer
-redeemer)
+redeemer)ExecutionUnits
Pl.zeroExecutionUnits-- We can't guess that yet, no?
-mkWitness(TxSkelRedeemerForScriptredeemer
-redeemer)=do
-(ValidatorHash
-_validatorHash,Versioned Validator
-validator,ScriptDatum WitCtxTxIn
-datum)<-Either
+mkWitness(TxSkelRedeemerForScriptredeemer
+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<-caseVersioned Validator
-validatorof
-Pl.Versioned(Pl.ValidatorScript
-script)Language
+validatorof
+Pl.Versioned(Pl.ValidatorScript
+script)Language
Pl.PlutusV1->(ToCardanoError -> GenerateTxError)
-> (PlutusScript PlutusScriptV1
@@ -1044,9 +1044,9 @@
forall lang. AsType lang -> AsType (PlutusScript lang)
C.AsPlutusScriptAsType PlutusScriptV1
C.AsPlutusScriptV1)Script
-script)
-Pl.Versioned(Pl.ValidatorScript
-script)Language
+script)
+Pl.Versioned(Pl.ValidatorScript
+script)Language
Pl.PlutusV2->(ToCardanoError -> GenerateTxError)
-> (PlutusScript PlutusScriptV2
@@ -1111,7 +1111,7 @@
forall lang. AsType lang -> AsType (PlutusScript lang)
C.AsPlutusScriptAsType 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
+scriptWitnessBuilderScriptDatum 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.toBuiltinDataredeemer
-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]->EitherGenerateTxError(C.TxInsReferenceC.BuildTxC.BabbageEra)
-txOutRefsToTxInsReference :: [TxOutRef]
+txOutRefsToTxInsReference::[Pl.TxOutRef]->EitherGenerateTxError(C.TxInsReferenceC.BuildTxC.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.TxInsReferenceReferenceTxInsScriptsInlineDatumsSupportedInEra 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]->EitherGenerateTxError(C.TxInsCollateralC.BabbageEra)
-txOutRefsToTxSkelInsCollateral :: [TxOutRef] -> Either GenerateTxError (TxInsCollateral BabbageEra)
-txOutRefsToTxSkelInsCollateral=
+txOutRefsToTxSkelInsCollateral::[Pl.TxOutRef]->EitherGenerateTxError(C.TxInsCollateralC.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 @@
mapMTxOutRef -> Either ToCardanoError TxIn
Pl.toCardanoTxInwhere
-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.TxInsCollateralCollateralSupportedInEra BabbageEra
C.CollateralInBabbageEra[TxIn]
-ins
+ins-- Convert the 'TxSkelMints' into a 'TxMintValue'
-txSkelMintsToTxMintValue::TxSkelMints->EitherGenerateTxError(C.TxMintValueC.BuildTxC.BabbageEra)
-txSkelMintsToTxMintValue :: TxSkelMints
+txSkelMintsToTxMintValue::TxSkelMints->EitherGenerateTxError(C.TxMintValueC.BuildTxC.BabbageEra)
+txSkelMintsToTxMintValue :: TxSkelMints
-> Either GenerateTxError (TxMintValue BuildTx BabbageEra)
-txSkelMintsToTxMintValueTxSkelMints
-mints=
+txSkelMintsToTxMintValueTxSkelMints
+mints=ifTxSkelMints
-mintsTxSkelMints -> TxSkelMints -> Bool
+mintsTxSkelMints -> 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
-mintValEither
+mintValEither
GenerateTxError
(BuildTxWith
BuildTx (Map PolicyId (ScriptWitness WitCtxMint BabbageEra))
@@ -1318,11 +1318,11 @@
<$>Either
GenerateTxError
(Map PolicyId (ScriptWitness WitCtxMint BabbageEra))
-witnessMap)
+witnessMap)where
-mintVal::EitherGenerateTxErrorC.Value
-mintVal :: Either GenerateTxError Value
-mintVal=
+mintVal::EitherGenerateTxErrorC.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::EitherGenerateTxError(MapC.PolicyId(C.ScriptWitnessC.WitCtxMintC.BabbageEra))
-witnessMap :: Either
+witnessMap::EitherGenerateTxError(MapC.PolicyId(C.ScriptWitnessC.WitCtxMintC.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.mintingPolicyHashVersioned MintingPolicy
-policy))
+policy))Either
GenerateTxError
(ScriptWitness WitCtxMint BabbageEra
@@ -1441,9 +1441,9 @@
<*>Versioned MintingPolicy
-> MintsRedeemer
-> Either GenerateTxError (ScriptWitness WitCtxMint BabbageEra)
-mkMintWitnessVersioned MintingPolicy
-policyMintsRedeemer
-redeemer
+mkMintWitnessVersioned MintingPolicy
+policyMintsRedeemer
+redeemer)([(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)]
-> Either
@@ -1457,28 +1457,28 @@
$TxSkelMints
-> [(Versioned MintingPolicy, MintsRedeemer, TokenName, Integer)]
txSkelMintsToListTxSkelMints
-mints
+mints
-mkMintWitness::
+mkMintWitness::Pl.VersionedPl.MintingPolicy->MintsRedeemer->EitherGenerateTxError(C.ScriptWitnessC.WitCtxMintC.BabbageEra)
-mkMintWitness :: Versioned MintingPolicy
+mkMintWitness :: Versioned MintingPolicy
-> MintsRedeemer
-> Either GenerateTxError (ScriptWitness WitCtxMint BabbageEra)
-mkMintWitness(Pl.Versioned(Pl.MintingPolicyScript
-script)Language
-version)MintsRedeemer
-redeemer=do
-ScriptDatum WitCtxMint
+mkMintWitness(Pl.Versioned(Pl.MintingPolicyScript
+script)Language
+version)MintsRedeemer
+redeemer=do
+ScriptDatum WitCtxMint
-> ScriptData
-> ExecutionUnits
-> ScriptWitness WitCtxMint BabbageEra
-scriptWitnessBuilder<-
+scriptWitnessBuilder<-caseLanguage
-versionof
+versionofLanguage
Pl.PlutusV1->(ToCardanoError -> GenerateTxError)
@@ -1544,7 +1544,7 @@
forall lang. AsType lang -> AsType (PlutusScript lang)
C.AsPlutusScriptAsType PlutusScriptV1
C.AsPlutusScriptV1)Script
-script)
+script)Language
Pl.PlutusV2->(ToCardanoError -> GenerateTxError)
@@ -1610,7 +1610,7 @@
forall lang. AsType lang -> AsType (PlutusScript lang)
C.AsPlutusScriptAsType 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
+scriptWitnessBuilderScriptDatum WitCtxMint
C.NoScriptDatumForMint-- This seems to be the only well-typed option (?)(caseMintsRedeemer
-redeemerof
+redeemerofMintsRedeemer
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
-SomeMintsRedeemerredeemer
-red->BuiltinData -> ScriptData
+SomeMintsRedeemerredeemer
+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.toBuiltinDataredeemer
-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->EitherGenerateTxError(C.TxOutC.CtxTxC.BabbageEra)txSkelOutToCardanoTxOut :: Params
-> TxSkelOut -> Either GenerateTxError (TxOut CtxTx BabbageEra)
-txSkelOutToCardanoTxOutParams
-theParams(Payso
-output)=
+txSkelOutToCardanoTxOutParams
+theParams(Payso
+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.pNetworkIdParams
-theParams)(o -> Address
+theParams)(o -> Address
forall o.
(IsAbstractOutput o, ToCredential (OwnerType o)) =>
o -> Address
outputAddresso
-output)
+output)Either
ToCardanoError
(TxOutValue BabbageEra
@@ -1725,7 +1725,7 @@
Pl.toCardanoValue(o -> Value
forall o. (IsAbstractOutput o, ToValue (ValueType o)) => o -> Value
outputValueo
-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
<*>(caseo
-outputo -> Optic' A_Lens NoIx o TxSkelOutDatum -> TxSkelOutDatum
+outputo -> 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
RightTxOutDatum CtxTx BabbageEra
Pl.toCardanoTxOutNoDatum
-TxSkelOutDatumHasha
-datum->DatumHash -> Either ToCardanoError (TxOutDatum CtxTx BabbageEra)
+TxSkelOutDatumHasha
+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
-TxSkelOutDatuma
-datum->TxOutDatum CtxTx BabbageEra
+datum
+TxSkelOutDatuma
+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
-TxSkelOutInlineDatuma
-datum->TxOutDatum CtxTx BabbageEra
+datum
+TxSkelOutInlineDatuma
+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
-outputo
+outputo
-> 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)
-generateTxGenTxParams
-genTxParamsParams
-paramsMap DatumHash Datum
-datumsMap TxOutRef TxOut
-txOutsMap ValidatorHash (Versioned Validator)
-validatorsTxSkel
-skel=do
-TxBodyContent BuildTx BabbageEra
-txBodyContent<-GenTxParams
+generateTxGenTxParams
+genTxParamsParams
+paramsMap DatumHash Datum
+datumsMap TxOutRef TxOut
+txOutsMap ValidatorHash (Versioned Validator)
+validatorsTxSkel
+skel=do
+TxBodyContent BuildTx BabbageEra
+txBodyContent<-GenTxParams
-> Params
-> Map DatumHash Datum
-> Map TxOutRef TxOut
@@ -1885,14 +1885,14 @@
-> TxSkel
-> Either GenerateTxError (TxBodyContent BuildTx BabbageEra)
generateTxBodyContentGenTxParams
-genTxParamsParams
-paramsMap DatumHash Datum
-datumsMap TxOutRef TxOut
-txOutsMap ValidatorHash (Versioned Validator)
-validatorsTxSkel
-skel
-Tx BabbageEra
-cardanoTxUnsigned<-
+genTxParamsParams
+paramsMap DatumHash Datum
+datumsMap TxOutRef TxOut
+txOutsMap ValidatorHash (Versioned Validator)
+validatorsTxSkel
+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.makeTransactionBodyTxBodyContent BuildTx BabbageEra
-txBodyContent)
-letcardanoTxSigned :: Tx BabbageEra
-cardanoTxSigned=(Tx BabbageEra -> Wallet -> Tx BabbageEra)
+txBodyContent)
+letcardanoTxSigned :: 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
-txAddSignatureTx BabbageEra
-cardanoTxUnsigned(TxSkel -> [Wallet]
+txAddSignatureTx BabbageEra
+cardanoTxUnsigned(TxSkel -> [Wallet]
txSkelSignersTxSkel
-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
+cardanoTxSignedwhere
-txAddSignature::C.TxC.BabbageEra->Wallet->C.TxC.BabbageEra
-txAddSignature :: Tx BabbageEra -> Wallet -> Tx BabbageEra
-txAddSignatureTx BabbageEra
-txWallet
-wal=casePrivateKey -> CardanoTx -> CardanoTx
+txAddSignature::C.TxC.BabbageEra->Wallet->C.TxC.BabbageEra
+txAddSignature :: Tx BabbageEra -> Wallet -> Tx BabbageEra
+txAddSignatureTx BabbageEra
+txWallet
+wal=casePrivateKey -> CardanoTx -> CardanoTx
Ledger.addCardanoTxSignature(Wallet -> PrivateKey
walletSKWallet
-wal)
+wal)(Tx BabbageEra -> EraInMode BabbageEra CardanoMode -> CardanoTx
forall era.
IsCardanoEra era =>
Tx era -> EraInMode era CardanoMode -> CardanoTx
Ledger.CardanoTxTx BabbageEra
-txEraInMode BabbageEra CardanoMode
+txEraInMode BabbageEra CardanoMode
C.BabbageEraInCardanoMode)of
-Ledger.CardanoTxTx era
-tx'EraInMode era CardanoMode
+Ledger.CardanoTxTx 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
-
-importqualifiedCardano.Node.EmulatorasEmulator
-importControl.Applicative
-importControl.Arrowhiding((<+>))
-importControl.Monad.Except
-importControl.Monad.Reader
-importControl.Monad.State
-importControl.Monad.Writer.Stricthiding(Alt)
-importCooked.Ltl
-importCooked.MockChain.BlockChain
-importCooked.MockChain.Direct
-importCooked.MockChain.UtxoState
-importCooked.Skeleton
-importCooked.Tweak.Common
-importData.Default
-importqualifiedData.MapasMap
-importqualifiedLedger.SlotasLedger
-importqualifiedLedger.TxasLedger
-importqualifiedLedger.Tx.CardanoAPIasLedger
-importqualifiedLedger.Typed.ScriptsasPl
-importqualifiedPlutus.V2.Ledger.ApiasPl
-
--- * 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::
-(forallm.Monadm=>MockChainTma->mres)->
-StagedMockChaina->
-[(res,MockChainLog)]
-interpretAndRunWith :: (forall (m :: * -> *). Monad m => MockChainT m a -> m res)
+there,
+)
+where
+
+importqualifiedCardano.Node.EmulatorasEmulator
+importControl.Applicative
+importControl.Arrowhiding((<+>))
+importControl.Monad.Except
+importControl.Monad.Reader
+importControl.Monad.State
+importControl.Monad.Writer.Stricthiding(Alt)
+importCooked.Ltl
+importCooked.MockChain.BlockChain
+importCooked.MockChain.Direct
+importCooked.MockChain.UtxoState
+importCooked.Skeleton
+importCooked.Tweak.Common
+importData.Default
+importqualifiedData.MapasMap
+importqualifiedLedger.SlotasLedger
+importqualifiedLedger.TxasLedger
+importqualifiedLedger.Tx.CardanoAPIasLedger
+importqualifiedLedger.Typed.ScriptsasPl
+importqualifiedPlutus.V2.Ledger.ApiasPl
+
+-- * 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::
+(forallm.Monadm=>MockChainTma->mres)->
+StagedMockChaina->
+[(res,MockChainLog)]
+interpretAndRunWith :: (forall (m :: * -> *). Monad m => MockChainT m a -> m res)
-> StagedMockChain a -> [(res, MockChainLog)]
-interpretAndRunWithforall (m :: * -> *). Monad m => MockChainT m a -> m res
-fStagedMockChain a
-smc=WriterT MockChainLog [] res -> [(res, MockChainLog)]
+interpretAndRunWithforall (m :: * -> *). Monad m => MockChainT m a -> m res
+fStagedMockChain 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
interpretStagedMockChain a
-smc
-
-interpretAndRun::
-StagedMockChaina->
-[(EitherMockChainError(a,UtxoState),MockChainLog)]
-interpretAndRun :: StagedMockChain a
+smc
+
+interpretAndRun::
+StagedMockChaina->
+[(EitherMockChainError(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
-
-dataMockChainLogEntry
-=MCLogSubmittedTxSkelSkelContextTxSkel
-|MCLogNewTxPl.TxId
-|MCLogFailString
-
-newtypeMockChainLog=MockChainLog{MockChainLog -> [MockChainLogEntry]
+
+dataMockChainLogEntry
+=MCLogSubmittedTxSkelSkelContextTxSkel
+|MCLogNewTxPl.TxId
+|MCLogFailString
+
+newtypeMockChainLog=MockChainLog{MockChainLog -> [MockChainLogEntry]
unMockChainLog::[MockChainLogEntry]}
-
-instanceSemigroupMockChainLogwhere
-MockChainLog[MockChainLogEntry]
-x<> :: MockChainLog -> MockChainLog -> MockChainLog
-<>MockChainLog[MockChainLogEntry]
-y=[MockChainLogEntry] -> MockChainLog
+
+instanceSemigroupMockChainLogwhere
+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
-
-instanceMonoidMockChainLogwhere
-mempty :: MockChainLog
+y
+
+instanceMonoidMockChainLogwhere
+mempty :: MockChainLog
mempty=[MockChainLogEntry] -> MockChainLog
MockChainLog[]
-
--- | The semantic domain in which 'StagedMockChain' gets interpreted; see the
--- 'interpret' function for more.
-typeInterpMockChain=MockChainT(WriterTMockChainLog[])
-
--- | 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::StagedMockChaina->InterpMockChaina
-interpret :: StagedMockChain a -> InterpMockChain a
+
+-- | The semantic domain in which 'StagedMockChain' gets interpreted; see the
+-- 'interpret' function for more.
+typeInterpMockChain=MockChainT(WriterTMockChainLog[])
+
+-- | 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::StagedMockChaina->InterpMockChaina
+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
-
-dataMockChainBuiltinawhere
--- methods of 'MonadBlockChain'
-
-GetParams::MockChainBuiltinEmulator.Params
-ValidateTxSkel::TxSkel->MockChainBuiltinLedger.CardanoTx
-TxOutByRefLedger::Pl.TxOutRef->MockChainBuiltin(MaybeLedger.TxOut)
-GetCurrentSlot::MockChainBuiltinLedger.Slot
-AwaitSlot::Ledger.Slot->MockChainBuiltinLedger.Slot
-DatumFromHash::Pl.DatumHash->MockChainBuiltin(MaybePl.Datum)
-AllUtxosLedger::MockChainBuiltin[(Pl.TxOutRef,Ledger.TxOut)]
-UtxosAtLedger::Pl.Address->MockChainBuiltin[(Pl.TxOutRef,Ledger.TxOut)]
-ValidatorFromHash::Pl.ValidatorHash->MockChainBuiltin(Maybe(Pl.VersionedPl.Validator))
--- | The empty set of traces
-Empty::MockChainBuiltina
--- | The union of two sets of traces
-Alt::
-StagedMockChaina->
-StagedMockChaina->
-MockChainBuiltina
--- for the 'MonadFail' instance
-Fail::String->MockChainBuiltina
--- for the 'MonadError MockChainError' instance
-ThrowError::MockChainError->MockChainBuiltina
-CatchError::StagedMockChaina->(MockChainError->StagedMockChaina)->MockChainBuiltina
-
-typeMockChainOp=LtlOp(UntypedTweakInterpMockChain)MockChainBuiltin
-
-typeStagedMockChain=StagedMockChainOp
-
-instanceAlternativeStagedMockChainwhere
-empty :: StagedMockChain a
+
+-- * 'StagedMockChain': An AST for 'MonadMockChain' computations
+
+dataMockChainBuiltinawhere
+-- methods of 'MonadBlockChain'
+
+GetParams::MockChainBuiltinEmulator.Params
+ValidateTxSkel::TxSkel->MockChainBuiltinLedger.CardanoTx
+TxOutByRefLedger::Pl.TxOutRef->MockChainBuiltin(MaybeLedger.TxOut)
+GetCurrentSlot::MockChainBuiltinLedger.Slot
+AwaitSlot::Ledger.Slot->MockChainBuiltinLedger.Slot
+DatumFromHash::Pl.DatumHash->MockChainBuiltin(MaybePl.Datum)
+AllUtxosLedger::MockChainBuiltin[(Pl.TxOutRef,Ledger.TxOut)]
+UtxosAtLedger::Pl.Address->MockChainBuiltin[(Pl.TxOutRef,Ledger.TxOut)]
+ValidatorFromHash::Pl.ValidatorHash->MockChainBuiltin(Maybe(Pl.VersionedPl.Validator))
+-- | The empty set of traces
+Empty::MockChainBuiltina
+-- | The union of two sets of traces
+Alt::
+StagedMockChaina->
+StagedMockChaina->
+MockChainBuiltina
+-- for the 'MonadFail' instance
+Fail::String->MockChainBuiltina
+-- for the 'MonadError MockChainError' instance
+ThrowError::MockChainError->MockChainBuiltina
+CatchError::StagedMockChaina->(MockChainError->StagedMockChaina)->MockChainBuiltina
+
+typeMockChainOp=LtlOp(UntypedTweakInterpMockChain)MockChainBuiltin
+
+typeStagedMockChain=StagedMockChainOp
+
+instanceAlternativeStagedMockChainwhere
+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
AltStagedMockChain a
-aStagedMockChain a
-b))a -> StagedMockChain a
+aStagedMockChain a
+b))a -> StagedMockChain a
forall a (op :: * -> *). a -> Staged op a
Return
-
-instanceMonadFailStagedMockChainwhere
-fail :: String -> StagedMockChain a
-failString
-msg=LtlOp (UntypedTweak InterpMockChain) MockChainBuiltin a
+
+instanceMonadFailStagedMockChainwhere
+fail :: String -> StagedMockChain a
+failString
+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
FailString
-msg))a -> StagedMockChain a
+msg))a -> StagedMockChain a
forall a (op :: * -> *). a -> Staged op a
Return
-
--- * 'InterpLtl' instance
-
-instanceMonadPlusm=>MonadPlus(MockChainTm)where
-mzero :: MockChainT m a
+
+-- * 'InterpLtl' instance
+
+instanceMonadPlusm=>MonadPlus(MockChainTm)where
+mzero :: MockChainT m a
mzero=m a -> MockChainT m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
@@ -256,7 +257,7 @@
liftm 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 @@
combineMockChainTforall a. m a -> m a -> m a
forall (m :: * -> *) a. MonadPlus m => m a -> m a -> m a
mplus
-
-instanceInterpLtl(UntypedTweakInterpMockChain)MockChainBuiltinInterpMockChainwhere
-interpBuiltin :: MockChainBuiltin a
+
+instanceInterpLtl(UntypedTweakInterpMockChain)MockChainBuiltinInterpMockChainwhere
+interpBuiltin :: MockChainBuiltin a
-> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a
interpBuiltinMockChainBuiltin a
GetParams=InterpMockChain Params
@@ -288,15 +289,15 @@
forall r (m :: * -> *) a. MonadReader r m => (r -> a) -> m a
asksMockChainEnv -> Params
mceParams
-interpBuiltin(ValidateTxSkelTxSkel
-skel)=
-StateT
+interpBuiltin(ValidateTxSkelTxSkel
+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::
-UntypedTweakInterpMockChain->
-[Ltl(UntypedTweakInterpMockChain)]->
-StateT[Ltl(UntypedTweakInterpMockChain)]InterpMockChainLedger.CardanoTx
-interpretAndTell :: UntypedTweak InterpMockChain
+where
+interpretAndTell::
+UntypedTweakInterpMockChain->
+[Ltl(UntypedTweakInterpMockChain)]->
+StateT[Ltl(UntypedTweakInterpMockChain)]InterpMockChainLedger.CardanoTx
+interpretAndTell :: UntypedTweak InterpMockChain
-> [Ltl (UntypedTweak InterpMockChain)]
-> StateT
[Ltl (UntypedTweak InterpMockChain)] InterpMockChain CardanoTx
-interpretAndTell(UntypedTweakTweak InterpMockChain a
-now)[Ltl (UntypedTweak InterpMockChain)]
-later=do
-MockChainSt
-mcst<-InterpMockChain MockChainSt
+interpretAndTell(UntypedTweakTweak 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 @@
liftInterpMockChain MockChainSt
forall s (m :: * -> *). MonadState s m => m s
get
-letmanagedTxOuts :: Map TxOutRef TxOut
-managedTxOuts=UtxoIndex -> Map TxOutRef TxOut
+letmanagedTxOuts :: 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)
mcstDatumsMockChainSt
-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)
runTweakInChainTweak InterpMockChain a
-nowTxSkel
-skel
-MockChainT (WriterT MockChainLog []) ()
+nowTxSkel
+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
fstMap 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
validateTxSkelTxSkel
-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.getCardanoTxIdCardanoTx
-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
returnCardanoTx
-tx
-interpBuiltin(TxOutByRefLedgerTxOutRef
-o)=TxOutRef
+tx
+interpBuiltin(TxOutByRefLedgerTxOutRef
+o)=TxOutRef
-> StateT
[Ltl (UntypedTweak InterpMockChain)] InterpMockChain (Maybe TxOut)
forall (m :: * -> *).
MonadBlockChainBalancing m =>
TxOutRef -> m (Maybe TxOut)
txOutByRefLedgerTxOutRef
-o
-interpBuiltinMockChainBuiltin a
+o
+interpBuiltinMockChainBuiltin a
GetCurrentSlot=StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a
forall (m :: * -> *). MonadBlockChainWithoutValidation m => m Slot
currentSlot
-interpBuiltin(AwaitSlotSlot
-s)=Slot
+interpBuiltin(AwaitSlotSlot
+s)=Slot
-> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain Slot
forall (m :: * -> *).
MonadBlockChainWithoutValidation m =>
Slot -> m Slot
awaitSlotSlot
-s
-interpBuiltin(DatumFromHashDatumHash
-h)=DatumHash
+s
+interpBuiltin(DatumFromHashDatumHash
+h)=DatumHash
-> StateT
[Ltl (UntypedTweak InterpMockChain)] InterpMockChain (Maybe Datum)
forall (m :: * -> *).
MonadBlockChainBalancing m =>
DatumHash -> m (Maybe Datum)
datumFromHashDatumHash
-h
-interpBuiltin(ValidatorFromHashValidatorHash
-h)=ValidatorHash
+h
+interpBuiltin(ValidatorFromHashValidatorHash
+h)=ValidatorHash
-> StateT
[Ltl (UntypedTweak InterpMockChain)]
InterpMockChain
@@ -568,15 +569,15 @@
MonadBlockChainBalancing m =>
ValidatorHash -> m (Maybe (Versioned Validator))
validatorFromHashValidatorHash
-h
-interpBuiltinMockChainBuiltin a
+h
+interpBuiltinMockChainBuiltin a
AllUtxosLedger=StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a
forall (m :: * -> *).
MonadBlockChainWithoutValidation m =>
m [(TxOutRef, TxOut)]
allUtxosLedger
-interpBuiltin(UtxosAtLedgerAddress
-address)=Address
+interpBuiltin(UtxosAtLedgerAddress
+address)=Address
-> StateT
[Ltl (UntypedTweak InterpMockChain)]
InterpMockChain
@@ -585,21 +586,21 @@
MonadBlockChainBalancing m =>
Address -> m [(TxOutRef, TxOut)]
utxosAtLedgerAddress
-address
-interpBuiltinMockChainBuiltin a
+address
+interpBuiltinMockChainBuiltin a
Empty=StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a
forall (m :: * -> *) a. MonadPlus m => m a
mzero
-interpBuiltin(AltStagedMockChain a
-lStagedMockChain a
-r)=StagedMockChain a
+interpBuiltin(AltStagedMockChain a
+lStagedMockChain 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
interpLtlStagedMockChain a
-lStateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a
+lStateT [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
interpLtlStagedMockChain a
-r
-interpBuiltin(FailString
-msg)=do
-MockChainT (WriterT MockChainLog []) ()
+r
+interpBuiltin(FailString
+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
MCLogFailString
-msg]
-String
+msg]
+String
-> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a
forall (m :: * -> *) a. MonadFail m => String -> m a
failString
-msg
-interpBuiltin(ThrowErrorMockChainError
-err)=MockChainError
+msg
+interpBuiltin(ThrowErrorMockChainError
+err)=MockChainError
-> StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a
forall e (m :: * -> *) a. MonadError e m => e -> m a
throwErrorMockChainError
-err
-interpBuiltin(CatchErrorStagedMockChain a
-actMockChainError -> StagedMockChain a
-handler)=StateT [Ltl (UntypedTweak InterpMockChain)] InterpMockChain a
+err
+interpBuiltin(CatchErrorStagedMockChain a
+actMockChainError -> 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
interpLtlStagedMockChain 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::TweakInterpMockChaina->TxSkel->[EitherMockChainError(a,TxSkel)]
-runTweak :: Tweak InterpMockChain a
+handler)
+
+-- ** Helpers to run tweaks for use in tests for tweaks
+
+runTweak::TweakInterpMockChaina->TxSkel->[EitherMockChainError(a,TxSkel)]
+runTweak :: Tweak InterpMockChain a
-> TxSkel -> [Either MockChainError (a, TxSkel)]
runTweak=MockChainEnv
-> MockChainSt
@@ -705,19 +706,19 @@
defMockChainSt
forall a. Default a => a
def
-
-runTweakFrom::MockChainEnv->MockChainSt->TweakInterpMockChaina->TxSkel->[EitherMockChainError(a,TxSkel)]
-runTweakFrom :: MockChainEnv
+
+runTweakFrom::MockChainEnv->MockChainSt->TweakInterpMockChaina->TxSkel->[EitherMockChainError(a,TxSkel)]
+runTweakFrom :: MockChainEnv
-> MockChainSt
-> Tweak InterpMockChain a
-> TxSkel
-> [Either MockChainError (a, TxSkel)]
-runTweakFromMockChainEnv
-mcenvMockChainSt
-mcstTweak InterpMockChain a
-tweakTxSkel
-skel=
-((Either MockChainError ((a, TxSkel), MockChainSt), MockChainLog)
+runTweakFromMockChainEnv
+mcenvMockChainSt
+mcstTweak InterpMockChain a
+tweakTxSkel
+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))
runMockChainTRawMockChainEnv
-mcenvMockChainSt
-mcst
-(MockChainT (WriterT MockChainLog []) (a, TxSkel)
+mcenvMockChainSt
+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)
runTweakInChainTweak InterpMockChain a
-tweakTxSkel
-skel
-
--- ** Modalities
-
--- | A modal mock chain is a mock chain that allows us to use LTL modifications
--- with 'Tweak's
-typeMonadModalBlockChainm=(MonadBlockChainm,MonadModalm,Modificationm~UntypedTweakInterpMockChain)
-
--- | Apply a 'Tweak' to some transaction in the given Trace. The tweak must
--- apply at least once.
-somewhere::MonadModalBlockChainm=>TweakInterpMockChainb->ma->ma
-somewhere :: Tweak InterpMockChain b -> m a -> m a
-somewhereTweak InterpMockChain b
-x=Ltl (Modification m) -> m a -> m a
+tweakTxSkel
+skel
+
+-- ** Modalities
+
+-- | A modal mock chain is a mock chain that allows us to use LTL modifications
+-- with 'Tweak's
+typeMonadModalBlockChainm=(MonadBlockChainm,MonadModalm,Modificationm~UntypedTweakInterpMockChain)
+
+-- | Apply a 'Tweak' to some transaction in the given Trace. The tweak must
+-- apply at least once.
+somewhere::MonadModalBlockChainm=>TweakInterpMockChainb->ma->ma
+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
-LtlTruthLtl (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)
+LtlUntilLtl (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
-UntypedTweakTweak 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::MonadModalBlockChainm=>TweakInterpMockChainb->ma->ma
-everywhere :: Tweak InterpMockChain b -> m a -> m a
-everywhereTweak 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::MonadModalBlockChainm=>TweakInterpMockChainb->ma->ma
+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
-LtlFalsityLtl (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)
+LtlReleaseLtl (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
-UntypedTweakTweak 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::MonadModalBlockChainm=>mx->TweakInterpMockChaina->mx
-withTweak :: m x -> Tweak InterpMockChain a -> m x
-withTweakm x
-traceTweak 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::MonadModalBlockChainm=>Integer->TweakInterpMockChainb->ma->ma
+there :: Integer -> Tweak InterpMockChain b -> m a -> m a
+thereInteger
+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)
+mkLtlFormulaInteger
+n
+where
+mkLtlFormula :: t -> Tweak m a -> Ltl (UntypedTweak m)
+mkLtlFormulat
+x=
+ift
+xt -> t -> Bool
+forall a. Eq a => a -> a -> Bool
+==t
+0
+thenUntypedTweak 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
-UntypedTweakTweak InterpMockChain a
-tweak)m x
-trace
-
--- * 'MonadBlockChain' and 'MonadMockChain' instances
-
-singletonBuiltin::builtina->Staged(LtlOpmodificationbuiltin)a
-singletonBuiltin :: builtin a -> Staged (LtlOp modification builtin) a
-singletonBuiltinbuiltin a
-b=LtlOp modification builtin a
+UntypedTweak
+elseLtl (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
+xt -> 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::MonadModalBlockChainm=>mx->TweakInterpMockChaina->mx
+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
+thereInteger
+0)
+
+-- * 'MonadBlockChain' and 'MonadMockChain' instances
+
+singletonBuiltin::builtina->Staged(LtlOpmodificationbuiltin)a
+singletonBuiltin :: builtin a -> Staged (LtlOp modification builtin) a
+singletonBuiltinbuiltin 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
Builtinbuiltin a
-b)a -> Staged (LtlOp modification builtin) a
+b)a -> Staged (LtlOp modification builtin) a
forall a (op :: * -> *). a -> Staged op a
Return
-
-instanceMonadErrorMockChainErrorStagedMockChainwhere
-throwError :: MockChainError -> StagedMockChain a
-throwError=MockChainBuiltin a -> StagedMockChain a
+
+instanceMonadErrorMockChainErrorStagedMockChainwhere
+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
-catchErrorStagedMockChain a
-actMockChainError -> StagedMockChain a
-handler=MockChainBuiltin a -> StagedMockChain a
+catchErrorStagedMockChain a
+actMockChainError -> 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
CatchErrorStagedMockChain a
-actMockChainError -> StagedMockChain a
-handler
-
-instanceMonadBlockChainBalancingStagedMockChainwhere
-getParams :: StagedMockChain Params
+actMockChainError -> StagedMockChain a
+handler
+
+instanceMonadBlockChainBalancingStagedMockChainwhere
+getParams :: StagedMockChain Params
getParams=MockChainBuiltin Params -> StagedMockChain Params
forall (builtin :: * -> *) a modification.
builtin a -> Staged (LtlOp modification builtin) a
singletonBuiltinMockChainBuiltin 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
-
-instanceMonadBlockChainWithoutValidationStagedMockChainwhere
-allUtxosLedger :: StagedMockChain [(TxOutRef, TxOut)]
-allUtxosLedger=MockChainBuiltin [(TxOutRef, TxOut)]
+
+instanceMonadBlockChainWithoutValidationStagedMockChainwhere
+allUtxosLedger :: StagedMockChain [(TxOutRef, TxOut)]
+allUtxosLedger=MockChainBuiltin [(TxOutRef, TxOut)]
-> StagedMockChain [(TxOutRef, TxOut)]
forall (builtin :: * -> *) a modification.
builtin a -> Staged (LtlOp modification builtin) a
singletonBuiltinMockChainBuiltin [(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
singletonBuiltinMockChainBuiltin 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
-
-instanceMonadBlockChainStagedMockChainwhere
-validateTxSkel :: TxSkel -> StagedMockChain CardanoTx
-validateTxSkel=MockChainBuiltin CardanoTx -> StagedMockChain CardanoTx
+
+instanceMonadBlockChainStagedMockChainwhere
+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
+