public class TestLedgerDSLInterpreter implements LedgerDSLInterpreter<T>
Modifier and Type | Class and Description |
---|---|
static class |
TestLedgerDSLInterpreter.Companion |
Verifies.DefaultImpls
Modifier and Type | Field and Description |
---|---|
static TestLedgerDSLInterpreter.Companion |
Companion |
Constructor and Description |
---|
TestLedgerDSLInterpreter(ServiceHub services) |
Modifier and Type | Method and Description |
---|---|
WireTransaction |
_transaction(java.lang.String transactionLabel,
TransactionBuilder transactionBuilder,
Function1<? super net.corda.testing.dsl.TestTransactionDSLInterpreter,? extends net.corda.testing.dsl.EnforceVerifyOrFail> dsl)
Creates and adds a transaction to the ledger.
|
void |
_tweak(Function1<? super net.corda.testing.dsl.LedgerDSLInterpreter<net.corda.testing.dsl.TestTransactionDSLInterpreter>,Unit> dsl)
Creates a local scoped copy of the ledger.
|
WireTransaction |
_unverifiedTransaction(java.lang.String transactionLabel,
TransactionBuilder transactionBuilder,
Function1<? super net.corda.testing.dsl.TestTransactionDSLInterpreter,Unit> dsl)
Creates and adds a transaction to the ledger that will not be verified by
Verifies.verifies . |
SecureHash |
attachment(java.io.InputStream attachment)
Adds an attachment to the ledger.
|
ServiceHub |
component1() |
TestLedgerDSLInterpreter |
copy(ServiceHub services,
java.util.HashMap<java.lang.String,net.corda.core.contracts.StateAndRef> labelToOutputStateAndRefs,
java.util.HashMap<net.corda.core.crypto.SecureHash,net.corda.testing.dsl.TestLedgerDSLInterpreter.WireTransactionWithLocation> transactionWithLocations,
java.util.HashMap<net.corda.core.crypto.SecureHash,net.corda.testing.dsl.TestLedgerDSLInterpreter.WireTransactionWithLocation> nonVerifiedTransactionWithLocations) |
boolean |
equals(java.lang.Object p) |
ServiceHub |
getServices() |
java.util.List<net.corda.core.transactions.WireTransaction> |
getTransactionsToVerify() |
java.util.List<net.corda.core.transactions.WireTransaction> |
getTransactionsUnverified() |
java.util.List<net.corda.core.transactions.WireTransaction> |
getWireTransactions() |
int |
hashCode() |
java.lang.String |
outputToLabel(ContractState state) |
<S extends ContractState> |
retrieveOutputStateAndRef(java.lang.Class<S> clazz,
java.lang.String label)
Retrieves an output previously defined by
TransactionDSLInterpreter.output with a label passed in. |
java.lang.String |
toString() |
java.lang.String |
transactionName(SecureHash transactionHash) |
EnforceVerifyOrFail |
verifies()
Verifies the ledger/transaction, throws if the verification fails.
|
_transaction, _tweak, _unverifiedTransaction, attachment
fails, fails with, failsWith, verifies
retrieveOutputStateAndRef
public static TestLedgerDSLInterpreter.Companion Companion
public TestLedgerDSLInterpreter(ServiceHub services)
public java.util.List<net.corda.core.transactions.WireTransaction> getWireTransactions()
public java.lang.String transactionName(SecureHash transactionHash)
public java.lang.String outputToLabel(ContractState state)
public WireTransaction _transaction(java.lang.String transactionLabel, TransactionBuilder transactionBuilder, 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.class WireTransaction
of the built transaction.public WireTransaction _unverifiedTransaction(java.lang.String transactionLabel, TransactionBuilder transactionBuilder, Function1<? super net.corda.testing.dsl.TestTransactionDSLInterpreter,Unit> dsl)
Creates and adds a transaction to the ledger that will not be verified by Verifies.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.class WireTransaction
of the built transaction.Verifies.verifies
public void _tweak(Function1<? super net.corda.testing.dsl.LedgerDSLInterpreter<net.corda.testing.dsl.TestTransactionDSLInterpreter>,Unit> dsl)
Creates a local scoped copy of the ledger.
dsl
- The ledger DSL to be interpreted using the copy.public SecureHash attachment(java.io.InputStream attachment)
Adds an attachment to the ledger.
attachment
- The InputStream defining the contents of the attachment.class SecureHash
that identifies the attachment, to be used in transactions.public EnforceVerifyOrFail verifies()
Verifies the ledger/transaction, throws if the verification fails.
public <S extends ContractState> StateAndRef<S> retrieveOutputStateAndRef(java.lang.Class<S> clazz, 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.class StateAndRef
.TransactionDSLInterpreter.output
public java.util.List<net.corda.core.transactions.WireTransaction> getTransactionsToVerify()
public java.util.List<net.corda.core.transactions.WireTransaction> getTransactionsUnverified()
public ServiceHub getServices()
public ServiceHub component1()
public TestLedgerDSLInterpreter copy(ServiceHub services, java.util.HashMap<java.lang.String,net.corda.core.contracts.StateAndRef> labelToOutputStateAndRefs, java.util.HashMap<net.corda.core.crypto.SecureHash,net.corda.testing.dsl.TestLedgerDSLInterpreter.WireTransactionWithLocation> transactionWithLocations, java.util.HashMap<net.corda.core.crypto.SecureHash,net.corda.testing.dsl.TestLedgerDSLInterpreter.WireTransactionWithLocation> nonVerifiedTransactionWithLocations)
public java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object p)