Compare commits

...

10 Commits

Author SHA1 Message Date
christian.n
fc3092622c
CORE-15746: updated README file (#64) 2023-07-25 14:49:50 +01:00
christian.n
15f1043a39
CORE-15541: release ga builds prep (#61)
* CORE-15561: Use Beta versions of the CSDE gradle plugin (#58)

* CORE-15572: deleted stale todo comment (#59)

* CORE-15541: release ga-rc12 prep

* CORE:15541: update combined worker version to RC12

* CORE-15541: release ga build prep

---------

Co-authored-by: Tony Lawson <tony.lawson@r3.com>
2023-07-24 11:53:41 +01:00
nargas-ritu
bb380544d6
Update .snyk for the latest updates (#55) 2023-07-10 17:10:01 +01:00
Tony Lawson
0adc8292d5
CORE-15002: Suppress unchecked cast warning in contract test (#53) 2023-06-29 10:01:40 +01:00
Tony Lawson
20e3dd38b3
CORE-14586: Utxo Example Contract Tests (#51)
* CORE-14586: Utxo Example Contract Tests

* CORE-14586: Use beta builds rather than alpha builds

* CORE-14586: Add signing constraint
2023-06-23 14:37:51 +01:00
Ronan Browne
7b3144001d
ES-650: use latest version of shared lib (#52)
* ES-650: use latest version of shared lib
* Add ES title check
2023-06-21 10:46:15 +01:00
Tony Lawson
98a12b2825
CORE-14330: Configure CPI upload timeout (#50) 2023-06-15 16:43:29 +01:00
Tony Lawson
a7592dde96
CORE-14091: Beta 4 Iguana1.0 (#47) 2023-05-26 16:26:25 +01:00
Tony Lawson
dce1f36199
CORE-13823: Configure workflows module name (#46) 2023-05-18 16:31:28 +01:00
Tony Lawson
abe04744df
CORE-13662: GA RC05 (#45) 2023-05-15 10:36:45 +01:00
11 changed files with 44 additions and 77 deletions

2
.ci/Jenkinsfile vendored
View File

@ -1,4 +1,4 @@
@Library('corda-shared-build-pipeline-steps@5.0') _ @Library('corda-shared-build-pipeline-steps@5.1') _
cordaPipeline( cordaPipeline(
nexusAppId: 'com.corda.CSDE-Java.5.0', nexusAppId: 'com.corda.CSDE-Java.5.0',

View File

@ -1,4 +1,4 @@
@Library('corda-shared-build-pipeline-steps@5.0') _ @Library('corda-shared-build-pipeline-steps@5.1') _
cordaSnykScanPipeline ( cordaSnykScanPipeline (
snykTokenId: 'r3-snyk-corda5', snykTokenId: 'r3-snyk-corda5',

View File

@ -9,6 +9,6 @@ jobs:
steps: steps:
- uses: morrisoncole/pr-lint-action@v1.6.1 - uses: morrisoncole/pr-lint-action@v1.6.1
with: with:
title-regex: '^((CORDA|EG|ENT|INFRA|CORE)-\d+)(.*)' title-regex: '^((CORDA|EG|ENT|INFRA|CORE|ES)-\d+)(.*)'
on-failed-regex-comment: "PR title failed to match regex -> `%regex%`" on-failed-regex-comment: "PR title failed to match regex -> `%regex%`"
repo-token: "${{ secrets.GITHUB_TOKEN }}" repo-token: "${{ secrets.GITHUB_TOKEN }}"

10
.snyk
View File

@ -9,14 +9,6 @@ ignore:
temporary files (via Kotlin functions) with insecure permissions. temporary files (via Kotlin functions) with insecure permissions.
Corda does not use any of the vulnerable functions so it is not Corda does not use any of the vulnerable functions so it is not
susceptible to this vulnerability susceptible to this vulnerability
expires: 2023-06-19T17:15:26.836Z expires: 2023-10-19T17:15:26.836Z
created: 2023-02-02T17:15:26.839Z created: 2023-02-02T17:15:26.839Z
SNYK-JAVA-ORGJETBRAINSKOTLIN-2628385:
- '*':
reason: >-
corda-simulator-runtime is a testRuntimeOnly dependency, as such this
dependency will not be included in any cordaApp produced by the CSDE
project Template
expires: 2023-06-19T17:16:00.009Z
created: 2023-02-02T17:16:00.016Z
patch: {} patch: {}

View File

@ -3,7 +3,7 @@
To help make the process of prototyping CorDapps on Corda 5 more straight forward we have developed the Cordapp Standard Development Environment (CSDE). To help make the process of prototyping CorDapps on Corda 5 more straight forward we have developed the Cordapp Standard Development Environment (CSDE).
The CSDE is obtained by cloning this CSDE-Cordapp-Template-Java to your local machine. The CSDE provides: The CSDE is obtained by cloning this CSDE-Cordapp-Template-Java repository to your local machine. The CSDE provides:
- A pre-setup Cordapp Project which you can use as a starting point to develop your own prototypes. - A pre-setup Cordapp Project which you can use as a starting point to develop your own prototypes.
@ -19,10 +19,7 @@ The CSDE is obtained by cloning this CSDE-Cordapp-Template-Java to your local ma
- Ability to configure the Members of the Local Corda Network. - Ability to configure the Members of the Local Corda Network.
Note, the CSDE is experimental, we may or may not release it as part of Corda 5.0, in part based on developer feedback using it. To find out how to use the CSDE, please refer to the *Getting Started Using the CSDE* subsection within the *Developing Applications* section in the latest Corda 5 documentation at https://docs.r3.com/
To find out how to use the CSDE please refer to the getting started section in the Corda 5 Beta 2 documentation at https://docs.r3.com/
## Chat app ## Chat app

View File

@ -24,6 +24,7 @@ allprojects {
notaryCpiName = "NotaryServer" notaryCpiName = "NotaryServer"
cordaRpcUser = "admin" cordaRpcUser = "admin"
cordaRpcPasswd ="admin" cordaRpcPasswd ="admin"
workflowsModuleName = workflowsModule
csdeWorkspaceDir = "workspace" csdeWorkspaceDir = "workspace"
notaryVersion = cordaNotaryPluginsVersion notaryVersion = cordaNotaryPluginsVersion
combinedWorkerVersion = combinedWorkerJarVersion combinedWorkerVersion = combinedWorkerJarVersion
@ -45,22 +46,6 @@ allprojects {
// All dependencies are held in Maven Central // All dependencies are held in Maven Central
mavenLocal() mavenLocal()
mavenCentral() mavenCentral()
// R3 Internal repositories for dev
// Repository provides Corda 5 binaries that implement Corda-API.
// These will be made publicly available.
// Final location to be decided.
// Repository subject to change
maven {
url = "$artifactoryContextUrl/corda-os-maven"
authentication {
basic(BasicAuthentication)
}
credentials {
username = findProperty('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME')
password = findProperty('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD')
}
}
} }
tasks.withType(Test).configureEach { tasks.withType(Test).configureEach {

View File

@ -39,19 +39,13 @@ dependencies {
// The CorDapp uses the slf4j logging framework. Corda-API provides this so we need a 'cordaProvided' declaration. // The CorDapp uses the slf4j logging framework. Corda-API provides this so we need a 'cordaProvided' declaration.
cordaProvided 'org.slf4j:slf4j-api' cordaProvided 'org.slf4j:slf4j-api'
// This are shared so should be here.
// Dependencies Required By Test Tooling
// Todo: these are commented out as the simulator UTXO work has not been merged into Gecko yet.
// testImplementation "net.corda:corda-simulator-api:$simulatorVersion"
// testRuntimeOnly "net.corda:corda-simulator-runtime:$simulatorVersion"
// 3rd party libraries // 3rd party libraries
// Required // Required
testImplementation "org.slf4j:slf4j-simple:2.0.0" testImplementation "org.slf4j:slf4j-simple:2.0.0"
testImplementation "org.junit.jupiter:junit-jupiter:$junitVersion" testImplementation "org.junit.jupiter:junit-jupiter:$junitVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
// Optional but used by exmaple tests. // Optional but used by example tests.
testImplementation "org.mockito:mockito-core:$mockitoVersion" testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion" testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion"
testImplementation "org.hamcrest:hamcrest-library:$hamcrestVersion" testImplementation "org.hamcrest:hamcrest-library:$hamcrestVersion"

View File

@ -13,37 +13,54 @@ public class ChatContract implements Contract {
private final static Logger log = LoggerFactory.getLogger(ChatContract.class); private final static Logger log = LoggerFactory.getLogger(ChatContract.class);
// Use constants to hold the error messages
// This allows the tests to use them, meaning if they are updated you won't need to fix tests just because the wording was updated
static final String REQUIRE_SINGLE_COMMAND = "Require a single command.";
static final String UNKNOWN_COMMAND = "Unsupported command";
static final String OUTPUT_STATE_SHOULD_ONLY_HAVE_TWO_PARTICIPANTS = "The output state should have two and only two participants.";
static final String TRANSACTION_SHOULD_BE_SIGNED_BY_ALL_PARTICIPANTS = "The transaction should have been signed by both participants.";
static final String CREATE_COMMAND_SHOULD_HAVE_NO_INPUT_STATES = "When command is Create there should be no input states.";
static final String CREATE_COMMAND_SHOULD_HAVE_ONLY_ONE_OUTPUT_STATE = "When command is Create there should be one and only one output state.";
static final String UPDATE_COMMAND_SHOULD_HAVE_ONLY_ONE_INPUT_STATE = "When command is Update there should be one and only one input state.";
static final String UPDATE_COMMAND_SHOULD_HAVE_ONLY_ONE_OUTPUT_STATE = "When command is Update there should be one and only one output state.";
static final String UPDATE_COMMAND_ID_SHOULD_NOT_CHANGE = "When command is Update id must not change.";
static final String UPDATE_COMMAND_CHATNAME_SHOULD_NOT_CHANGE = "When command is Update chatName must not change.";
static final String UPDATE_COMMAND_PARTICIPANTS_SHOULD_NOT_CHANGE = "When command is Update participants must not change.";
public static class Create implements Command { } public static class Create implements Command { }
public static class Update implements Command { } public static class Update implements Command { }
@Override @Override
public void verify(UtxoLedgerTransaction transaction) { public void verify(UtxoLedgerTransaction transaction) {
requireThat( transaction.getCommands().size() == 1, "Require a single command."); requireThat( transaction.getCommands().size() == 1, REQUIRE_SINGLE_COMMAND);
Command command = transaction.getCommands().get(0); Command command = transaction.getCommands().get(0);
ChatState output = transaction.getOutputStates(ChatState.class).get(0); ChatState output = transaction.getOutputStates(ChatState.class).get(0);
requireThat(output.getParticipants().size() == 2, "The output state should have two and only two participants."); requireThat(output.getParticipants().size() == 2, OUTPUT_STATE_SHOULD_ONLY_HAVE_TWO_PARTICIPANTS);
requireThat(transaction.getSignatories().containsAll(output.getParticipants()), TRANSACTION_SHOULD_BE_SIGNED_BY_ALL_PARTICIPANTS);
if(command.getClass() == Create.class) { if(command.getClass() == Create.class) {
requireThat(transaction.getInputContractStates().isEmpty(), "When command is Create there should be no input states."); requireThat(transaction.getInputContractStates().isEmpty(), CREATE_COMMAND_SHOULD_HAVE_NO_INPUT_STATES);
requireThat(transaction.getOutputContractStates().size() == 1, "When command is Create there should be one and only one output state."); requireThat(transaction.getOutputContractStates().size() == 1, CREATE_COMMAND_SHOULD_HAVE_ONLY_ONE_OUTPUT_STATE);
} }
else if(command.getClass() == Update.class) { else if(command.getClass() == Update.class) {
requireThat(transaction.getInputContractStates().size() == 1, "When command is Update there should be one and only one input state."); requireThat(transaction.getInputContractStates().size() == 1, UPDATE_COMMAND_SHOULD_HAVE_ONLY_ONE_INPUT_STATE);
requireThat(transaction.getOutputContractStates().size() == 1, "When command is Update there should be one and only one output state."); requireThat(transaction.getOutputContractStates().size() == 1, UPDATE_COMMAND_SHOULD_HAVE_ONLY_ONE_OUTPUT_STATE);
ChatState input = transaction.getInputStates(ChatState.class).get(0); ChatState input = transaction.getInputStates(ChatState.class).get(0);
requireThat(input.getId().equals(output.getId()), "When command is Update id must not change."); requireThat(input.getId().equals(output.getId()), UPDATE_COMMAND_ID_SHOULD_NOT_CHANGE);
requireThat(input.getChatName().equals(output.getChatName()), "When command is Update chatName must not change."); requireThat(input.getChatName().equals(output.getChatName()), UPDATE_COMMAND_CHATNAME_SHOULD_NOT_CHANGE);
requireThat( requireThat(
input.getParticipants().containsAll(output.getParticipants()) && input.getParticipants().containsAll(output.getParticipants()) &&
output.getParticipants().containsAll(input.getParticipants()), output.getParticipants().containsAll(input.getParticipants()),
"When command is Update participants must not change."); UPDATE_COMMAND_PARTICIPANTS_SHOULD_NOT_CHANGE);
} }
else { else {
throw new CordaRuntimeException("Unsupported command"); throw new CordaRuntimeException(UNKNOWN_COMMAND);
} }
} }

View File

@ -2,20 +2,23 @@ kotlin.code.style=official
# Specify the version of the Corda-API to use. # Specify the version of the Corda-API to use.
# This needs to match the version supported by the Corda Cluster the CorDapp will run on. # This needs to match the version supported by the Corda Cluster the CorDapp will run on.
cordaApiVersion=5.0.0.763-GA-RC04 cordaApiVersion=5.0.0.765
# Specify the version of the notary plugins to use. # Specify the version of the notary plugins to use.
# Currently packaged as part of corda-runtime-os, so should be set to a corda-runtime-os version. # Currently packaged as part of corda-runtime-os, so should be set to a corda-runtime-os version.
cordaNotaryPluginsVersion=5.0.0.0-GA-RC04 cordaNotaryPluginsVersion=5.0.0.0
# Specify the version of the Combined Worker to use # Specify the version of the Combined Worker to use
combinedWorkerJarVersion=5.0.0.0-GA-RC04 combinedWorkerJarVersion=5.0.0.0
# Specify the version of the cordapp-cpb and cordapp-cpk plugins # Specify the version of the cordapp-cpb and cordapp-cpk plugins
cordaPluginsVersion=7.0.3 cordaPluginsVersion=7.0.3
# Specify the version of the CSDE gradle plugin to use # Specify the version of the CSDE gradle plugin to use
csdePluginVersion=1.0.0-alpha-+ csdePluginVersion=1.1.0
# Specify the name of the workflows module
workflowsModule=workflows
# For the time being this just needs to be set to a dummy value. # For the time being this just needs to be set to a dummy value.
platformVersion = 999 platformVersion = 999
@ -32,8 +35,3 @@ junitVersion = 5.8.2
mockitoKotlinVersion=4.0.0 mockitoKotlinVersion=4.0.0
mockitoVersion=4.6.1 mockitoVersion=4.6.1
hamcrestVersion=2.2 hamcrestVersion=2.2
# R3 internal repository
# Use this version when pointing to artefacts in artifactory that have not been published to S3
artifactoryContextUrl=https://software.r3.com/artifactory

View File

@ -4,16 +4,6 @@ pluginManagement {
gradlePluginPortal() gradlePluginPortal()
mavenCentral() mavenCentral()
mavenLocal() mavenLocal()
maven {
url = "$artifactoryContextUrl/corda-os-maven"
authentication {
basic(BasicAuthentication)
}
credentials {
username = settings.ext.find('cordaArtifactoryUsername') ?: System.getenv('CORDA_ARTIFACTORY_USERNAME')
password = settings.ext.find('cordaArtifactoryPassword') ?: System.getenv('CORDA_ARTIFACTORY_PASSWORD')
}
}
} }
// The plugin dependencies with versions of the plugins congruent with the specified CorDapp plugin version, // The plugin dependencies with versions of the plugins congruent with the specified CorDapp plugin version,

View File

@ -40,12 +40,6 @@ dependencies {
// The CorDapp uses the slf4j logging framework. Corda-API provides this so we need a 'cordaProvided' declaration. // The CorDapp uses the slf4j logging framework. Corda-API provides this so we need a 'cordaProvided' declaration.
cordaProvided 'org.slf4j:slf4j-api' cordaProvided 'org.slf4j:slf4j-api'
// This are shared so should be here.
// Dependencies Required By Test Tooling
// Todo: these are commented out as the simulator UTXO work has not been merged into Gecko yet.
// testImplementation "net.corda:corda-simulator-api:$simulatorVersion"
// testRuntimeOnly "net.corda:corda-simulator-runtime:$simulatorVersion"
// 3rd party libraries // 3rd party libraries
// Required // Required
testImplementation "org.slf4j:slf4j-simple:2.0.0" testImplementation "org.slf4j:slf4j-simple:2.0.0"