From 3d4cca3aba961009322e6e95231c07d62914c6c1 Mon Sep 17 00:00:00 2001 From: Anthony Nixon Date: Tue, 11 Feb 2020 11:14:45 +0000 Subject: [PATCH 1/3] checkpoint --- yo-cordapp/README.md | 10 ++++++++++ yo-cordapp/settings.gradle | 6 ++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/yo-cordapp/README.md b/yo-cordapp/README.md index aacc1328b..7b46e5b41 100644 --- a/yo-cordapp/README.md +++ b/yo-cordapp/README.md @@ -16,6 +16,16 @@ See https://docs.corda.net/getting-set-up.html. See https://docs.corda.net/tutorial-cordapp.html#running-the-example-cordapp. +Java +``./gradlew deployNodesJava`` + +Kotlin +``./gradlew deployNodesKotlin`` + +then +``./build/nodes/runnodes`` + + ### Sending Yo!s We will interact with the nodes via their shell. When the nodes are up and running, use the following command to send a diff --git a/yo-cordapp/settings.gradle b/yo-cordapp/settings.gradle index 0473ad434..c3fbda796 100644 --- a/yo-cordapp/settings.gradle +++ b/yo-cordapp/settings.gradle @@ -1,2 +1,4 @@ -include 'workflows' -include 'contracts' +include 'workflows-kotlin' +include 'contracts-kotlin' +include 'workflows-java' +include 'contracts-java' \ No newline at end of file From 31cc3437814a3b12c84ec2e5fd0756782f6970f3 Mon Sep 17 00:00:00 2001 From: Anthony Nixon Date: Tue, 11 Feb 2020 16:39:03 +0000 Subject: [PATCH 2/3] java Yo tested --- yo-cordapp/build.gradle | 56 ++++++++++++-- .../build.gradle | 0 .../examples/yo/contracts/YoContract.java | 38 ++++++++++ .../net/corda/examples/yo/states/YoState.java | 59 ++++++++++++++ yo-cordapp/contracts-kotlin/build.gradle | 21 +++++ .../corda/examples/yo/contracts/YoContract.kt | 0 .../net/corda/examples/yo/states/YoState.kt | 0 yo-cordapp/workflows-java/build.gradle | 58 ++++++++++++++ .../corda/examples/yo/DriverBasedTest.java | 43 +++++++++++ .../net/corda/examples/yo/flows/YoFlow.java | 76 +++++++++++++++++++ .../examples/yo/flows/YoFlowResponder.java | 20 +++++ .../java/net/corda/examples/yo/FlowTests.java | 51 +++++++++++++ .../net/corda/examples/yo/NodeDriver.java | 34 +++++++++ .../build.gradle | 2 +- .../net/corda/examples/yo/DriverBasedTest.kt | 0 .../net/corda/examples/yo/flows/Flows.kt | 2 +- .../kotlin/net/corda/examples/yo/FlowTests.kt | 0 .../net/corda/examples/yo/NodeDriver.kt | 0 18 files changed, 453 insertions(+), 7 deletions(-) rename yo-cordapp/{contracts => contracts-java}/build.gradle (100%) create mode 100644 yo-cordapp/contracts-java/src/main/java/net/corda/examples/yo/contracts/YoContract.java create mode 100644 yo-cordapp/contracts-java/src/main/java/net/corda/examples/yo/states/YoState.java create mode 100644 yo-cordapp/contracts-kotlin/build.gradle rename yo-cordapp/{contracts => contracts-kotlin}/src/main/kotlin/net/corda/examples/yo/contracts/YoContract.kt (100%) rename yo-cordapp/{contracts => contracts-kotlin}/src/main/kotlin/net/corda/examples/yo/states/YoState.kt (100%) create mode 100644 yo-cordapp/workflows-java/build.gradle create mode 100644 yo-cordapp/workflows-java/src/integrationTest/java/net/corda/examples/yo/DriverBasedTest.java create mode 100644 yo-cordapp/workflows-java/src/main/java/net/corda/examples/yo/flows/YoFlow.java create mode 100644 yo-cordapp/workflows-java/src/main/java/net/corda/examples/yo/flows/YoFlowResponder.java create mode 100644 yo-cordapp/workflows-java/src/test/java/net/corda/examples/yo/FlowTests.java create mode 100644 yo-cordapp/workflows-java/src/test/java/net/corda/examples/yo/NodeDriver.java rename yo-cordapp/{workflows => workflows-kotlin}/build.gradle (97%) rename yo-cordapp/{workflows => workflows-kotlin}/src/integrationTest/kotlin/net/corda/examples/yo/DriverBasedTest.kt (100%) rename yo-cordapp/{workflows => workflows-kotlin}/src/main/kotlin/net/corda/examples/yo/flows/Flows.kt (97%) rename yo-cordapp/{workflows => workflows-kotlin}/src/test/kotlin/net/corda/examples/yo/FlowTests.kt (100%) rename yo-cordapp/{workflows => workflows-kotlin}/src/test/kotlin/net/corda/examples/yo/NodeDriver.kt (100%) diff --git a/yo-cordapp/build.gradle b/yo-cordapp/build.gradle index 706cb001b..6ac173c03 100644 --- a/yo-cordapp/build.gradle +++ b/yo-cordapp/build.gradle @@ -42,6 +42,11 @@ allprojects { maven { url 'https://jitpack.io' } } + + tasks.withType(JavaCompile) { + options.compilerArgs << "-parameters" // Required for shell commands. + } + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) { kotlinOptions { languageVersion = "1.2" @@ -77,8 +82,10 @@ dependencies { cordaRuntime "$corda_release_group:corda:$corda_release_version" // CorDapp dependencies. - cordapp project(":workflows") - cordapp project(":contracts") + cordapp project(":workflows-kotlin") + cordapp project(":contracts-kotlin") + cordapp project(":workflows-java") + cordapp project(":contracts-java") cordaCompile "org.apache.logging.log4j:log4j-slf4j-impl:${log4j_version}" cordaCompile "org.apache.logging.log4j:log4j-web:${log4j_version}" @@ -94,13 +101,52 @@ cordapp { } } -task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { +task deployNodesJava(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { + nodeDefaults { + projectCordapp { + deploy = false + } + cordapp project(':contracts-java') + cordapp project(':workflows-java') + } + node { + name "O=Notary,L=London,C=GB" + notary = [validating : false] + p2pPort 10002 + rpcSettings { + address("localhost:10003") + adminAddress("localhost:10043") + } + } + node { + name "O=PartyA,L=London,C=GB" + p2pPort 10005 + rpcSettings { + address("localhost:10006") + adminAddress("localhost:10046") + } + rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]] + } + node { + name "O=PartyB,L=New York,C=US" + p2pPort 10008 + rpcSettings { + address("localhost:10009") + adminAddress("localhost:10049") + } + rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]] + } + +} + + +task deployNodesKotlin(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { nodeDefaults { projectCordapp { deploy = false } - cordapp project(':contracts') - cordapp project(':workflows') + cordapp project(':contracts-kotlin') + cordapp project(':workflows-kotlin') } node { name "O=Notary,L=London,C=GB" diff --git a/yo-cordapp/contracts/build.gradle b/yo-cordapp/contracts-java/build.gradle similarity index 100% rename from yo-cordapp/contracts/build.gradle rename to yo-cordapp/contracts-java/build.gradle diff --git a/yo-cordapp/contracts-java/src/main/java/net/corda/examples/yo/contracts/YoContract.java b/yo-cordapp/contracts-java/src/main/java/net/corda/examples/yo/contracts/YoContract.java new file mode 100644 index 000000000..ec12cedb6 --- /dev/null +++ b/yo-cordapp/contracts-java/src/main/java/net/corda/examples/yo/contracts/YoContract.java @@ -0,0 +1,38 @@ +package net.corda.examples.yo.contracts; + +import net.corda.core.contracts.CommandData; +import net.corda.core.contracts.CommandWithParties; +import net.corda.core.contracts.Contract; +import net.corda.core.transactions.LedgerTransaction; +import net.corda.examples.yo.states.YoState; +import org.jetbrains.annotations.NotNull; + +import static net.corda.core.contracts.ContractsDSL.*; + +// ************ +// * Contract * +// ************ +// Contract and state. +public class YoContract implements Contract { + // Used to identify our contract when building a transaction. + public static final String ID = "net.corda.examples.yo.contracts.YoContract"; + + // Contract code. + @Override + public void verify(@NotNull LedgerTransaction tx) throws IllegalArgumentException { + CommandWithParties command = requireSingleCommand(tx.getCommands(), Commands.Send.class); + requireThat(req -> { + req.using("There can be no inputs when Yo'ing other parties", tx.getInputs().isEmpty()); + req.using("There must be one output: The Yo!", tx.getOutputs().size() == 1); + YoState yo = tx.outputsOfType(YoState.class).get(0); + req.using("No sending Yo's to yourself!", !yo.getTarget().equals(yo.getOrigin())); + req.using("The Yo! must be signed by the sender.", command.getSigners().contains(yo.getOrigin().getOwningKey())); + return null; + }); + } + + // Used to indicate the transaction's intent. + public interface Commands extends CommandData { + class Send implements Commands {} + } +} diff --git a/yo-cordapp/contracts-java/src/main/java/net/corda/examples/yo/states/YoState.java b/yo-cordapp/contracts-java/src/main/java/net/corda/examples/yo/states/YoState.java new file mode 100644 index 000000000..ae54da29f --- /dev/null +++ b/yo-cordapp/contracts-java/src/main/java/net/corda/examples/yo/states/YoState.java @@ -0,0 +1,59 @@ +package net.corda.examples.yo.states; + +import com.google.common.collect.ImmutableList; +import net.corda.core.contracts.BelongsToContract; +import net.corda.core.contracts.ContractState; +import net.corda.core.identity.AbstractParty; +import net.corda.core.identity.Party; +import net.corda.core.serialization.ConstructorForDeserialization; +import net.corda.core.serialization.CordaSerializable; +import net.corda.examples.yo.contracts.YoContract; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +// ********* +// * State * +// ********* +@BelongsToContract(YoContract.class) +public class YoState implements ContractState { + private final Party origin; + private final Party target; + private final String yo; + + @ConstructorForDeserialization + public YoState(Party origin, Party target, String yo) { + this.origin = origin; + this.target = target; + this.yo = yo; + } + + public YoState(Party origin, Party target) { + this.origin = origin; + this.target = target; + this.yo = "Yo!"; + } + + public Party getOrigin() { + return origin; + } + + public Party getTarget() { + return target; + } + + public String getYo() { + return yo; + } + + @NotNull + @Override + public List getParticipants() { + return ImmutableList.of(target); + } + + @Override + public String toString() { + return origin.getName() + ": " + yo; + } +} diff --git a/yo-cordapp/contracts-kotlin/build.gradle b/yo-cordapp/contracts-kotlin/build.gradle new file mode 100644 index 000000000..eb5f1d0cc --- /dev/null +++ b/yo-cordapp/contracts-kotlin/build.gradle @@ -0,0 +1,21 @@ +apply plugin: 'net.corda.plugins.cordapp' + +cordapp { + targetPlatformVersion corda_platform_version + minimumPlatformVersion corda_platform_version + contract { + name "yo CorDapp" + vendor "Corda Open Source" + licence "Apache License, Version 2.0" + versionId 1 + } +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + + // Corda dependencies. + cordaCompile "$corda_release_group:corda-core:$corda_release_version" + + testCompile "$corda_release_group:corda-node-driver:$corda_release_version" +} \ No newline at end of file diff --git a/yo-cordapp/contracts/src/main/kotlin/net/corda/examples/yo/contracts/YoContract.kt b/yo-cordapp/contracts-kotlin/src/main/kotlin/net/corda/examples/yo/contracts/YoContract.kt similarity index 100% rename from yo-cordapp/contracts/src/main/kotlin/net/corda/examples/yo/contracts/YoContract.kt rename to yo-cordapp/contracts-kotlin/src/main/kotlin/net/corda/examples/yo/contracts/YoContract.kt diff --git a/yo-cordapp/contracts/src/main/kotlin/net/corda/examples/yo/states/YoState.kt b/yo-cordapp/contracts-kotlin/src/main/kotlin/net/corda/examples/yo/states/YoState.kt similarity index 100% rename from yo-cordapp/contracts/src/main/kotlin/net/corda/examples/yo/states/YoState.kt rename to yo-cordapp/contracts-kotlin/src/main/kotlin/net/corda/examples/yo/states/YoState.kt diff --git a/yo-cordapp/workflows-java/build.gradle b/yo-cordapp/workflows-java/build.gradle new file mode 100644 index 000000000..3d909ab34 --- /dev/null +++ b/yo-cordapp/workflows-java/build.gradle @@ -0,0 +1,58 @@ +apply plugin: 'net.corda.plugins.cordapp' +apply plugin: 'net.corda.plugins.quasar-utils' + +cordapp { + targetPlatformVersion corda_platform_version + minimumPlatformVersion corda_platform_version + workflow { + name "yo Flows" + vendor "Corda Open Source" + licence "Apache License, Version 2.0" + versionId 1 + } +} + +sourceSets { + main { + resources { + srcDir rootProject.file("config/dev") + } + } + test { + resources { + srcDir rootProject.file("config/test") + } + } + integrationTest { + kotlin { + compileClasspath += main.output + test.output + runtimeClasspath += main.output + test.output + srcDir file('src/integrationTest/java') + } + } +} + +configurations { + integrationTestCompile.extendsFrom testCompile + integrationTestRuntime.extendsFrom testRuntime +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" + testCompile "junit:junit:$junit_version" + + // Corda dependencies. + cordaCompile "$corda_release_group:corda-core:$corda_release_version" + cordaRuntime "$corda_release_group:corda:$corda_release_version" + + testCompile "$corda_release_group:corda-node-driver:$corda_release_version" + + // CorDapp dependencies. + cordapp project(":contracts-java") +} + +task integrationTest(type: Test, dependsOn: []) { + testClassesDirs = sourceSets.integrationTest.output.classesDirs + classpath = sourceSets.integrationTest.runtimeClasspath +} \ No newline at end of file diff --git a/yo-cordapp/workflows-java/src/integrationTest/java/net/corda/examples/yo/DriverBasedTest.java b/yo-cordapp/workflows-java/src/integrationTest/java/net/corda/examples/yo/DriverBasedTest.java new file mode 100644 index 000000000..cd6fc1757 --- /dev/null +++ b/yo-cordapp/workflows-java/src/integrationTest/java/net/corda/examples/yo/DriverBasedTest.java @@ -0,0 +1,43 @@ +package net.corda.examples.yo; + +import net.corda.core.identity.CordaX500Name; +import net.corda.testing.core.TestIdentity; +import net.corda.testing.driver.Driver; +import net.corda.testing.driver.DriverParameters; +import net.corda.testing.driver.NodeHandle; +import net.corda.testing.driver.NodeParameters; +import org.junit.Test; + +import java.util.Objects; +import java.util.concurrent.ExecutionException; + +public class DriverBasedTest { + private final TestIdentity bankA = new TestIdentity(new CordaX500Name("BankA", "", "GB")); + private final TestIdentity bankB = new TestIdentity(new CordaX500Name("BankB", "", "US")); + + @Test + public void nodeTest() { + Driver.driver(new DriverParameters().withStartNodesInProcess(true).withIsDebug(true), driverDSL -> { + NodeHandle partyAHandle = null; + NodeHandle partyBHandle = null; + try { + // Start a pair of nodes and wait for them both to be ready. + partyAHandle = driverDSL.startNode(new NodeParameters().withProvidedName(bankA.getName())).get(); + partyBHandle = driverDSL.startNode(new NodeParameters().withProvidedName(bankB.getName())).get(); + } catch (InterruptedException | ExecutionException e) { + e.printStackTrace(); + } + + // From each node, make an RPC call to retrieve another node's name from the network map, to verify that the + // nodes have started and can communicate. + + // This is a very basic test: in practice tests would be starting flows, and verifying the states in the vault + // and other important metrics to ensure that your CorDapp is working as intended. + assert partyAHandle != null; + assert partyBHandle != null; + assert (bankB.getName().equals(Objects.requireNonNull(partyAHandle.getRpc().wellKnownPartyFromX500Name(bankB.getName())).getName())); + assert (bankA.getName().equals(Objects.requireNonNull(partyBHandle.getRpc().wellKnownPartyFromX500Name(bankA.getName())).getName())); + return null; + }); + } +} diff --git a/yo-cordapp/workflows-java/src/main/java/net/corda/examples/yo/flows/YoFlow.java b/yo-cordapp/workflows-java/src/main/java/net/corda/examples/yo/flows/YoFlow.java new file mode 100644 index 000000000..6e7718511 --- /dev/null +++ b/yo-cordapp/workflows-java/src/main/java/net/corda/examples/yo/flows/YoFlow.java @@ -0,0 +1,76 @@ +package net.corda.examples.yo.flows; + +import co.paralleluniverse.fibers.Suspendable; +import com.google.common.collect.ImmutableList; +import net.corda.core.contracts.Command; +import net.corda.core.contracts.StateAndContract; +import net.corda.core.flows.*; +import net.corda.core.identity.Party; +import net.corda.core.transactions.SignedTransaction; +import net.corda.core.transactions.TransactionBuilder; +import net.corda.core.utilities.ProgressTracker; +import net.corda.examples.yo.contracts.YoContract; +import net.corda.examples.yo.states.YoState; +import org.jetbrains.annotations.Nullable; + +import java.util.Objects; + +// ********* +// * Flows * +// ********* +@InitiatingFlow +@StartableByRPC +public class YoFlow extends FlowLogic { + private static final ProgressTracker.Step CREATING = new ProgressTracker.Step("Creating a new Yo!"); + private static final ProgressTracker.Step SIGNING = new ProgressTracker.Step("Signing the Yo!"); + private static final ProgressTracker.Step VERIFYING = new ProgressTracker.Step("Verfiying the Yo!"); + private static final ProgressTracker.Step FINALISING = new ProgressTracker.Step("Sending the Yo!") { + @Nullable + @Override + public ProgressTracker childProgressTracker() { + return FinalityFlow.tracker(); + } + }; + + ProgressTracker progressTracker = new ProgressTracker( + CREATING, + SIGNING, + VERIFYING, + FINALISING + ); + + @Nullable + @Override + public ProgressTracker getProgressTracker() { + return progressTracker; + } + + private final Party target; + + public YoFlow(Party target) { + this.target = target; + } + + @Suspendable + @Override + public SignedTransaction call() throws FlowException { + progressTracker.setCurrentStep(CREATING); + + Party me = getOurIdentity(); + Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0); + Command command = new Command(new YoContract.Commands.Send(), ImmutableList.of(me.getOwningKey())); + YoState state = new YoState(me, target); + StateAndContract stateAndContract = new StateAndContract(state, YoContract.ID); + TransactionBuilder utx = new TransactionBuilder(notary).withItems(stateAndContract, command); + + progressTracker.setCurrentStep(VERIFYING); + utx.verify(getServiceHub()); + + progressTracker.setCurrentStep(SIGNING); + SignedTransaction stx = getServiceHub().signInitialTransaction(utx); + + progressTracker.setCurrentStep(FINALISING); + FlowSession targetSession = initiateFlow(target); + return subFlow(new FinalityFlow(stx, ImmutableList.of(targetSession), Objects.requireNonNull(FINALISING.childProgressTracker()))); + } +} diff --git a/yo-cordapp/workflows-java/src/main/java/net/corda/examples/yo/flows/YoFlowResponder.java b/yo-cordapp/workflows-java/src/main/java/net/corda/examples/yo/flows/YoFlowResponder.java new file mode 100644 index 000000000..4e232696c --- /dev/null +++ b/yo-cordapp/workflows-java/src/main/java/net/corda/examples/yo/flows/YoFlowResponder.java @@ -0,0 +1,20 @@ +package net.corda.examples.yo.flows; + +import co.paralleluniverse.fibers.Suspendable; +import net.corda.core.flows.*; +import net.corda.core.transactions.SignedTransaction; + +@InitiatedBy(YoFlow.class) +public class YoFlowResponder extends FlowLogic { + private final FlowSession counterpartySession; + + public YoFlowResponder(FlowSession counterpartySession) { + this.counterpartySession = counterpartySession; + } + + @Suspendable + @Override + public SignedTransaction call() throws FlowException { + return subFlow(new ReceiveFinalityFlow(counterpartySession)); + } +} diff --git a/yo-cordapp/workflows-java/src/test/java/net/corda/examples/yo/FlowTests.java b/yo-cordapp/workflows-java/src/test/java/net/corda/examples/yo/FlowTests.java new file mode 100644 index 000000000..a00b64bb4 --- /dev/null +++ b/yo-cordapp/workflows-java/src/test/java/net/corda/examples/yo/FlowTests.java @@ -0,0 +1,51 @@ +package net.corda.examples.yo; + +import com.google.common.collect.ImmutableList; +import net.corda.core.concurrent.CordaFuture; +import net.corda.core.transactions.SignedTransaction; +import net.corda.examples.yo.flows.YoFlow; +import net.corda.examples.yo.flows.YoFlowResponder; +import net.corda.testing.node.MockNetwork; +import net.corda.testing.node.MockNetworkParameters; +import net.corda.testing.node.StartedMockNode; +import net.corda.testing.node.TestCordapp; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.util.concurrent.ExecutionException; + +public class FlowTests { + private final MockNetwork network = new MockNetwork(new MockNetworkParameters().withCordappsForAllNodes(ImmutableList.of( + TestCordapp.findCordapp("net.corda.examples.yo.contracts"), + TestCordapp.findCordapp("net.corda.examples.yo.flows") + ))); + private final StartedMockNode a = network.createNode(); + private final StartedMockNode b = network.createNode(); + + public FlowTests() { + ImmutableList.of(a, b).forEach(it -> { + it.registerInitiatedFlow(YoFlowResponder.class); + }); + } + + @Before + public void setup() { + network.runNetwork(); + } + + @After + public void tearDown() { + network.stopNodes(); + } + + //The yo flow should not have any input + //This test will check if the input list is empty + @Test + public void dummyTest() throws ExecutionException, InterruptedException { + CordaFuture future = a.startFlow(new YoFlow(b.getInfo().getLegalIdentities().get(0))); + network.runNetwork(); + SignedTransaction ptx = future.get(); + assert(ptx.getTx().getInputs().isEmpty()); + } +} diff --git a/yo-cordapp/workflows-java/src/test/java/net/corda/examples/yo/NodeDriver.java b/yo-cordapp/workflows-java/src/test/java/net/corda/examples/yo/NodeDriver.java new file mode 100644 index 000000000..8d50e473e --- /dev/null +++ b/yo-cordapp/workflows-java/src/test/java/net/corda/examples/yo/NodeDriver.java @@ -0,0 +1,34 @@ +package net.corda.examples.yo; + +import com.google.common.collect.ImmutableList; +import net.corda.core.identity.CordaX500Name; +import net.corda.testing.driver.Driver; +import net.corda.testing.driver.Driver.*; +import net.corda.testing.driver.DriverDSL; +import net.corda.testing.driver.DriverParameters; +import net.corda.testing.driver.NodeParameters; +import net.corda.testing.node.User; + +import java.util.Collections; +import java.util.List; +import java.util.concurrent.ExecutionException; + +/** + * Allows you to run your nodes through an IDE (as opposed to using deployNodes). Do not use in a production + * environment. + */ +public class NodeDriver { + public static void main(String[] args) { + List rpcUsers = ImmutableList.of(new User("user1", "test", Collections.singleton("ALL"))); + + Driver.driver(new DriverParameters().withStartNodesInProcess(true).withWaitForAllNodesToFinish(true), driverDSL -> { + try { + driverDSL.startNode(new NodeParameters().withProvidedName(new CordaX500Name("PartyA", "London", "GB")).withRpcUsers(rpcUsers)).get(); + driverDSL.startNode(new NodeParameters().withProvidedName(new CordaX500Name("PartyB", "New York", "US")).withRpcUsers(rpcUsers)).get(); + } catch (InterruptedException | ExecutionException e) { + e.printStackTrace(); + } + return null; + }); + } +} diff --git a/yo-cordapp/workflows/build.gradle b/yo-cordapp/workflows-kotlin/build.gradle similarity index 97% rename from yo-cordapp/workflows/build.gradle rename to yo-cordapp/workflows-kotlin/build.gradle index 2c433a232..3b52fc3c1 100644 --- a/yo-cordapp/workflows/build.gradle +++ b/yo-cordapp/workflows-kotlin/build.gradle @@ -49,7 +49,7 @@ dependencies { testCompile "$corda_release_group:corda-node-driver:$corda_release_version" // CorDapp dependencies. - cordapp project(":contracts") + cordapp project(":contracts-kotlin") } task integrationTest(type: Test, dependsOn: []) { diff --git a/yo-cordapp/workflows/src/integrationTest/kotlin/net/corda/examples/yo/DriverBasedTest.kt b/yo-cordapp/workflows-kotlin/src/integrationTest/kotlin/net/corda/examples/yo/DriverBasedTest.kt similarity index 100% rename from yo-cordapp/workflows/src/integrationTest/kotlin/net/corda/examples/yo/DriverBasedTest.kt rename to yo-cordapp/workflows-kotlin/src/integrationTest/kotlin/net/corda/examples/yo/DriverBasedTest.kt diff --git a/yo-cordapp/workflows/src/main/kotlin/net/corda/examples/yo/flows/Flows.kt b/yo-cordapp/workflows-kotlin/src/main/kotlin/net/corda/examples/yo/flows/Flows.kt similarity index 97% rename from yo-cordapp/workflows/src/main/kotlin/net/corda/examples/yo/flows/Flows.kt rename to yo-cordapp/workflows-kotlin/src/main/kotlin/net/corda/examples/yo/flows/Flows.kt index 2ae1515d0..f856de3eb 100644 --- a/yo-cordapp/workflows/src/main/kotlin/net/corda/examples/yo/flows/Flows.kt +++ b/yo-cordapp/workflows-kotlin/src/main/kotlin/net/corda/examples/yo/flows/Flows.kt @@ -22,7 +22,7 @@ class YoFlow(val target: Party) : FlowLogic() { companion object { object CREATING : ProgressTracker.Step("Creating a new Yo!") - object SIGNING : ProgressTracker.Step("Verifying the Yo!") + object SIGNING : ProgressTracker.Step("Signing the Yo!") object VERIFYING : ProgressTracker.Step("Verifying the Yo!") object FINALISING : ProgressTracker.Step("Sending the Yo!") { override fun childProgressTracker() = FinalityFlow.tracker() diff --git a/yo-cordapp/workflows/src/test/kotlin/net/corda/examples/yo/FlowTests.kt b/yo-cordapp/workflows-kotlin/src/test/kotlin/net/corda/examples/yo/FlowTests.kt similarity index 100% rename from yo-cordapp/workflows/src/test/kotlin/net/corda/examples/yo/FlowTests.kt rename to yo-cordapp/workflows-kotlin/src/test/kotlin/net/corda/examples/yo/FlowTests.kt diff --git a/yo-cordapp/workflows/src/test/kotlin/net/corda/examples/yo/NodeDriver.kt b/yo-cordapp/workflows-kotlin/src/test/kotlin/net/corda/examples/yo/NodeDriver.kt similarity index 100% rename from yo-cordapp/workflows/src/test/kotlin/net/corda/examples/yo/NodeDriver.kt rename to yo-cordapp/workflows-kotlin/src/test/kotlin/net/corda/examples/yo/NodeDriver.kt From 86a39559b3f04507c51ed6ef523e801497dbab0f Mon Sep 17 00:00:00 2001 From: peterli-r3 Date: Thu, 20 Feb 2020 14:38:57 -0500 Subject: [PATCH 3/3] Update Readme --- yo-cordapp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yo-cordapp/README.md b/yo-cordapp/README.md index 7b46e5b41..5dfe5f1b9 100644 --- a/yo-cordapp/README.md +++ b/yo-cordapp/README.md @@ -38,4 +38,4 @@ X500 name in the node shell. Note you can't sent a Yo! to yourself because that' To see all the Yo's! other nodes have sent you in your vault (you do not store the Yo's! you send yourself), run: - run vaultQuery contractStateType: com.yo.states.YoState + run vaultQuery contractStateType: net.corda.examples.yo.states.YoState