TestTransactionDSLInterpreter

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

Link copied to clipboard
constructor(ledgerInterpreter: TestLedgerDSLInterpreter, transactionBuilder: TransactionBuilder)

Properties

Link copied to clipboard

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

Link copied to clipboard

Functions

Link copied to clipboard
open override fun _attachment(contractClassName: ContractClassName)
open override fun _attachment(contractClassName: ContractClassName, attachmentId: AttachmentId, signers: List<PublicKey>)

Attaches an attachment containing the named contract to the transaction

open override fun _attachment(contractClassName: ContractClassName, attachmentId: AttachmentId, signers: List<PublicKey>, jarManifestAttributes: Map<String, String>)

Attaches an attachment containing the named contract to the transaction.

Link copied to clipboard

Creates a local scoped copy of the transaction.

Link copied to clipboard
open override fun attachment(attachmentId: SecureHash)

Adds an Attachment reference to the transaction.

Link copied to clipboard
open override fun command(signers: List<PublicKey>, commandData: CommandData)

Adds a command to the transaction.

Link copied to clipboard

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

Link copied to clipboard
open infix fun fails with(msg: String): EnforceVerifyOrFail
Link copied to clipboard
open fun failsWith(expectedMessage: String?): EnforceVerifyOrFail

Asserts that verifies() throws.

Link copied to clipboard
open override fun input(stateRef: StateRef)

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

Link copied to clipboard
open override fun output(contractClassName: ContractClassName, label: String?, notary: Party, encumbrance: Int?, attachmentConstraint: AttachmentConstraint, contractState: ContractState)

Adds an output to the transaction.

Link copied to clipboard
open override fun reference(stateRef: StateRef)

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

Link copied to clipboard
open override fun <S : ContractState> retrieveOutputStateAndRef(clazz: Class<S>, label: String): StateAndRef<S>

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

Link copied to clipboard
open override fun timeWindow(data: TimeWindow)

Sets the time-window of the transaction.

Link copied to clipboard
open override fun verifies(): EnforceVerifyOrFail

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