cooked-validators-4.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.MockChain.GenerateTx.Common

Synopsis

Documentation

type TxGen context a = ReaderT context (Either GenerateTxError) a Source #

The domain in which transaction parts are generated.

class Transform a b where Source #

Methods

transform :: a -> b Source #

Instances

Instances details
Transform TxContext NetworkId Source # 
Instance details

Defined in Cooked.MockChain.GenerateTx.Body

Transform TxContext CollateralContext Source # 
Instance details

Defined in Cooked.MockChain.GenerateTx.Body

Transform TxContext InputContext Source # 
Instance details

Defined in Cooked.MockChain.GenerateTx.Body

Transform TxContext WithdrawalsContext Source # 
Instance details

Defined in Cooked.MockChain.GenerateTx.Body

Transform TxContext (Map TxOutRef TxOut) Source # 
Instance details

Defined in Cooked.MockChain.GenerateTx.Body

Transform TxContext (PParams, Map TxOutRef TxOut) Source # 
Instance details

Defined in Cooked.MockChain.GenerateTx.Body

Transform InputContext (Map TxOutRef TxOut) Source # 
Instance details

Defined in Cooked.MockChain.GenerateTx.Input

Transform WithdrawalsContext (Map TxOutRef TxOut) Source # 
Instance details

Defined in Cooked.MockChain.GenerateTx.Withdrawals

Transform (a, b) a Source # 
Instance details

Defined in Cooked.MockChain.GenerateTx.Common

Methods

transform :: (a, b) -> a Source #

Transform (a, b) b Source # 
Instance details

Defined in Cooked.MockChain.GenerateTx.Common

Methods

transform :: (a, b) -> b Source #

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.

liftTxGen :: Transform context' context => TxGen context a -> TxGen context' a Source #

Lifts a computation from a smaller context