LedgerDSL

class LedgerDSL<out T : TransactionDSLInterpreter, out L : LedgerDSLInterpreter<T>>(val interpreter: L, notary: <Error class: unknown class>) : LedgerDSLInterpreter<TransactionDSLInterpreter>

This is the class that defines the syntactic sugar of the ledger Test DSL and delegates to the contained interpreter, and what is actually used in ledger { (...) }. Add convenience functions here, or if you want to extend the DSL functionality then first add your primitive to LedgerDSLInterpreter and then add the convenience defaults/extension methods here.

Constructors

Link copied to clipboard
constructor(interpreter: L, notary: <Error class: unknown class>)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun _transaction(transactionLabel: String?, transactionBuilder: <Error class: unknown class>, dsl: TransactionDSLInterpreter.() -> EnforceVerifyOrFail): <Error class: unknown class>

Creates and adds a transaction to the ledger.

Link copied to clipboard

Creates a local scoped copy of the ledger.

Link copied to clipboard
open override fun _unverifiedTransaction(transactionLabel: String?, transactionBuilder: <Error class: unknown class>, dsl: TransactionDSLInterpreter.() -> Unit): <Error class: unknown class>

Creates and adds a transaction to the ledger that will not be verified by verifies.

Link copied to clipboard
open override fun attachment(attachment: InputStream): <Error class: unknown class>

Adds an attachment to the ledger.

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
inline fun <S> String.output(): S

Retrieves the output TransactionState based on the label.

Link copied to clipboard
inline fun <S> String.outputStateAndRef(): <Error class: unknown class><S>

Retrieves an output previously defined by TransactionDSLInterpreter._output with a label passed in.

Link copied to clipboard
fun <S> retrieveOutput(clazz: Class<S>, label: String): <Error class: unknown class>

Retrieves an output previously defined by TransactionDSLInterpreter._output with a label passed in.

Link copied to clipboard
open override fun <S> retrieveOutputStateAndRef(clazz: Class<S>, label: String): <Error class: unknown class><S>

Retrieves an output previously defined by TransactionDSLInterpreter.output with a label passed in.

Link copied to clipboard
fun transaction(label: String? = null, transactionBuilder: <Error class: unknown class> = TransactionBuilder(notary = notary), dsl: TransactionDSL<TransactionDSLInterpreter>.() -> EnforceVerifyOrFail): <Error class: unknown class>

Creates and adds a transaction to the ledger.

Link copied to clipboard
fun tweak(dsl: LedgerDSL<T, L>.() -> Unit)

Creates a local scoped copy of the ledger.

Link copied to clipboard
fun unverifiedTransaction(label: String? = null, transactionBuilder: <Error class: unknown class> = TransactionBuilder(notary = notary), dsl: TransactionDSL<TransactionDSLInterpreter>.() -> Unit): <Error class: unknown class>

Creates and adds a transaction to the ledger that will not be verified by verifies.

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

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