corda / net.corda.testing.dsl / TransactionDSL

TransactionDSL

class TransactionDSL<out T : TransactionDSLInterpreter> : TransactionDSLInterpreter

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

Constructors

<init>

TransactionDSL(interpreter: T, notary: <ERROR CLASS>)

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

Functions

attachment

fun attachment(contractClassName: <ERROR CLASS>): Unit
fun attachment(contractClassName: <ERROR CLASS>, attachmentId: <ERROR CLASS>, signers: List<PublicKey>, jarManifestAttributes: Map<String, String> = emptyMap()): Unit
fun attachment(contractClassName: <ERROR CLASS>, attachmentId: <ERROR CLASS>): Unit

attachments

fun attachments(vararg contractClassNames: <ERROR CLASS>): <ERROR CLASS>

command

fun command(signer: PublicKey, commandData: <ERROR CLASS>): <ERROR CLASS>

Adds a command to the transaction.

input

fun input(stateLabel: String): <ERROR CLASS>

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

fun input(contractClassName: <ERROR CLASS>, stateLabel: String): Unitfun input(contractClassName: <ERROR CLASS>, state: <ERROR CLASS>): Unit

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

output

fun output(contractClassName: <ERROR CLASS>, label: String, notary: <ERROR CLASS>, contractState: <ERROR CLASS>): Unit
fun output(contractClassName: <ERROR CLASS>, label: String, encumbrance: Int, contractState: <ERROR CLASS>): Unit
fun output(contractClassName: <ERROR CLASS>, label: String, contractState: <ERROR CLASS>): Unit

Adds a labelled output to the transaction.

fun output(contractClassName: <ERROR CLASS>, notary: <ERROR CLASS>, contractState: <ERROR CLASS>): Unit
fun output(contractClassName: <ERROR CLASS>, encumbrance: Int, contractState: <ERROR CLASS>): Unit
fun output(contractClassName: <ERROR CLASS>, contractState: <ERROR CLASS>): Unit

Adds an output to the transaction.

reference

fun reference(stateLabel: String): <ERROR CLASS>

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

fun reference(contractClassName: <ERROR CLASS>, state: <ERROR CLASS>): Unit

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

timeWindow

fun timeWindow(time: Instant, tolerance: Duration = 30.seconds): Unit

Sets the TimeWindow of the transaction.

tweak

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

Creates a local scoped copy of the transaction.