From d0903ae265e980290da7bc20875fd3589a4758af Mon Sep 17 00:00:00 2001 From: Andras Slemmer Date: Mon, 11 Jul 2016 14:23:45 +0100 Subject: [PATCH] docs: Rename test tutorial subtitle --- core/src/main/kotlin/com/r3corda/core/testing/TestDSL.kt | 6 +++--- docs/source/tutorial-test-dsl.rst | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/kotlin/com/r3corda/core/testing/TestDSL.kt b/core/src/main/kotlin/com/r3corda/core/testing/TestDSL.kt index e3e85158b8..ddf9f483de 100644 --- a/core/src/main/kotlin/com/r3corda/core/testing/TestDSL.kt +++ b/core/src/main/kotlin/com/r3corda/core/testing/TestDSL.kt @@ -131,7 +131,7 @@ data class TestTransactionDSLInterpreter private constructor( override fun _output(label: String?, notary: Party, contractState: ContractState) { val outputIndex = transactionBuilder.addOutputState(contractState, notary) if (label != null) { - if (labelToIndexMap.contains(label)) { + if (label in labelToIndexMap) { throw DuplicateOutputLabel(label) } else { labelToIndexMap[label] = outputIndex @@ -284,7 +284,7 @@ data class TestLedgerDSLInterpreter private constructor ( val wireTransaction = transactionInterpreter.toWireTransaction() // Record the output states transactionInterpreter.labelToIndexMap.forEach { label, index -> - if (labelToOutputStateAndRefs.contains(label)) { + if (label in labelToOutputStateAndRefs) { throw DuplicateOutputLabel(label) } labelToOutputStateAndRefs[label] = wireTransaction.outRef(index) @@ -355,7 +355,7 @@ fun signAll(transactionsToSign: List, extraKeys: Array() for (key in ALL_TEST_KEYS + extraKeys) { - if (allPubKeys.contains(key.public)) { + if (key.public in allPubKeys) { signatures += key.signWithECDSA(bits) allPubKeys -= key.public } diff --git a/docs/source/tutorial-test-dsl.rst b/docs/source/tutorial-test-dsl.rst index b3136dc40c..1899166f4d 100644 --- a/docs/source/tutorial-test-dsl.rst +++ b/docs/source/tutorial-test-dsl.rst @@ -15,8 +15,8 @@ This tutorial will take you through the steps required to write a contract test The testing DSL allows one to define a piece of the ledger with transactions referring to each other, and ways of verifying their correctness. -Start with the basic Bird-fold ------------------------------- +Testing single transactions +--------------------------- We start with the empty ledger: