corda / net.corda.testing.dsl / TransactionDSLInterpreter

TransactionDSLInterpreter

interface TransactionDSLInterpreter : Verifies, OutputStateLookup

This interface defines the bare bone functionality that a Transaction DSL interpreter should implement.

Parameters

Properties

ledgerInterpreter

abstract val ledgerInterpreter: LedgerDSLInterpreter<TransactionDSLInterpreter>

A reference to the enclosing ledger{..}'s interpreter.

Functions

_attachment

abstract fun _attachment(contractClassName: <ERROR CLASS>): Unit
abstract fun _attachment(contractClassName: <ERROR CLASS>, attachmentId: <ERROR CLASS>, signers: List<PublicKey>): Unit

Attaches an attachment containing the named contract to the transaction

abstract fun _attachment(contractClassName: <ERROR CLASS>, attachmentId: <ERROR CLASS>, signers: List<PublicKey>, jarManifestAttributes: Map<String, String>): Unit

Attaches an attachment containing the named contract to the transaction.

_tweak

abstract fun _tweak(dsl: TransactionDSLInterpreter.() -> EnforceVerifyOrFail): EnforceVerifyOrFail

Creates a local scoped copy of the transaction.

attachment

abstract fun attachment(attachmentId: <ERROR CLASS>): Unit

Adds an Attachment reference to the transaction.

command

abstract fun command(signers: List<PublicKey>, commandData: <ERROR CLASS>): Unit

Adds a command to the transaction.

input

abstract fun input(stateRef: <ERROR CLASS>): Unit

Adds an input reference to the transaction. Note that verifies will resolve this reference.

output

abstract fun output(contractClassName: <ERROR CLASS>, label: String?, notary: <ERROR CLASS>, encumbrance: Int?, attachmentConstraint: <ERROR CLASS>, contractState: <ERROR CLASS>): Unit

Adds an output to the transaction.

reference

abstract fun reference(stateRef: <ERROR CLASS>): Unit

Add a reference input state to the transaction. Note that verifies will resolve this reference.

timeWindow

abstract fun timeWindow(data: <ERROR CLASS>): Unit

Sets the time-window of the transaction.

Inherited Functions

fails

open fun fails(): EnforceVerifyOrFail

Asserts that verifies throws, with no condition on the exception message.

fails with

open infix fun fails with(msg: String): EnforceVerifyOrFail

failsWith

open fun failsWith(expectedMessage: String?): EnforceVerifyOrFail

Asserts that verifies() throws.

retrieveOutputStateAndRef

abstract fun <S> retrieveOutputStateAndRef(clazz: Class<S>, label: String): <ERROR CLASS><S>

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

verifies

abstract fun verifies(): EnforceVerifyOrFail

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

Inheritors

TestTransactionDSLInterpreter

data class TestTransactionDSLInterpreter : TransactionDSLInterpreter, OutputStateLookup

This interpreter builds a transaction, and TransactionDSL.verifies that the resolved transaction is correct. Note that transactions corresponding to input states are not verified. Use LedgerDSL.verifies for that.

TransactionDSL

class TransactionDSL<out T : TransactionDSLInterpreter> : TransactionDSLInterpreter

Underlying class for the transaction DSL. Do not instantiate directly, instead use the transaction function.