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: TransactionBuilder)

Properties

ledgerInterpreter

val ledgerInterpreter: TestLedgerDSLInterpreter

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

services

val services: ServicesForResolution

transactionBuilder

val transactionBuilder: TransactionBuilder

Functions

_attachment

fun _attachment(contractClassName: ContractClassName): Unit
fun _attachment(contractClassName: ContractClassName, attachmentId: AttachmentId, signers: List<PublicKey>): Unit

Attaches an attachment containing the named contract to the transaction

fun _attachment(contractClassName: ContractClassName, attachmentId: AttachmentId, 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: SecureHash): Unit

Adds an Attachment reference to the transaction.

command

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

Adds a command to the transaction.

input

fun input(stateRef: StateRef): Unit

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

output

fun output(contractClassName: ContractClassName, label: String?, notary: Party, encumbrance: Int?, attachmentConstraint: AttachmentConstraint, contractState: ContractState): Unit

Adds an output to the transaction.

reference

fun reference(stateRef: StateRef): Unit

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

timeWindow

fun timeWindow(data: TimeWindow): Unit

Sets the time-window of the transaction.

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.