Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Cooked.Tweak.Outputs
Synopsis
- ensureOutputTweak :: MonadTweak m => TxSkelOut -> m (Maybe TxSkelOut)
- addOutputTweak :: MonadTweak m => TxSkelOut -> m ()
- removeOutputTweak :: MonadTweak m => (TxSkelOut -> Bool) -> m [TxSkelOut]
- tamperDatumTweak :: forall a m. (MonadTweak m, FromData a, Typeable a) => (a -> Maybe a) -> m [a]
- data TamperDatumLbl = TamperDatumLbl
- malformDatumTweak :: forall a m. (MonadTweak m, Typeable a) => (a -> [BuiltinData]) -> m ()
- data MalformDatumLbl = MalformDatumLbl
Documentation
ensureOutputTweak :: MonadTweak m => TxSkelOut -> m (Maybe TxSkelOut) Source #
Ensures that a certain output is produced by a transaction. The return
value will be Just
the added output, when applicable.
addOutputTweak :: MonadTweak m => TxSkelOut -> m () Source #
Adds a transaction output, at the end of the current list of outputs, thus retaining the initial outputs order.
removeOutputTweak :: MonadTweak m => (TxSkelOut -> Bool) -> m [TxSkelOut] Source #
Removes transaction outputs according to some predicate. The returned list contains all the removed outputs.
tamperDatumTweak :: forall a m. (MonadTweak m, FromData a, Typeable a) => (a -> Maybe a) -> m [a] Source #
A tweak that tries to change the datum on outputs carrying datums of a
certain type with a prescribed tampering function. The tampering function
ignores datums of other types and those for which it returns Nothing
.
The tweak returns a list of the modified datums, as they were *before* the modification was applied to them.
data TamperDatumLbl Source #
A label added to a TxSkel
on which the tamperDatumTweak
has been
successfully applied
Constructors
TamperDatumLbl |
Instances
Show TamperDatumLbl Source # | |
Defined in Cooked.Tweak.Outputs Methods showsPrec :: Int -> TamperDatumLbl -> ShowS # show :: TamperDatumLbl -> String # showList :: [TamperDatumLbl] -> ShowS # | |
PrettyCooked TamperDatumLbl Source # | |
Defined in Cooked.Tweak.Outputs Methods prettyCooked :: TamperDatumLbl -> DocCooked Source # prettyCookedOpt :: PrettyCookedOpts -> TamperDatumLbl -> DocCooked Source # | |
Eq TamperDatumLbl Source # | |
Defined in Cooked.Tweak.Outputs Methods (==) :: TamperDatumLbl -> TamperDatumLbl -> Bool # (/=) :: TamperDatumLbl -> TamperDatumLbl -> Bool # | |
Ord TamperDatumLbl Source # | |
Defined in Cooked.Tweak.Outputs Methods compare :: TamperDatumLbl -> TamperDatumLbl -> Ordering # (<) :: TamperDatumLbl -> TamperDatumLbl -> Bool # (<=) :: TamperDatumLbl -> TamperDatumLbl -> Bool # (>) :: TamperDatumLbl -> TamperDatumLbl -> Bool # (>=) :: TamperDatumLbl -> TamperDatumLbl -> Bool # max :: TamperDatumLbl -> TamperDatumLbl -> TamperDatumLbl # min :: TamperDatumLbl -> TamperDatumLbl -> TamperDatumLbl # |
malformDatumTweak :: forall a m. (MonadTweak m, Typeable a) => (a -> [BuiltinData]) -> m () Source #
A tweak that tries to change the datum on outputs carrying datums of a
certain type with a prescribed tampering function. There are two main
differences with tamperDatumTweak
. First, the tampering function returns
BuiltinData
, allowing it to do pretty much anything with the
datums. Second, for every output datum there are zero or more options for how
to modify it, and all combinations of these modifications are tried.
That is, if there are n
output datums, for which there are k_1,...,k_n
possible modifications, this tweak will try
k_1 + ... + k_n + k_1 * k_2 + ... + k_{n-1} * k_n + k_1 * k_2 * k_3 + ... + k_{n-2} * k_{n-1} * k_n + ... + k_1 * k_2 * ... * k_{n-1} * k_n == (k_1 + 1) * ... * (k_n + 1) - 1
modified transactions.
data MalformDatumLbl Source #
A label added to a TxSkel
on which the malformDatumTweak
has been
successfully applied
Constructors
MalformDatumLbl |