From 75c1e9cfe3b5db4cc63214804d7cdd54b5c1a523 Mon Sep 17 00:00:00 2001 From: joeldudleyr3 Date: Thu, 8 Nov 2018 10:26:29 +0000 Subject: [PATCH] Updates tutorial to reflect template changes. --- .../src/main/java/com/template/TemplateContract.java | 2 +- .../java/net/corda/docs/java/tutorial/helloworld/IOUFlow.java | 4 +--- .../net/corda/docs/java/tutorial/twoparty/IOUContract.java | 2 +- .../java/net/corda/docs/java/tutorial/twoparty/IOUFlow.java | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/source/example-code/src/main/java/com/template/TemplateContract.java b/docs/source/example-code/src/main/java/com/template/TemplateContract.java index 5c4278a408..010bdc444e 100644 --- a/docs/source/example-code/src/main/java/com/template/TemplateContract.java +++ b/docs/source/example-code/src/main/java/com/template/TemplateContract.java @@ -6,7 +6,7 @@ import net.corda.core.transactions.LedgerTransaction; public class TemplateContract implements Contract { // This is used to identify our contract when building a transaction. - public static final String TEMPLATE_CONTRACT_ID = "com.template.TemplateContract"; + public static final String ID = "com.template.TemplateContract"; /** * A transaction is considered valid if the verify() function of the contract of each of the transaction's input diff --git a/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/helloworld/IOUFlow.java b/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/helloworld/IOUFlow.java index fd35ab75ac..b69d4e9b4a 100644 --- a/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/helloworld/IOUFlow.java +++ b/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/helloworld/IOUFlow.java @@ -13,8 +13,6 @@ import net.corda.core.transactions.SignedTransaction; import net.corda.core.transactions.TransactionBuilder; import net.corda.core.utilities.ProgressTracker; -import static com.template.TemplateContract.TEMPLATE_CONTRACT_ID; - // Replace TemplateFlow's definition with: @InitiatingFlow @StartableByRPC @@ -53,7 +51,7 @@ public class IOUFlow extends FlowLogic { // We create a transaction builder and add the components. final TransactionBuilder txBuilder = new TransactionBuilder(notary) - .addOutputState(outputState, TEMPLATE_CONTRACT_ID) + .addOutputState(outputState, TemplateContract.ID) .addCommand(cmd); // Signing the transaction. diff --git a/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/twoparty/IOUContract.java b/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/twoparty/IOUContract.java index ed0031dc48..af2bb40daa 100644 --- a/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/twoparty/IOUContract.java +++ b/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/twoparty/IOUContract.java @@ -18,7 +18,7 @@ import static net.corda.core.contracts.ContractsDSL.requireThat; // Replace TemplateContract's definition with: public class IOUContract implements Contract { - public static final String IOU_CONTRACT_ID = "com.template.IOUContract"; + public static final String ID = "com.template.IOUContract"; // Our Create command. public static class Create implements CommandData { diff --git a/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/twoparty/IOUFlow.java b/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/twoparty/IOUFlow.java index 5ad1a12ce2..40749d2c7e 100644 --- a/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/twoparty/IOUFlow.java +++ b/docs/source/example-code/src/main/java/net/corda/docs/java/tutorial/twoparty/IOUFlow.java @@ -52,7 +52,7 @@ public class IOUFlow extends FlowLogic { // We create the transaction components. IOUState outputState = new IOUState(iouValue, getOurIdentity(), otherParty); - StateAndContract outputContractAndState = new StateAndContract(outputState, IOUContract.IOU_CONTRACT_ID); + StateAndContract outputContractAndState = new StateAndContract(outputState, IOUContract.ID); List requiredSigners = ImmutableList.of(getOurIdentity().getOwningKey(), otherParty.getOwningKey()); Command cmd = new Command<>(new IOUContract.Create(), requiredSigners);