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

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

val ledgerInterpreter: TestLedgerDSLInterpreter

services

val services: ServicesForResolution

transactionBuilder

val transactionBuilder: TransactionBuilder

Functions

_attachment

Attaches an attachment containing the named contract to the transaction

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

_tweak

Creates a local scoped copy of the transaction.

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

attachment

Adds an Attachment reference to the transaction.

fun attachment(attachmentId: SecureHash): Unit

command

Adds a command to the transaction.

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

input

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

fun input(stateRef: StateRef): Unit

output

Adds an output to the transaction.

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

reference

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

fun reference(stateRef: StateRef): Unit

timeWindow

Sets the time-window of the transaction.

fun timeWindow(data: TimeWindow): Unit

verifies

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

fun verifies(): EnforceVerifyOrFail