TestLedgerDSLInterpreter
Keywords: net.corda.testing.dsl.TestLedgerDSLInterpreter class
Date: 2023-09-18

net.corda.testing.dsl

## Class TestLedgerDSLInterpreter

- net.corda.testing.dsl.TestLedgerDSLInterpreter

- All Implemented Interfaces:
    LedgerDSLInterpreter<T>, OutputStateLookup, Verifies

      public class TestLedgerDSLInterpreter
      implements LedgerDSLInterpreter<T>

- - ### Field Detail

    - #### Companion

          public static net.corda.testing.dsl.TestLedgerDSLInterpreter.Companion Companion

  - ### Constructor Detail

    - #### TestLedgerDSLInterpreter

          public TestLedgerDSLInterpreter(@NotNull
                                          ServiceHub services)

  - ### Method Detail

    - #### getWireTransactions

          @NotNull
          public java.util.List<net.corda.core.transactions.WireTransaction> getWireTransactions()

    - #### transactionName

          @Nullable
          public java.lang.String transactionName(@NotNull
                                                            SecureHash transactionHash)

    - #### outputToLabel

          @Nullable
          public java.lang.String outputToLabel(@NotNull
                                                          ContractState state)

    - #### _transaction

          @NotNull
          public WireTransaction _transaction(@Nullable
                                                       java.lang.String transactionLabel,
                                                       @NotNull
                                                       TransactionBuilder transactionBuilder,
                                                       @NotNull
                                                       kotlin.jvm.functions.Function1<? super net.corda.testing.dsl.TestTransactionDSLInterpreter,? extends net.corda.testing.dsl.EnforceVerifyOrFail> dsl)

      Creates and adds a transaction to the ledger.

      Parameters:
        `transactionLabel` - Optional label of the transaction, to be used in diagnostic messages.
        `transactionBuilder` - The base transactionBuilder that will be used to build the transaction.
        `dsl` - The dsl that should be interpreted for building the transaction.
      Returns:
        The final `class WireTransaction` of the built transaction.

    - #### _unverifiedTransaction

          @NotNull
          public WireTransaction _unverifiedTransaction(@Nullable
                                                                 java.lang.String transactionLabel,
                                                                 @NotNull
                                                                 TransactionBuilder transactionBuilder,
                                                                 @NotNull
                                                                 kotlin.jvm.functions.Function1<? super net.corda.testing.dsl.TestTransactionDSLInterpreter,kotlin.Unit> dsl)

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

      Parameters:
        `transactionLabel` - Optional label of the transaction, to be used in diagnostic messages.
        `transactionBuilder` - The base transactionBuilder that will be used to build the transaction.
        `dsl` - The dsl that should be interpreted for building the transaction.
      Returns:
        The final `class WireTransaction` of the built transaction.
      See Also:
        `verifies`

    - #### _tweak

          public void _tweak(@NotNull
                             kotlin.jvm.functions.Function1<? super net.corda.testing.dsl.LedgerDSLInterpreter<net.corda.testing.dsl.TestTransactionDSLInterpreter>,kotlin.Unit> dsl)

      Creates a local scoped copy of the ledger.

      Parameters:
        `dsl` - The ledger DSL to be interpreted using the copy.

    - #### attachment

          @NotNull
          public SecureHash attachment(@NotNull
                                                java.io.InputStream attachment)

      Adds an attachment to the ledger.

      Parameters:
        `attachment` - The InputStream defining the contents of the attachment.
      Returns:
        The `class SecureHash` that identifies the attachment, to be used in transactions.

    - #### verifies

          @NotNull
          public EnforceVerifyOrFail verifies()

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

    - #### retrieveOutputStateAndRef

          @NotNull
          public <S extends ContractState> StateAndRef<S> retrieveOutputStateAndRef(@NotNull
                                                                                             java.lang.Class<S> clazz,
                                                                                             @NotNull
                                                                                             java.lang.String label)

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

      Parameters:
        `clazz` - The class object holding the type of the output state expected.
        `label` - The label of the to-be-retrieved output state.
      Returns:
        The output `class StateAndRef`.
      See Also:
        `TransactionDSLInterpreter.output`

    - #### getTransactionsToVerify

          @NotNull
          public java.util.List<net.corda.core.transactions.WireTransaction> getTransactionsToVerify()

    - #### getTransactionsUnverified

          @NotNull
          public java.util.List<net.corda.core.transactions.WireTransaction> getTransactionsUnverified()

    - #### getServices

          @NotNull
          public ServiceHub getServices()

    - #### component1

          @NotNull
          public ServiceHub component1()

    - #### copy

          @NotNull
          public TestLedgerDSLInterpreter copy(@NotNull
                                                        ServiceHub services,
                                                        @NotNull
                                                        java.util.HashMap<java.lang.String,net.corda.core.contracts.StateAndRef> labelToOutputStateAndRefs,
                                                        @NotNull
                                                        java.util.HashMap<net.corda.core.crypto.SecureHash,net.corda.testing.dsl.TestLedgerDSLInterpreter.WireTransactionWithLocation> transactionWithLocations,
                                                        @NotNull
                                                        java.util.HashMap<net.corda.core.crypto.SecureHash,net.corda.testing.dsl.TestLedgerDSLInterpreter.WireTransactionWithLocation> nonVerifiedTransactionWithLocations)

    - #### toString

          @NotNull
          public java.lang.String toString()

    - #### hashCode

          public int hashCode()

    - #### equals

          public boolean equals(@Nullable
                                java.lang.Object p)