TransactionDSL

Underlying class for the transaction DSL. Do not instantiate directly, instead use the transaction function.

Constructors

Link copied to clipboard
constructor(interpreter: T, notary: Party)

Properties

Link copied to clipboard

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

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
fun attachment(contractClassName: ContractClassName)
fun attachment(contractClassName: ContractClassName, attachmentId: AttachmentId)
fun attachment(contractClassName: ContractClassName, attachmentId: AttachmentId, signers: List<PublicKey>, jarManifestAttributes: Map<String, String> = emptyMap())

open override fun attachment(attachmentId: SecureHash)

Adds an Attachment reference to the transaction.

Link copied to clipboard
fun attachments(vararg contractClassNames: ContractClassName): <Error class: unknown class>
Link copied to clipboard
fun command(signer: PublicKey, commandData: CommandData): <Error class: unknown class>
open override fun command(signers: List<PublicKey>, commandData: CommandData)

Adds a command to the transaction.

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

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

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

Asserts that verifies() throws.

Link copied to clipboard
fun input(stateLabel: String): <Error class: unknown class>

Looks up the output label and adds the found state as an input.

fun input(contractClassName: ContractClassName, stateLabel: String)

fun input(contractClassName: ContractClassName, state: ContractState)

Creates an LedgerDSLInterpreter._unverifiedTransaction with a single output state and adds its reference as an input to the current transaction.

open override fun input(stateRef: StateRef)

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

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

Adds an output to the transaction.

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

Adds a labelled output to the transaction.

Link copied to clipboard
fun reference(stateLabel: String): <Error class: unknown class>

Looks up the output label and adds the found state as an reference input state.

fun reference(contractClassName: ContractClassName, state: ContractState)

Creates an LedgerDSLInterpreter._unverifiedTransaction with a single reference input state and adds its reference as in input to the current transaction.

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
fun timeWindow(time: Instant, tolerance: Duration = 30.seconds)

Sets the TimeWindow of the transaction.

open override fun timeWindow(data: TimeWindow)

Sets the time-window of the transaction.

Link copied to clipboard

Creates a local scoped copy of the transaction.

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

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