Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data GenerateTxError
- type TxGen context a = ReaderT context (Either GenerateTxError) a
- class Transform a b where
- transform :: a -> b
- throwOnLookup :: Ord k => String -> k -> Map k a -> TxGen context a
- throwOnString :: String -> TxGen context a
- throwOnToCardanoErrorOrApply :: String -> (a -> b) -> Either ToCardanoError a -> TxGen context b
- throwOnToCardanoError :: String -> Either ToCardanoError a -> TxGen context a
- liftTxGen :: Transform context' context => TxGen context a -> TxGen context' a
Documentation
data GenerateTxError Source #
Errors that can arise during transaction generation
Instances
Show GenerateTxError Source # | |
Defined in Cooked.MockChain.GenerateTx.Common showsPrec :: Int -> GenerateTxError -> ShowS # show :: GenerateTxError -> String # showList :: [GenerateTxError] -> ShowS # | |
Eq GenerateTxError Source # | |
Defined in Cooked.MockChain.GenerateTx.Common (==) :: GenerateTxError -> GenerateTxError -> Bool # (/=) :: GenerateTxError -> GenerateTxError -> Bool # |
type TxGen context a = ReaderT context (Either GenerateTxError) a Source #
The domain in which transaction parts are generated.
class Transform a b where Source #
Instances
Transform TxContext NetworkId Source # | |
Transform TxContext CollateralContext Source # | |
Defined in Cooked.MockChain.GenerateTx.Body | |
Transform TxContext InputContext Source # | |
Defined in Cooked.MockChain.GenerateTx.Body transform :: TxContext -> InputContext Source # | |
Transform TxContext WithdrawalsContext Source # | |
Defined in Cooked.MockChain.GenerateTx.Body | |
Transform TxContext (Map TxOutRef TxOut) Source # | |
Transform TxContext (PParams, Map TxOutRef TxOut) Source # | |
Transform InputContext (Map TxOutRef TxOut) Source # | |
Defined in Cooked.MockChain.GenerateTx.Input | |
Transform WithdrawalsContext (Map TxOutRef TxOut) Source # | |
Defined in Cooked.MockChain.GenerateTx.Withdrawals | |
Transform (a, b) a Source # | |
Defined in Cooked.MockChain.GenerateTx.Common | |
Transform (a, b) b Source # | |
Defined in Cooked.MockChain.GenerateTx.Common |
throwOnLookup :: Ord k => String -> k -> Map k a -> TxGen context a Source #
Looks up a key in a map. Throws a GenerateTxErrorGeneral
error with a given
message when the key is absent, returns the associated value otherwise.
throwOnString :: String -> TxGen context a Source #
Throws a general error from a String.
throwOnToCardanoErrorOrApply :: String -> (a -> b) -> Either ToCardanoError a -> TxGen context b Source #
Lifts a ToCardanoError
with an associated error message, or apply a
function if a value exists.
throwOnToCardanoError :: String -> Either ToCardanoError a -> TxGen context a Source #
Lifts a ToCardanoError
with an associated error message, or leaves the
value unchanged if it exists.