StateModuleExecutor

org.sigilaris.core.application.execution.StateModuleExecutor

Facade for executing transactions against a mounted org.sigilaris.core.application.module.runtime.StateModule.

Typical usage previously required threading through StateT.run and EitherT.value, which is verbose and obscures intent. This helper wraps the pattern and offers both Eff and plain F results.

Attributes

Source
StateModuleExecutor.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def run[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple, Txs <: Tuple, T <: Tx](initial: StoreState, signedTx: Signed[T])(using module: PlainModule[F, Path, Owns, Needs, Txs], monadErrorF: MonadError[F, SigilarisFailure], readsReq: Requires[signedTx.value.Reads, Concat[Owns, Needs]], writesReq: Requires[signedTx.value.Writes, Concat[Owns, Needs]]): Eff[F][(StoreState, (signedTx.value.Result, List[signedTx.value.Event]))]

Legacy tuple wrapper over runWithModule using an implicit module.

Legacy tuple wrapper over runWithModule using an implicit module.

Attributes

Source
StateModuleExecutor.scala
def runExecution[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple, Txs <: Tuple, T <: Tx](initial: StoreState, signedTx: Signed[T])(using module: PlainModule[F, Path, Owns, Needs, Txs], monadErrorF: MonadError[F, SigilarisFailure], readsReq: Requires[signedTx.value.Reads, Concat[Owns, Needs]], writesReq: Requires[signedTx.value.Writes, Concat[Owns, Needs]]): Eff[F][TxExecution[signedTx.value.Result, signedTx.value.Event]]

Executes a transaction using an implicit module and returns the execution witness.

Executes a transaction using an implicit module and returns the execution witness.

Attributes

Source
StateModuleExecutor.scala
def runExecutionFromEmpty[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple, Txs <: Tuple, T <: Tx](signedTx: Signed[T])(using module: PlainModule[F, Path, Owns, Needs, Txs], monadErrorF: MonadError[F, SigilarisFailure], readsReq: Requires[signedTx.value.Reads, Concat[Owns, Needs]], writesReq: Requires[signedTx.value.Writes, Concat[Owns, Needs]]): Eff[F][TxExecution[signedTx.value.Result, signedTx.value.Event]]

Runs from empty state using an implicit module and returns the execution witness.

Runs from empty state using an implicit module and returns the execution witness.

Attributes

Source
StateModuleExecutor.scala
def runExecutionFromEmptyWithModule[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple, Txs <: Tuple, T <: Tx](signedTx: Signed[T], module: PlainModule[F, Path, Owns, Needs, Txs])(using monadErrorF: MonadError[F, SigilarisFailure], readsReq: Requires[signedTx.value.Reads, Concat[Owns, Needs]], writesReq: Requires[signedTx.value.Writes, Concat[Owns, Needs]]): Eff[F][TxExecution[signedTx.value.Result, signedTx.value.Event]]

Runs from empty state with an explicit module and returns the execution witness.

Runs from empty state with an explicit module and returns the execution witness.

Attributes

Source
StateModuleExecutor.scala
def runExecutionRouted[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple, Txs <: Tuple, T <: Tx & ModuleRoutedTx](initial: StoreState, signedTx: Signed[T])(using module: RoutedModule[F, Path, Owns, Needs, Txs], monadErrorF: MonadError[F, SigilarisFailure], readsReq: Requires[signedTx.value.Reads, Concat[Owns, Needs]], writesReq: Requires[signedTx.value.Writes, Concat[Owns, Needs]]): Eff[F][TxExecution[signedTx.value.Result, signedTx.value.Event]]

Executes a routed transaction using an implicit module and returns the execution witness.

Executes a routed transaction using an implicit module and returns the execution witness.

Attributes

Source
StateModuleExecutor.scala
def runExecutionRoutedWithModule[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple, Txs <: Tuple, T <: Tx & ModuleRoutedTx](initial: StoreState, signedTx: Signed[T], module: RoutedModule[F, Path, Owns, Needs, Txs])(using monadErrorF: MonadError[F, SigilarisFailure], readsReq: Requires[signedTx.value.Reads, Concat[Owns, Needs]], writesReq: Requires[signedTx.value.Writes, Concat[Owns, Needs]]): Eff[F][TxExecution[signedTx.value.Result, signedTx.value.Event]]

Executes a routed transaction with a fresh access log and returns the per-transaction execution witness.

Executes a routed transaction with a fresh access log and returns the per-transaction execution witness.

Attributes

Source
StateModuleExecutor.scala
def runExecutionWithModule[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple, Txs <: Tuple, T <: Tx](initial: StoreState, signedTx: Signed[T], module: PlainModule[F, Path, Owns, Needs, Txs])(using monadErrorF: MonadError[F, SigilarisFailure], readsReq: Requires[signedTx.value.Reads, Concat[Owns, Needs]], writesReq: Requires[signedTx.value.Writes, Concat[Owns, Needs]]): Eff[F][TxExecution[signedTx.value.Result, signedTx.value.Event]]

Executes one transaction with a fresh access log over the current trie state and returns the per-transaction execution witness.

