corda / net.corda.testing.dsl

Package net.corda.testing.dsl

A simple DSL for building pseudo-transactions (not the same as the wire protocol) for testing purposes

Types

AttachmentResolutionException

class AttachmentResolutionException

DoubleSpentInputs

class DoubleSpentInputs

DuplicateOutputLabel

class DuplicateOutputLabel

EnforceVerifyOrFail

sealed class EnforceVerifyOrFail

If you jumped here from a compiler error make sure the last line of your test tests for a transaction verify or fail. This is a dummy type that can only be instantiated by functions in this module. This way we can ensure that all tests will have as the last line either an accept or a failure test. The name is deliberately long to help make sense of the triggered diagnostic.

LedgerDSL

class LedgerDSL<out T : TransactionDSLInterpreter, out L : LedgerDSLInterpreter<T>> : 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.

LedgerDSLInterpreter

interface LedgerDSLInterpreter<out T : TransactionDSLInterpreter> : Verifies, OutputStateLookup

This interface defines the bare bone functionality that a Ledger DSL interpreter should implement.

OutputStateLookup

interface OutputStateLookup

This interface defines output state lookup by label. It is split from the interpreter interfaces so that outputs may be looked up both in ledger{..} and transaction{..} blocks.

TestLedgerDSLInterpreter

data class TestLedgerDSLInterpreter : LedgerDSLInterpreter<TestTransactionDSLInterpreter>

TestTransactionDSLInterpreter

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.

TransactionDSL

class TransactionDSL<out T : TransactionDSLInterpreter> : TransactionDSLInterpreter

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

TransactionDSLInterpreter

interface TransactionDSLInterpreter : Verifies, OutputStateLookup

This interface defines the bare bone functionality that a Transaction DSL interpreter should implement.

Verifies

interface Verifies

This interface asserts that the DSL at hand is capable of verifying its underlying construct(ledger/transaction).