corda / net.corda.testing.dsl / TestTransactionDSLInterpreter

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.

Constructors

<init>

TestTransactionDSLInterpreter(ledgerInterpreter: TestLedgerDSLInterpreter, transactionBuilder: <ERROR CLASS>)

Properties

ledgerInterpreter

val ledgerInterpreter: TestLedgerDSLInterpreter

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

services

val services: <ERROR CLASS>

transactionBuilder

val transactionBuilder: <ERROR CLASS>

Functions

_attachment

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

Attaches an attachment containing the named contract to the transaction

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

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

Creates a local scoped copy of the transaction.

attachment

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

Adds an Attachment reference to the transaction.

command

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

Adds a command to the transaction.

input

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

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

output

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

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

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

timeWindow

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

Sets the time-window of the transaction.

verifies

fun verifies(): EnforceVerifyOrFail

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