Executes one transaction with a fresh access log over the current trie state and returns the per-transaction execution witness.

Attributes

Source
StateModuleExecutor.scala
def runFromEmpty[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple, Txs <: Tuple, T <: Tx](signedTx: Signed[T])(using module: PlainModule[F, Path, Owns, Needs, Txs], monadErrorF: MonadError[F, SigilarisFailure], readsReq: Requires[signedTx.value.Reads, Concat[Owns, Needs]], writesReq: Requires[signedTx.value.Writes, Concat[Owns, Needs]]): Eff[F][(StoreState, (signedTx.value.Result, List[signedTx.value.Event]))]

Runs from empty state using an implicit module in scope.

Runs from empty state using an implicit module in scope.

Attributes

Source
StateModuleExecutor.scala
def runFromEmptyWithModule[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple, Txs <: Tuple, T <: Tx](signedTx: Signed[T], module: PlainModule[F, Path, Owns, Needs, Txs])(using monadErrorF: MonadError[F, SigilarisFailure], readsReq: Requires[signedTx.value.Reads, Concat[Owns, Needs]], writesReq: Requires[signedTx.value.Writes, Concat[Owns, Needs]]): Eff[F][(StoreState, (signedTx.value.Result, List[signedTx.value.Event]))]

Runs from org.sigilaris.core.application.state.StoreState.empty for common testing scenarios.

Runs from org.sigilaris.core.application.state.StoreState.empty for common testing scenarios.

Attributes

Source
StateModuleExecutor.scala
def runRouted[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple, Txs <: Tuple, T <: Tx & ModuleRoutedTx](initial: StoreState, signedTx: Signed[T])(using module: RoutedModule[F, Path, Owns, Needs, Txs], monadErrorF: MonadError[F, SigilarisFailure], readsReq: Requires[signedTx.value.Reads, Concat[Owns, Needs]], writesReq: Requires[signedTx.value.Writes, Concat[Owns, Needs]]): Eff[F][(StoreState, (signedTx.value.Result, List[signedTx.value.Event]))]

Legacy tuple wrapper over runRoutedWithModule using an implicit module.

Legacy tuple wrapper over runRoutedWithModule using an implicit module.

Attributes

Source
StateModuleExecutor.scala
def runRoutedWithModule[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple, Txs <: Tuple, T <: Tx & ModuleRoutedTx](initial: StoreState, signedTx: Signed[T], module: RoutedModule[F, Path, Owns, Needs, Txs])(using monadErrorF: MonadError[F, SigilarisFailure], readsReq: Requires[signedTx.value.Reads, Concat[Owns, Needs]], writesReq: Requires[signedTx.value.Writes, Concat[Owns, Needs]]): Eff[F][(StoreState, (signedTx.value.Result, List[signedTx.value.Event]))]

Legacy tuple wrapper for routed execution against a composed module.

Legacy tuple wrapper for routed execution against a composed module.

Attributes

Source
StateModuleExecutor.scala
def runValue[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple, Txs <: Tuple, T <: Tx](initial: StoreState, signedTx: Signed[T])(using module: PlainModule[F, Path, Owns, Needs, Txs], monadErrorF: MonadError[F, SigilarisFailure], readsReq: Requires[signedTx.value.Reads, Concat[Owns, Needs]], writesReq: Requires[signedTx.value.Writes, Concat[Owns, Needs]]): F[Either[SigilarisFailure, (StoreState, (signedTx.value.Result, List[signedTx.value.Event]))]]

Convenience to obtain the plain F result using an implicit module.

Convenience to obtain the plain F result using an implicit module.

Attributes

Source
StateModuleExecutor.scala
def runValueWithModule[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple, Txs <: Tuple, T <: Tx](initial: StoreState, signedTx: Signed[T], module: PlainModule[F, Path, Owns, Needs, Txs])(using monadErrorF: MonadError[F, SigilarisFailure], readsReq: Requires[signedTx.value.Reads, Concat[Owns, Needs]], writesReq: Requires[signedTx.value.Writes, Concat[Owns, Needs]]): F[Either[SigilarisFailure, (StoreState, (signedTx.value.Result, List[signedTx.value.Event]))]]

Convenience to obtain the plain F result for the legacy tuple wrapper.

Convenience to obtain the plain F result for the legacy tuple wrapper.

Attributes

Source
StateModuleExecutor.scala
def runWithModule[F[_], Path <: Tuple, Owns <: Tuple, Needs <: Tuple, Txs <: Tuple, T <: Tx](initial: StoreState, signedTx: Signed[T], module: PlainModule[F, Path, Owns, Needs, Txs])(using monadErrorF: MonadError[F, SigilarisFailure], readsReq: Requires[signedTx.value.Reads, Concat[Owns, Needs]], writesReq: Requires[signedTx.value.Writes, Concat[Owns, Needs]]): Eff[F][(StoreState, (signedTx.value.Result, List[signedTx.value.Event]))]

Executes a signed transaction against the supplied module.

Executes a signed transaction against the supplied module.

Attributes

Source
StateModuleExecutor.scala