EmulatorBase

scalus.cardano.node.EmulatorBase
See theEmulatorBase companion trait
object EmulatorBase

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def certStateWithRegisteredCredentials(initialStakeRewards: Map[Credential, Coin], context: Context): CertState

Builds a scalus.cardano.ledger.CertState with the given stake credentials pre-registered.

Builds a scalus.cardano.ledger.CertState with the given stake credentials pre-registered.

Each credential is inserted into deposits (using the protocol parameter deposit amount) and rewards with the provided balance, so the ledger treats them as registered stake addresses without requiring an explicit registration transaction.

Value parameters

context

the emulator context (used to read the key deposit amount from protocol params)

initialStakeRewards

map from stake credential to its initial reward balance

Attributes

def createInitialUtxos(addresses: Seq[Address]): Utxos

Creates initial UTxOs for the given addresses, 10,000 ADA each (like Yaci Devkit).

Creates initial UTxOs for the given addresses, 10,000 ADA each (like Yaci Devkit).

Attributes

def createInitialUtxos(addresses: Seq[Address], initialValue: Value): Utxos

Creates initial UTxOs for the given addresses.

Creates initial UTxOs for the given addresses.

Value parameters

addresses

The addresses to initialize with funds

initialValue

Initial value per address

Attributes

Returns

A map of transaction inputs to outputs

def evalQuery(utxos: Utxos, query: UtxoQuery): Utxos

Evaluate a UTxO query against a UTxO set.

Evaluate a UTxO query against a UTxO set.

This is the pure, static query evaluation logic shared by both the mutable Emulator and the immutable scalus.testing.ImmutableEmulator (defined in the scalus-testkit module).

Attributes

def extractDatums(transaction: Transaction): Map[DataHash, Data]
def indexAppliedTxs(log: Iterable[AppliedTx]): Map[TransactionHash, AppliedTx]

Build the by-hash index for an applied-tx log — the single place this derivation lives, so an emulator's index and its log cannot drift apart.

Build the by-hash index for an applied-tx log — the single place this derivation lives, so an emulator's index and its log cannot drift apart.

Attributes

def resolveSpent(utxos: Utxos, transaction: Transaction): Utxos

Resolve the inputs a transaction consumes against a UTxO set.

Resolve the inputs a transaction consumes against a UTxO set.

Returns the subset of utxos whose inputs appear in transaction's input set — i.e. the UTxOs that applying the transaction will remove. Intended to be evaluated against the pre-application snapshot so the consumed values can be retained in AppliedTx.

Attributes