ImmutableEmulator

scalus.testing.ImmutableEmulator
See theImmutableEmulator companion object
case class ImmutableEmulator(state: State, env: UtxoEnv, slotConfig: SlotConfig = ..., evaluatorMode: EvaluatorMode = ..., validators: Iterable[Validator] = ..., mutators: Iterable[Mutator] = ...)

An immutable emulator for Cardano transactions.

Unlike Emulator, this emulator is fully immutable: every state-changing operation (submit, advanceSlot) returns a new ImmutableEmulator instance, leaving the original unchanged.

This makes it suitable for use in functional state-threading patterns such as the Scenario monad, where branching and backtracking require independent state copies.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Advance the slot by the given number of slots.

Advance the slot by the given number of slots.

Attributes

Create a read-only BlockchainReader snapshot.

Create a read-only BlockchainReader snapshot.

This provides read-only access to the emulator's state without submit capability.

Attributes

Current CardanoInfo snapshot.

Current CardanoInfo snapshot.

Attributes

Current slot number.

Current slot number.

Attributes

def findUtxos(query: UtxoQuery): Either[UtxoQueryError, Utxos]

Find UTxOs matching the given query.

Find UTxOs matching the given query.

Attributes

Current protocol parameters.

Current protocol parameters.

Attributes

Set the slot to a specific value.

Set the slot to a specific value.

Attributes

Submit a transaction, returning the transaction hash and a new emulator with updated state.

Submit a transaction, returning the transaction hash and a new emulator with updated state.

The original emulator is not modified.

Attributes

Convert to a mutable Emulator.

Convert to a mutable Emulator.

Attributes

def utxos: Utxos

Current UTxO set.

Current UTxO set.

Attributes

Deprecated methods

Create a BlockchainProvider snapshot.

Create a BlockchainProvider snapshot.

Submit through this provider works but discards the resulting state changes (the provider cannot update the immutable emulator).

Attributes

Deprecated
[Since version 0.14.2] Use asReader instead

Use asReader instead for read-only access. The submit method on this provider discards state changes which is misleading.

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product