Skip to content

Commit 5948633

Browse files
committed
obligation cordapp cleaned
1 parent 55d2d98 commit 5948633

File tree

23 files changed

+314
-340
lines changed

23 files changed

+314
-340
lines changed

Advanced/obligation-cordapp/build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ allprojects {
6060
}
6161

6262

63-
64-
6563
apply plugin: 'net.corda.plugins.cordapp'
6664
apply plugin: 'net.corda.plugins.cordformation'
6765
apply plugin: 'net.corda.plugins.quasar-utils'
@@ -75,15 +73,18 @@ sourceSets {
7573
}
7674

7775
dependencies {
76+
7877
// Corda dependencies.
7978
cordaCompile "$corda_core_release_group:corda-core:$corda_core_release_version"
8079
cordaCompile "$corda_release_group:corda-finance-contracts:$corda_release_version"
8180
cordaCompile "$corda_release_group:corda-finance-workflows:$corda_release_version"
8281
cordaCompile "$corda_release_group:corda-node-api:$corda_release_version"
8382
cordaRuntime "$corda_release_group:corda:$corda_release_version"
83+
8484
// CorDapp dependencies.
8585
cordapp project(":workflows")
8686
cordapp project(":contracts")
87+
8788
cordapp "$corda_release_group:corda-finance-contracts:$corda_release_version"
8889
cordapp "$corda_release_group:corda-finance-workflows:$corda_release_version"
8990
cordapp "$corda_release_group:corda-confidential-identities:$corda_release_version"
@@ -95,7 +96,7 @@ dependencies {
9596

9697
cordapp {
9798
info {
98-
name "CorDapp Template"
99+
name "Obligation Cordapp"
99100
vendor "Corda Open Source"
100101
targetPlatformVersion corda_platform_version
101102
minimumPlatformVersion corda_platform_version
@@ -107,8 +108,10 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
107108
projectCordapp {
108109
deploy = false
109110
}
110-
cordapp project(':contracts')
111-
cordapp project(':workflows')
111+
112+
cordapp project(":workflows")
113+
cordapp project(":contracts")
114+
112115
runSchemaMigration = true
113116
cordapp("$corda_release_group:corda-finance-contracts:$corda_release_version")
114117
cordapp("$corda_release_group:corda-finance-workflows:$corda_release_version")

Advanced/obligation-cordapp/clients/src/main/java/net/corda/samples/server/MainController.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
import net.corda.core.node.NodeInfo;
1010
import net.corda.core.transactions.SignedTransaction;
1111
import net.corda.finance.contracts.asset.Cash;
12-
import net.corda.samples.flows.IOUIssueFlow;
13-
import net.corda.samples.flows.IOUSettleFlow;
14-
import net.corda.samples.flows.IOUTransferFlow;
15-
import net.corda.samples.flows.SelfIssueCashFlow;
16-
import net.corda.samples.states.IOUState;
12+
import net.corda.samples.obligation.flow.IOUIssueFlow;
13+
import net.corda.samples.obligation.flow.IOUSettleFlow;
14+
import net.corda.samples.obligation.flow.IOUTransferFlow;
15+
import net.corda.samples.obligation.flow.SelfIssueCashFlow;
16+
import net.corda.samples.obligation.state.IOUState;
1717
import java.time.LocalDateTime;
1818
import java.time.ZoneId;
1919
import java.util.*;
@@ -122,12 +122,12 @@ private String notaries() {
122122
return proxy.notaryIdentities().toString();
123123
}
124124

125-
@GetMapping(value = "/flows", produces = TEXT_PLAIN_VALUE)
125+
@GetMapping(value = "/flow", produces = TEXT_PLAIN_VALUE)
126126
private String flows() {
127127
return proxy.registeredFlows().toString();
128128
}
129129

130-
@GetMapping(value = "/states", produces = TEXT_PLAIN_VALUE)
130+
@GetMapping(value = "/state", produces = TEXT_PLAIN_VALUE)
131131
private String states() {
132132
return proxy.vaultQuery(ContractState.class).getStates().toString();
133133
}
@@ -229,4 +229,4 @@ public ResponseEntity<String> selfIssueCash(@RequestParam(value = "amount") int
229229
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(e.getMessage());
230230
}
231231
}
232-
}
232+
}

Advanced/obligation-cordapp/contracts/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cordapp {
55
targetPlatformVersion corda_platform_version
66
minimumPlatformVersion corda_platform_version
77
contract {
8-
name "Template CorDapp"
8+
name "Obligation Cordapp Contracts"
99
vendor "Corda Open Source"
1010
licence "Apache License, Version 2.0"
1111
versionId 1
@@ -20,7 +20,7 @@ sourceSets {
2020
}
2121
}
2222
test{
23-
java{
23+
java {
2424
srcDir 'src/test/java'
2525
java.outputDir = file('bin/test')
2626
}
@@ -37,4 +37,4 @@ dependencies {
3737
testCompile "$corda_release_group:corda-node-driver:$corda_release_version"
3838
cordapp "$corda_release_group:corda-finance-contracts:$corda_release_version"
3939
cordapp "$corda_release_group:corda-finance-workflows:$corda_release_version"
40-
}
40+
}

Advanced/obligation-cordapp/contracts/src/main/java/net/corda/samples/contracts/IOUContract.java renamed to Advanced/obligation-cordapp/contracts/src/main/java/net/corda/samples/obligation/contract/IOUContract.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.corda.samples.contracts;
1+
package net.corda.samples.obligation.contract;
22

33
import net.corda.core.contracts.*;
44

@@ -9,7 +9,7 @@
99
import net.corda.core.identity.Party;
1010
import net.corda.core.transactions.LedgerTransaction;
1111
import net.corda.finance.contracts.asset.Cash;
12-
import net.corda.samples.states.IOUState;
12+
import net.corda.samples.obligation.state.IOUState;
1313

1414
import java.security.PublicKey;
1515
import java.util.*;
@@ -24,7 +24,7 @@
2424

2525
@LegalProseReference(uri = "<prose_contract_uri>")
2626
public class IOUContract implements Contract {
27-
public static final String IOU_CONTRACT_ID = "net.corda.samples.contracts.IOUContract";
27+
public static final String IOU_CONTRACT_ID = "net.corda.samples.obligation.contract.IOUContract";
2828

2929
/**
3030
* The IOUContract can handle three transaction types involving [IOUState]s.
@@ -123,7 +123,7 @@ else if (commandData.equals(new Commands.Settle())) {
123123
List<LedgerTransaction.InOutGroup<IOUState, UniqueIdentifier>> groups = tx.groupStates(IOUState.class, IOUState::getLinearId);
124124
require.using("There must be one input IOU.", groups.get(0).getInputs().size() > 0);
125125

126-
// Check that there are output cash states.
126+
// Check that there are output cash state.
127127
List<Cash.State> allOutputCash = tx.outputsOfType(Cash.State.class);
128128
require.using("There must be output cash.", !allOutputCash.isEmpty());
129129

@@ -177,4 +177,4 @@ else if (commandData.equals(new Commands.Settle())) {
177177

178178
}
179179

180-
}
180+
}

Advanced/obligation-cordapp/contracts/src/main/java/net/corda/samples/states/IOUState.java renamed to Advanced/obligation-cordapp/contracts/src/main/java/net/corda/samples/obligation/state/IOUState.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.corda.samples.states;
1+
package net.corda.samples.obligation.state;
22

33
import net.corda.core.contracts.*;
44
import net.corda.core.identity.Party;
@@ -7,7 +7,7 @@
77
import java.util.*;
88
import com.google.common.collect.ImmutableList;
99
import net.corda.core.serialization.ConstructorForDeserialization;
10-
import net.corda.samples.contracts.IOUContract;
10+
import net.corda.samples.obligation.contract.IOUContract;
1111

1212
/**
1313
* The IOU State object, with the following properties:
@@ -16,7 +16,7 @@
1616
* - [borrower] The borrowing party.
1717
* - [contract] Holds a reference to the [IOUContract]
1818
* - [paid] Records how much of the [amount] has been paid.
19-
* - [linearId] A unique id shared by all LinearState states representing the same agreement throughout history within
19+
* - [linearId] A unique id shared by all LinearState state representing the same agreement throughout history within
2020
* the vaults of all parties. Verify methods should check that one input and one output share the id in a transaction,
2121
* except at issuance/termination.
2222
*/
@@ -93,4 +93,4 @@ public IOUState copy(Amount<Currency> amount, Party lender, Party borrower, Amou
9393
return new IOUState(amount, lender, borrower, paid, this.getLinearId());
9494
}
9595

96-
}
96+
}

Advanced/obligation-cordapp/contracts/src/test/java/net/corda/samples/contracts/ContractTests.java

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package net.corda.samples.obligation;
2+
3+
import net.corda.core.identity.CordaX500Name;
4+
import net.corda.testing.core.TestIdentity;
5+
6+
public class TestUtils {
7+
public static TestIdentity ALICE = new TestIdentity(new CordaX500Name("Alice", "TestLand", "US"));
8+
public static TestIdentity BOB = new TestIdentity(new CordaX500Name("Bob", "TestCity", "US"));
9+
public static TestIdentity CHARLIE = new TestIdentity(new CordaX500Name("Charlie", "TestVillage", "US"));
10+
public static TestIdentity MINICORP = new TestIdentity(new CordaX500Name("MiniCorp", "MiniLand", "US"));
11+
public static TestIdentity MEGACORP = new TestIdentity(new CordaX500Name("MegaCorp", "MiniLand", "US"));
12+
public static TestIdentity DUMMY = new TestIdentity(new CordaX500Name("Dummy", "FakeLand", "US"));
13+
}

0 commit comments

Comments
 (0)