ScenarioExplorer

scalus.testing.ScenarioExplorer

Explores contract state space by applying actions at each step.

ScenarioExplorer performs bounded exploration of contract interactions. At each depth it:

  1. Gets a snapshot reader
  2. Calls the step function which performs one interaction using normal Scenario operations
  3. Actions (Scenario.submit, Scenario.sleep) are automatically logged
  4. On successful step, recurses to next depth
  5. On check failure, captures violation with the full action path
  6. On other errors, propagates

The step function can use Scenario.choices/Scenario.fromCollection for branching, Scenario.submit for transactions, Scenario.sleep for time advancement, and Scenario.check for invariant verification.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def explore(maxDepth: Int)(step: BlockchainReader => Scenario[Unit]): Scenario[Option[Violation]]

Explore contract interactions up to a maximum depth.

Explore contract interactions up to a maximum depth.

Value parameters

maxDepth

maximum number of steps to explore

step

function that performs one interaction step using normal Scenario operations

Attributes

Returns

Scenario returning None if all paths succeeded, Some(Violation) if a check failed