com.r3corda.core.testing / 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: ServiceHub
transactionBuilder val transactionBuilder: TransactionBuilder

Functions

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

Adds a command to the transaction.

_output fun _output(label: String?, notary: Party, contractState: ContractState): Unit

Adds an output to the transaction.

attachment fun attachment(attachmentId: SecureHash): Unit

Adds an Attachment reference to the transaction.

input fun input(stateRef: StateRef): Unit

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

tweak fun tweak(dsl: TransactionDSL<TransactionDSLInterpreter>.() -> EnforceVerifyOrFail): EnforceVerifyOrFail

Creates a local scoped copy of the transaction.

verifies fun verifies(): EnforceVerifyOrFail

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

Extension Functions

ledger fun TransactionDSLInterpreter.ledger(dsl: LedgerDSL<TestTransactionDSLInterpreter, TestLedgerDSLInterpreter>.() -> Unit): Unit

Here follows implementations of the LedgerDSLInterpreter and TransactionDSLInterpreter interfaces to be used in tests. Top level primitives ledger and transaction that bind the interpreter types are also defined here.

transaction fun TransactionDSLInterpreter.transaction(dsl: TransactionDSL<TransactionDSLInterpreter>.() -> EnforceVerifyOrFail): Unit