Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- type ActionM a = ExceptT Error (RWST IOManager () Env IO) a
- data Error where
- TxGenError :: !TxGenError -> Error
- UserError :: !String -> Error
- WalletError :: !String -> Error
- runActionM :: ActionM ret -> IOManager -> IO (Either Error ret, Env, ())
- runActionMEnv :: Env -> ActionM ret -> IOManager -> IO (Either Error ret, Env, ())
- liftTxGenError :: TxGenError -> ActionM a
- liftIOSafe :: IO (Either TxGenError a) -> ActionM a
- askIOManager :: ActionM IOManager
- traceDebug :: String -> ActionM ()
- traceError :: String -> ActionM ()
- traceBenchTxSubmit :: (forall txId. x -> TraceBenchTxSubmit txId) -> x -> ActionM ()
- getBenchTracers :: ActionM BenchTracers
- setBenchTracers :: BenchTracers -> ActionM ()
- getEnvGenesis :: ActionM (ShelleyGenesis StandardCrypto)
- setEnvGenesis :: ShelleyGenesis StandardCrypto -> ActionM ()
- getEnvKeys :: String -> ActionM (SigningKey PaymentKey)
- setEnvKeys :: String -> SigningKey PaymentKey -> ActionM ()
- getEnvNetworkId :: ActionM NetworkId
- setEnvNetworkId :: NetworkId -> ActionM ()
- getEnvProtocol :: ActionM SomeConsensusProtocol
- setEnvProtocol :: SomeConsensusProtocol -> ActionM ()
- getProtoParamMode :: ActionM ProtocolParameterMode
- setProtoParamMode :: ProtocolParameterMode -> ActionM ()
- getEnvSocketPath :: ActionM SocketPath
- setEnvSocketPath :: FilePath -> ActionM ()
- getEnvThreads :: String -> ActionM AsyncBenchmarkControl
- setEnvThreads :: String -> AsyncBenchmarkControl -> ActionM ()
- getEnvWallets :: String -> ActionM WalletRef
- setEnvWallets :: String -> WalletRef -> ActionM ()
- getEnvSummary :: ActionM (Maybe PlutusBudgetSummary)
- setEnvSummary :: PlutusBudgetSummary -> ActionM ()
Documentation
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.
TxGenError :: !TxGenError -> Error | |
UserError :: !String -> Error | |
WalletError :: !String -> Error |
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 #
liftIOSafe :: IO (Either TxGenError a) -> ActionM a Source #
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
.
getEnvSummary :: ActionM (Maybe PlutusBudgetSummary) Source #
Read accessor for envSummary
.
setEnvSummary :: PlutusBudgetSummary -> ActionM () Source #
Write accessor for envSummary
.