From c3ba304ed6eda5f9a5597fae89e8e7c027128793 Mon Sep 17 00:00:00 2001 From: Joel Dudley Date: Mon, 22 Oct 2018 07:59:40 +0200 Subject: [PATCH] Updates tutorial code to match template changes. --- .../corda/docs/tutorial/helloworld/templateContract.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/templateContract.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/templateContract.kt index 8d20dc5778..398a03eb01 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/templateContract.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/tutorial/helloworld/templateContract.kt @@ -4,9 +4,12 @@ import net.corda.core.contracts.CommandData import net.corda.core.contracts.Contract import net.corda.core.transactions.LedgerTransaction -val TEMPLATE_CONTRACT_ID = "com.template.TemplateContract" - open class TemplateContract : Contract { + // This is used to identify our contract when building a transaction. + companion object { + val ID = "com.template.TemplateContract" + } + // A transaction is considered valid if the verify() function of the contract of each of the transaction's input // and output states does not throw an exception. override fun verify(tx: LedgerTransaction) { @@ -17,4 +20,4 @@ open class TemplateContract : Contract { interface Commands : CommandData { class Action : Commands } -} \ No newline at end of file +}