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: Party)

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

Functions

attachment

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

attachments

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

command

fun command(signer: PublicKey, commandData: CommandData): <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: ContractClassName, stateLabel: String): Unitfun input(contractClassName: ContractClassName, state: ContractState): 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: ContractClassName, label: String, notary: Party, contractState: ContractState): Unit
fun output(contractClassName: ContractClassName, label: String, encumbrance: Int, contractState: ContractState): Unit
fun output(contractClassName: ContractClassName, label: String, contractState: ContractState): Unit

Adds a labelled output to the transaction.

fun output(contractClassName: ContractClassName, notary: Party, contractState: ContractState): Unit
fun output(contractClassName: ContractClassName, encumbrance: Int, contractState: ContractState): Unit
fun output(contractClassName: ContractClassName, contractState: ContractState): 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: ContractClassName, state: ContractState): 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.

Extension Functions

contextLogger

fun Any.contextLogger(): <ERROR CLASS>

When called from a companion object, returns the logger for the enclosing class.