LedgerDSL

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

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun _transaction(transactionLabel: String?, transactionBuilder: TransactionBuilder, dsl: TransactionDSLInterpreter.() -> EnforceVerifyOrFail): WireTransaction

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: TransactionBuilder, dsl: TransactionDSLInterpreter.() -> Unit): WireTransaction

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

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

Retrieves the output TransactionState based on the label.

Link copied to clipboard

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

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

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

Link copied to clipboard
open override fun <S : ContractState> retrieveOutputStateAndRef(clazz: Class<S>, label: String): StateAndRef<S>

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

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

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: TransactionBuilder = TransactionBuilder(notary = notary), dsl: TransactionDSL<TransactionDSLInterpreter>.() -> Unit): WireTransaction

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.