interface TransactionDSLInterpreter : Verifies, OutputStateLookupThis interface defines the bare bone functionality that a Transaction DSL interpreter should implement.
Parameters
| ledgerInterpreter |
abstract val ledgerInterpreter: LedgerDSLInterpreter<TransactionDSLInterpreter>A reference to the enclosing ledger{..}s interpreter. |
| _command |
abstract fun _command(signers: List<PublicKey>, commandData: CommandData): UnitAdds a command to the transaction. |
| _output |
abstract fun _output(label: String?, notary: Party, contractState: ContractState): UnitAdds an output to the transaction. |
| attachment |
abstract fun attachment(attachmentId: SecureHash): UnitAdds an Attachment reference to the transaction. |
| input |
abstract fun input(stateRef: StateRef): UnitAdds an input reference to the transaction. Note that verifies will resolve this reference. |
| timestamp |
abstract fun timestamp(data: Timestamp): UnitAdds a timestamp to the transaction. |
| tweak |
abstract fun tweak(dsl: TransactionDSL<TransactionDSLInterpreter>.() -> EnforceVerifyOrFail): EnforceVerifyOrFailCreates a local scoped copy of the transaction. |
| fails |
open fun fails(): EnforceVerifyOrFailAsserts that verifies throws, with no condition on the exception message. |
| fails with |
open infix fun fails with(msg: String): EnforceVerifyOrFail |
| failsWith |
open fun failsWith(expectedMessage: String?): EnforceVerifyOrFailAsserts that verifies() throws. |
| retrieveOutputStateAndRef |
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. |
| verifies |
abstract fun verifies(): EnforceVerifyOrFailVerifies the ledger/transaction, throws if the verification fails. |
| ledger |
fun TransactionDSLInterpreter.Here follows implementations of the LedgerDSLInterpreter and TransactionDSLInterpreter interfaces to be used in tests. Top level primitives ledger and transaction that bind the interpreter types are also defined here. |
| transaction |
fun TransactionDSLInterpreter. |
| TestTransactionDSLInterpreter |
data class TestTransactionDSLInterpreter : TransactionDSLInterpreter, OutputStateLookupThis 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. |
| TransactionDSL |
class TransactionDSL<out T : TransactionDSLInterpreter> : TransactionDSLInterpreter |