public class TestLedgerDSLInterpreter implements LedgerDSLInterpreter<T>
public static net.corda.testing.dsl.TestLedgerDSLInterpreter.Companion Companion
public TestLedgerDSLInterpreter(@NotNull net.corda.core.node.ServiceHub services)
@NotNull public java.util.List<net.corda.core.transactions.WireTransaction> getWireTransactions()
@Nullable public java.lang.String transactionName(@NotNull net.corda.core.crypto.SecureHash transactionHash)
@Nullable public java.lang.String outputToLabel(@NotNull net.corda.core.contracts.ContractState state)
@NotNull public net.corda.core.transactions.WireTransaction _transaction(@Nullable java.lang.String transactionLabel, @NotNull net.corda.core.transactions.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.
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.@NotNull public net.corda.core.transactions.WireTransaction _unverifiedTransaction(@Nullable java.lang.String transactionLabel, @NotNull net.corda.core.transactions.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
.
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.verifies
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.
dsl
- The ledger DSL to be interpreted using the copy.@NotNull public net.corda.core.crypto.SecureHash attachment(@NotNull java.io.InputStream attachment)
Adds an attachment to the ledger.
attachment
- The InputStream defining the contents of the attachment.@NotNull public EnforceVerifyOrFail verifies()
Verifies the ledger/transaction, throws if the verification fails.
@NotNull public <S extends ContractState> net.corda.core.contracts.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.
clazz
- The class object holding the type of the output state expected.label
- The label of the to-be-retrieved output state.TransactionDSLInterpreter.output
@NotNull public java.util.List<net.corda.core.transactions.WireTransaction> getTransactionsToVerify()
@NotNull public java.util.List<net.corda.core.transactions.WireTransaction> getTransactionsUnverified()
@NotNull public net.corda.core.node.ServiceHub getServices()
@NotNull public net.corda.core.node.ServiceHub component1()
@NotNull public TestLedgerDSLInterpreter copy(@NotNull net.corda.core.node.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)
@NotNull public java.lang.String toString()
public int hashCode()
public boolean equals(@Nullable java.lang.Object p)