mirror of
https://github.com/corda/corda.git
synced 2025-06-11 03:41:41 +00:00
Rethrows a clearer error message when a test tx in a test ledger does not create a valid tx.
This commit is contained in:
parent
c8e55ae086
commit
443afb3515
@ -233,7 +233,11 @@ data class TestLedgerDSLInterpreter private constructor(
|
|||||||
val transactionInterpreter = interpretTransactionDsl(transactionBuilder, dsl)
|
val transactionInterpreter = interpretTransactionDsl(transactionBuilder, dsl)
|
||||||
if (fillTransaction) fillTransaction(transactionBuilder)
|
if (fillTransaction) fillTransaction(transactionBuilder)
|
||||||
// Create the WireTransaction
|
// Create the WireTransaction
|
||||||
val wireTransaction = transactionInterpreter.toWireTransaction()
|
val wireTransaction = try {
|
||||||
|
transactionInterpreter.toWireTransaction()
|
||||||
|
} catch (e: IllegalStateException) {
|
||||||
|
throw IllegalStateException("A transaction-DSL block that is part of a test ledger must return a valid transaction.", e)
|
||||||
|
}
|
||||||
// Record the output states
|
// Record the output states
|
||||||
transactionInterpreter.labelToIndexMap.forEach { label, index ->
|
transactionInterpreter.labelToIndexMap.forEach { label, index ->
|
||||||
if (label in labelToOutputStateAndRefs) {
|
if (label in labelToOutputStateAndRefs) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user