tx-generator-2.11: A transaction workload generator for Cardano clusters
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Benchmarking.Script.Env

Description

The Env type is the ADT for the state component of the ActionM monad stack. Its actual definition isn't exported in part because of a transition from an earlier very generic and polymorphic definition. In a number of respects, this module covers more of the ActionM like runActionM and liftTxGenError, but the only significant structure is Env for state. The accessors could likely be removed in favour of just using the record syntax to trim a few lines of code at the cost of exposing the structure's internals. Some of the naming related to the fact that Cardano.Benchmarking.Script.Action ran into circular dependency issues during the above transition.

Synopsis

Documentation

type ActionM a = ExceptT Error (RWST IOManager () Env IO) a Source #

This abbreviates an ExceptT and RWST with particular types used as parameters.

data Error where Source #

Error adds two cases to TxGenError which in turn wraps Error implicit contexts to a couple of its constructors. These represent errors that might arise in the execution of a transaction with some distinctions as to the layers where the errors could arise. At this highest level, invalid users and wallets are potentially encountered. Plutus, protocol, API and some arbitrary errors are potentially encountered at the next layer. The layers correspond to Cardano.Benchmarking.Script.Core for the outermost and Cardano.Benchmarking.Set.Plutus for the middle, and the innermost to Cardano.Api.Error.

Constructors

TxGenError :: !TxGenError -> Error 
UserError :: !String -> Error 
WalletError :: !String -> Error 

Instances

Instances details
Show Error Source # 
Instance details

Defined in Cardano.Benchmarking.Script.Env

runActionM :: ActionM ret -> IOManager -> IO (Either Error ret, Env, ()) Source #

This runs an ActionM starting with an empty Env.

runActionMEnv :: Env -> ActionM ret -> IOManager -> IO (Either Error ret, Env, ()) Source #

This runs an ActionM starting with the Env being passed.

liftTxGenError :: TxGenError -> ActionM a Source #

This throws a Error in the ActionM monad.

liftIOSafe :: IO (Either TxGenError a) -> ActionM a Source #

The safety comes from the invocation of throwE instead of just using the constructor for ExceptT to convert the Either to an ExceptT monadic value.

askIOManager :: ActionM IOManager Source #

Accessor for the IOManager reader monad aspect of the RWST.

traceDebug :: String -> ActionM () Source #

Submit a debug message to the BenchTracers.

traceError :: String -> ActionM () Source #

Submit an error message to the BenchTracers.

traceBenchTxSubmit :: (forall txId. x -> TraceBenchTxSubmit txId) -> x -> ActionM () Source #

Helper to make submissions to the BenchTracers.

getBenchTracers :: ActionM BenchTracers Source #

Read accessor for benchTracers.

setBenchTracers :: BenchTracers -> ActionM () Source #

Write accessor for benchTracers.

getEnvGenesis :: ActionM (ShelleyGenesis StandardCrypto) Source #

Read accessor for envGenesis.

setEnvGenesis :: ShelleyGenesis StandardCrypto -> ActionM () Source #

Write accessor for envGenesis.

getEnvKeys :: String -> ActionM (SigningKey PaymentKey) Source #

Read accessor for envKeys.

setEnvKeys :: String -> SigningKey PaymentKey -> ActionM () Source #

Write accessor for envKeys.

getEnvNetworkId :: ActionM NetworkId Source #

Read accessor for envNetworkId.

setEnvNetworkId :: NetworkId -> ActionM () Source #

Write accessor for envNetworkId.

getEnvProtocol :: ActionM SomeConsensusProtocol Source #

Read accessor for envProtocol.

setEnvProtocol :: SomeConsensusProtocol -> ActionM () Source #

Write accessor for envProtocol.

getProtoParamMode :: ActionM ProtocolParameterMode Source #

Read accessor for protoParams.

setProtoParamMode :: ProtocolParameterMode -> ActionM () Source #

Write accessor for protoParams.

getEnvSocketPath :: ActionM SocketPath Source #

Read accessor for envSocketPath.

setEnvSocketPath :: FilePath -> ActionM () Source #

Write accessor for envSocketPath.

getEnvThreads :: String -> ActionM AsyncBenchmarkControl Source #

Read accessor for envThreads.

setEnvThreads :: String -> AsyncBenchmarkControl -> ActionM () Source #

Write accessor for envThreads.

getEnvWallets :: String -> ActionM WalletRef Source #

Read accessor for envWallets.

setEnvWallets :: String -> WalletRef -> ActionM () Source #

Write accessor for envWallets.

getEnvSummary :: ActionM (Maybe PlutusBudgetSummary) Source #

Read accessor for envSummary.

setEnvSummary :: PlutusBudgetSummary -> ActionM () Source #

Write accessor for envSummary.