@DoNotImplement interface TransactionDSLInterpreter : Verifies, OutputStateLookup
This interface defines the bare bone functionality that a Transaction DSL interpreter should implement.
Parameters
abstract val ledgerInterpreter: LedgerDSLInterpreter<TransactionDSLInterpreter>
A reference to the enclosing ledger{..}'s interpreter. |
abstract fun _attachment(contractClassName: ContractClassName): Unit abstract fun _attachment(contractClassName: ContractClassName, attachmentId: AttachmentId, signers: List<PublicKey>): Unit
Attaches an attachment containing the named contract to the transaction abstract fun _attachment(contractClassName: ContractClassName, attachmentId: AttachmentId, signers: List<PublicKey>, jarManifestAttributes: Map<String, String>): Unit
Attaches an attachment containing the named contract to the transaction. |
|
abstract fun _tweak(dsl: TransactionDSLInterpreter.() -> EnforceVerifyOrFail): EnforceVerifyOrFail
Creates a local scoped copy of the transaction. |
|
abstract fun attachment(attachmentId: SecureHash): Unit
Adds an Attachment reference to the transaction. |
|
abstract fun command(signers: List<PublicKey>, commandData: CommandData): Unit
Adds a command to the transaction. |
|
abstract fun input(stateRef: StateRef): Unit
Adds an input reference to the transaction. Note that verifies will resolve this reference. |
|
abstract fun output(contractClassName: ContractClassName, label: String?, notary: Party, encumbrance: Int?, attachmentConstraint: AttachmentConstraint, contractState: ContractState): Unit
Adds an output to the transaction. |
|
abstract fun reference(stateRef: StateRef): Unit
Add a reference input state to the transaction. Note that verifies will resolve this reference. |
|
abstract fun timeWindow(data: TimeWindow): Unit
Sets the time-window of the transaction. |
open fun fails(): EnforceVerifyOrFail
Asserts that verifies throws, with no condition on the exception message. |
|
open infix fun fails with(msg: String): EnforceVerifyOrFail |
|
open fun failsWith(expectedMessage: String?): EnforceVerifyOrFail
Asserts that verifies() throws. |
|
abstract fun <S : ContractState> retrieveOutputStateAndRef(clazz: Class<S>, label: String): StateAndRef<S>
Retrieves an output previously defined by TransactionDSLInterpreter.output with a label passed in. |
|
abstract fun verifies(): EnforceVerifyOrFail
Verifies the ledger/transaction, throws if the verification fails. |
fun Any.contextLogger(): <ERROR CLASS>
When called from a companion object, returns the logger for the enclosing class. |
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. |
|
class TransactionDSL<out T : TransactionDSLInterpreter> : TransactionDSLInterpreter
Underlying class for the transaction DSL. Do not instantiate directly, instead use the transaction function. |