corda / net.corda.testing.dsl / TestLedgerDSLInterpreter

TestLedgerDSLInterpreter

data class TestLedgerDSLInterpreter : LedgerDSLInterpreter<TestTransactionDSLInterpreter>

Exceptions

TypeMismatch

class TypeMismatch : Exception

VerifiesFailed

class VerifiesFailed : Exception

Constructors

<init>

TestLedgerDSLInterpreter(services: ServiceHub)

Properties

services

val services: ServiceHub

transactionsToVerify

val transactionsToVerify: List<WireTransaction>

transactionsUnverified

val transactionsUnverified: List<WireTransaction>

wireTransactions

val wireTransactions: List<WireTransaction>

Functions

_transaction

fun _transaction(transactionLabel: String?, transactionBuilder: TransactionBuilder, dsl: TestTransactionDSLInterpreter.() -> EnforceVerifyOrFail): WireTransaction

Creates and adds a transaction to the ledger.

_tweak

fun _tweak(dsl: LedgerDSLInterpreter<TestTransactionDSLInterpreter>.() -> Unit): Unit

Creates a local scoped copy of the ledger.

_unverifiedTransaction

fun _unverifiedTransaction(transactionLabel: String?, transactionBuilder: TransactionBuilder, dsl: TestTransactionDSLInterpreter.() -> Unit): WireTransaction

Creates and adds a transaction to the ledger that will not be verified by verifies.

attachment

fun attachment(attachment: InputStream): SecureHash

Adds an attachment to the ledger.

outputToLabel

fun outputToLabel(state: ContractState): String?

retrieveOutputStateAndRef

fun <S : ContractState> retrieveOutputStateAndRef(clazz: Class<S>, label: String): StateAndRef<S>

Retrieves an output previously defined by TransactionDSLInterpreter.output with a label passed in.

transactionName

fun transactionName(transactionHash: SecureHash): String?

verifies

fun verifies(): EnforceVerifyOrFail

Verifies the ledger/transaction, throws if the verification fails.

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.