From 51dfe5dff643d17112cec23ed2527e1c81c7a9ea Mon Sep 17 00:00:00 2001 From: Tony Lawson Date: Tue, 18 Jul 2023 09:52:59 +0100 Subject: [PATCH 1/4] CORE-15561: Use Beta versions of the CSDE gradle plugin (#96) --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 0515780..2150187 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ combinedWorkerJarVersion=5.0.0.0-Iguana1.0 cordaPluginsVersion=7.0.3 # Specify the version of the CSDE gradle plugin to use -csdePluginVersion=1.2.0-alpha-+ +csdePluginVersion=1.2.0-beta-+ # Specify the name of the workflows module workflowsModule=workflows From 2d948c640150b59f12d71f40726a2a441aeafb9e Mon Sep 17 00:00:00 2001 From: "christian.n" <137180768+christian-napoles-r3@users.noreply.github.com> Date: Tue, 18 Jul 2023 10:56:00 +0100 Subject: [PATCH 2/4] CORE-15572: deleted stale todo comments (#97) --- contracts/build.gradle | 6 ------ workflows/build.gradle | 7 +------ 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/contracts/build.gradle b/contracts/build.gradle index cd962e8..db245bf 100644 --- a/contracts/build.gradle +++ b/contracts/build.gradle @@ -39,12 +39,6 @@ dependencies { // The CorDapp uses the slf4j logging framework. Corda-API provides this so we need a 'cordaProvided' declaration. 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 // Required testImplementation "org.slf4j:slf4j-simple:2.0.0" diff --git a/workflows/build.gradle b/workflows/build.gradle index 4196b47..c1cb258 100644 --- a/workflows/build.gradle +++ b/workflows/build.gradle @@ -40,18 +40,13 @@ dependencies { // The CorDapp uses the slf4j logging framework. Corda-API provides this so we need a 'cordaProvided' declaration. cordaProvided 'org.slf4j:slf4j-api' - // Dependencies Required By Simulator Tests - // 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 // Required testImplementation "org.slf4j:slf4j-simple:2.0.0" testImplementation "org.junit.jupiter:junit-jupiter:$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.kotlin:mockito-kotlin:$mockitoKotlinVersion" testImplementation "org.hamcrest:hamcrest-library:$hamcrestVersion" From 89dd476eb83a5ce560fcc43119e8bfdc1970f75a Mon Sep 17 00:00:00 2001 From: Christian Napoles Date: Tue, 18 Jul 2023 14:14:14 +0100 Subject: [PATCH 3/4] CORE-15443: release ga-rc12 prep --- build.gradle | 3 +- config/r3-ca-key.pem | 64 ++++---- contracts/build.gradle | 2 - .../ChatContractCreateCommandTest.kt | 150 ----------------- .../ChatContractUpdateCommandTest.kt | 152 ------------------ gradle.properties | 8 +- settings.gradle | 2 + 7 files changed, 37 insertions(+), 344 deletions(-) delete mode 100644 contracts/src/test/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContractCreateCommandTest.kt delete mode 100644 contracts/src/test/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContractUpdateCommandTest.kt diff --git a/build.gradle b/build.gradle index d3e1eb0..2b9c7ac 100644 --- a/build.gradle +++ b/build.gradle @@ -32,7 +32,6 @@ allprojects { cordaDbContainerName = "CSDEpostgresql" cordaBinDir = "${System.getProperty("user.home")}/.corda/corda5" cordaCliBinDir = "${System.getProperty("user.home")}/.corda/cli" - cpiUploadTimeout = cpiUploadDefault } // Declare the set of Kotlin compiler options we need to build a CorDapp. @@ -67,6 +66,8 @@ allprojects { mavenLocal() mavenCentral() + //todo remove for actual GA + // R3 Internal repositories for dev // Repository provides Corda 5 binaries that implement Corda-API. // These will be made publicly available. diff --git a/config/r3-ca-key.pem b/config/r3-ca-key.pem index 640c152..a803613 100644 --- a/config/r3-ca-key.pem +++ b/config/r3-ca-key.pem @@ -1,38 +1,32 @@ -----BEGIN CERTIFICATE----- -MIIGsDCCBJigAwIBAgIQCK1AsmDSnEyfXs2pvZOu2TANBgkqhkiG9w0BAQwFADBi +MIIFkDCCA3igAwIBAgIQBZsbV56OITLiOQe9p3d1XDANBgkqhkiG9w0BAQwFADBi MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3Qg -RzQwHhcNMjEwNDI5MDAwMDAwWhcNMzYwNDI4MjM1OTU5WjBpMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xQTA/BgNVBAMTOERpZ2lDZXJ0IFRy -dXN0ZWQgRzQgQ29kZSBTaWduaW5nIFJTQTQwOTYgU0hBMzg0IDIwMjEgQ0ExMIIC -IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA1bQvQtAorXi3XdU5WRuxiEL1 -M4zrPYGXcMW7xIUmMJ+kjmjYXPXrNCQH4UtP03hD9BfXHtr50tVnGlJPDqFX/IiZ -wZHMgQM+TXAkZLON4gh9NH1MgFcSa0OamfLFOx/y78tHWhOmTLMBICXzENOLsvsI -8IrgnQnAZaf6mIBJNYc9URnokCF4RS6hnyzhGMIazMXuk0lwQjKP+8bqHPNlaJGi -TUyCEUhSaN4QvRRXXegYE2XFf7JPhSxIpFaENdb5LpyqABXRN/4aBpTCfMjqGzLm -ysL0p6MDDnSlrzm2q2AS4+jWufcx4dyt5Big2MEjR0ezoQ9uo6ttmAaDG7dqZy3S -vUQakhCBj7A7CdfHmzJawv9qYFSLScGT7eG0XOBv6yb5jNWy+TgQ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GjUI+iLUaJW+fCm +gKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP82Z+ +-----END CERTIFICATE----- \ No newline at end of file diff --git a/contracts/build.gradle b/contracts/build.gradle index db245bf..da26473 100644 --- a/contracts/build.gradle +++ b/contracts/build.gradle @@ -49,8 +49,6 @@ dependencies { testImplementation "org.mockito:mockito-core:$mockitoVersion" testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion" testImplementation "org.hamcrest:hamcrest-library:$hamcrestVersion" - testImplementation "com.r3.corda.ledger.utxo:contract-testing:$contractTestingVersion" - testImplementation "com.r3.corda.ledger.utxo:contract-testing-kotlin:$contractTestingVersion" } // The CordApp section. diff --git a/contracts/src/test/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContractCreateCommandTest.kt b/contracts/src/test/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContractCreateCommandTest.kt deleted file mode 100644 index da12767..0000000 --- a/contracts/src/test/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContractCreateCommandTest.kt +++ /dev/null @@ -1,150 +0,0 @@ -package com.r3.developers.csdetemplate.utxoexample.contracts - -import com.r3.corda.ledger.utxo.testing.ContractTest -import com.r3.corda.ledger.utxo.testing.buildTransaction -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.CREATE_COMMAND_SHOULD_HAVE_NO_INPUT_STATES -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.CREATE_COMMAND_SHOULD_HAVE_ONLY_ONE_OUTPUT_STATE -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.OUTPUT_STATE_SHOULD_ONLY_HAVE_TWO_PARTICIPANTS -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.REQUIRE_SINGLE_COMMAND -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.TRANSACTION_SHOULD_BE_SIGNED_BY_ALL_PARTICIPANTS -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.UNKNOWN_COMMAND -import com.r3.developers.csdetemplate.utxoexample.states.ChatState -import net.corda.v5.ledger.utxo.Command -import org.junit.jupiter.api.Test -import java.util.* - -class ChatContractCreateCommandTest : ContractTest() { - - private val outputChatStateChatName = "aliceChatName" - private val outputChatStateChatMessage = "aliceChatMessage" - internal val outputChatState = ChatState( - UUID.randomUUID(), - outputChatStateChatName, - aliceName, - outputChatStateChatMessage, - listOf(aliceKey, bobKey) - ) - - @Test - fun happyPath() { - val transaction = buildTransaction { - addOutputState(outputChatState) - addCommand(ChatContract.Create()) - addSignatories(outputChatState.participants) - } - assertVerifies(transaction) - } - - @Test - fun missingCommand() { - val transaction = buildTransaction { - addOutputState(outputChatState) - addSignatories(outputChatState.participants) - } - assertFailsWith(transaction, REQUIRE_SINGLE_COMMAND) - } - - @Test - fun shouldNotAcceptUnknownCommand() { - class MyDummyCommand : Command - - val transaction = buildTransaction { - addOutputState(outputChatState) - addCommand(MyDummyCommand()) - addSignatories(outputChatState.participants) - } - - assertFailsWith(transaction, UNKNOWN_COMMAND) - } - - @Test - fun outputStateCannotHaveZeroParticipants() { - val state = ChatState( - UUID.randomUUID(), - "myChatName", - aliceName, - "myChatMessage", - emptyList() - ) - val transaction = buildTransaction { - addOutputState(state) - addCommand(ChatContract.Create()) - } - assertFailsWith(transaction, "Failed requirement: $OUTPUT_STATE_SHOULD_ONLY_HAVE_TWO_PARTICIPANTS") - } - - @Test - fun outputStateCannotHaveOneParticipant() { - val state = ChatState( - UUID.randomUUID(), - "myChatName", - aliceName, - "myChatMessage", - listOf(aliceKey) - ) - val transaction = buildTransaction { - addOutputState(state) - addCommand(ChatContract.Create()) - } - assertFailsWith(transaction, "Failed requirement: $OUTPUT_STATE_SHOULD_ONLY_HAVE_TWO_PARTICIPANTS") - } - - @Test - fun outputStateCannotHaveThreeParticipants() { - val state = ChatState( - UUID.randomUUID(), - "myChatName", - aliceName, - "myChatMessage", - listOf(aliceKey, bobKey, charlieKey) - ) - val transaction = buildTransaction { - addOutputState(state) - addCommand(ChatContract.Create()) - } - assertFailsWith(transaction, "Failed requirement: $OUTPUT_STATE_SHOULD_ONLY_HAVE_TWO_PARTICIPANTS") - } - - @Test - fun shouldBeSigned() { - val transaction = buildTransaction { - addOutputState(outputChatState) - addCommand(ChatContract.Create()) - } - assertFailsWith(transaction, "Failed requirement: $TRANSACTION_SHOULD_BE_SIGNED_BY_ALL_PARTICIPANTS") - } - - @Test - fun cannotBeSignedByOnlyOneParticipant() { - val transaction = buildTransaction { - addOutputState(outputChatState) - addCommand(ChatContract.Create()) - addSignatories(outputChatState.participants[0]) - } - assertFailsWith(transaction, "Failed requirement: $TRANSACTION_SHOULD_BE_SIGNED_BY_ALL_PARTICIPANTS") - } - - @Test - fun shouldNotIncludeInputState() { - happyPath() // generate an existing state to search for - val existingState = ledgerService.findUnconsumedStatesByType(ChatState::class.java).first() // doesn't matter which as this will fail validation - val transaction = buildTransaction { - addInputState(existingState.ref) - addOutputState(outputChatState) - addCommand(ChatContract.Create()) - addSignatories(outputChatState.participants) - } - assertFailsWith(transaction, "Failed requirement: $CREATE_COMMAND_SHOULD_HAVE_NO_INPUT_STATES") - } - - @Test - fun shouldNotHaveTwoOutputStates() { - val transaction = buildTransaction { - addOutputState(outputChatState) - addOutputState(outputChatState) - addCommand(ChatContract.Create()) - addSignatories(outputChatState.participants) - } - assertFailsWith(transaction, "Failed requirement: $CREATE_COMMAND_SHOULD_HAVE_ONLY_ONE_OUTPUT_STATE") - } -} \ No newline at end of file diff --git a/contracts/src/test/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContractUpdateCommandTest.kt b/contracts/src/test/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContractUpdateCommandTest.kt deleted file mode 100644 index fbe5189..0000000 --- a/contracts/src/test/kotlin/com/r3/developers/csdetemplate/utxoexample/contracts/ChatContractUpdateCommandTest.kt +++ /dev/null @@ -1,152 +0,0 @@ -package com.r3.developers.csdetemplate.utxoexample.contracts - -import com.r3.corda.ledger.utxo.testing.ContractTest -import com.r3.corda.ledger.utxo.testing.buildTransaction -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.TRANSACTION_SHOULD_BE_SIGNED_BY_ALL_PARTICIPANTS -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.UPDATE_COMMAND_CHATNAME_SHOULD_NOT_CHANGE -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.UPDATE_COMMAND_ID_SHOULD_NOT_CHANGE -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.UPDATE_COMMAND_PARTICIPANTS_SHOULD_NOT_CHANGE -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.UPDATE_COMMAND_SHOULD_HAVE_ONLY_ONE_INPUT_STATE -import com.r3.developers.csdetemplate.utxoexample.contracts.ChatContract.Companion.UPDATE_COMMAND_SHOULD_HAVE_ONLY_ONE_OUTPUT_STATE -import com.r3.developers.csdetemplate.utxoexample.states.ChatState -import net.corda.v5.ledger.utxo.StateAndRef -import org.junit.jupiter.api.Test -import java.util.* - -class ChatContractUpdateCommandTest : ContractTest() { - - @Suppress("UNCHECKED_CAST") - private fun createInitialChatState(): StateAndRef { - val outputState = ChatContractCreateCommandTest().outputChatState - val transaction = buildTransaction { - addOutputState(outputState) - addCommand(ChatContract.Create()) - addSignatories(outputState.participants) - } - transaction.toLedgerTransaction() - return transaction.outputStateAndRefs.first() as StateAndRef - } - - @Test - fun happyPath() { - val existingState = createInitialChatState() - val updatedOutputChatState = existingState.state.contractState.updateMessage(bobName, "bobResponse") - val transaction = buildTransaction { - addInputState(existingState.ref) - addOutputState(updatedOutputChatState) - addCommand(ChatContract.Update()) - addSignatories(updatedOutputChatState.participants) - } - assertVerifies(transaction) - } - - @Test - fun shouldNotHaveNoInputState(){ - val existingState = createInitialChatState() - val updatedOutputChatState = existingState.state.contractState.updateMessage(bobName, "bobResponse") - val transaction = buildTransaction { - addOutputState(updatedOutputChatState) - addCommand(ChatContract.Update()) - addSignatories(updatedOutputChatState.participants) - } - assertFailsWith(transaction, "Failed requirement: $UPDATE_COMMAND_SHOULD_HAVE_ONLY_ONE_INPUT_STATE") - } - - @Test - fun shouldNotHaveTwoInputStates(){ - val existingState = createInitialChatState() - val updatedOutputChatState = existingState.state.contractState.updateMessage(bobName, "bobResponse") - val transaction = buildTransaction { - addInputState(existingState.ref) - addInputState(existingState.ref) - addOutputState(updatedOutputChatState) - addCommand(ChatContract.Update()) - addSignatories(updatedOutputChatState.participants) - } - assertFailsWith(transaction, "Failed requirement: $UPDATE_COMMAND_SHOULD_HAVE_ONLY_ONE_INPUT_STATE") - } - - @Test - fun shouldNotHaveTwoOutputStates(){ - val existingState = createInitialChatState() - val updatedOutputChatState = existingState.state.contractState.updateMessage(bobName, "bobResponse") - val transaction = buildTransaction { - addInputState(existingState.ref) - addOutputState(updatedOutputChatState) - addOutputState(updatedOutputChatState) - addCommand(ChatContract.Update()) - addSignatories(updatedOutputChatState.participants) - } - assertFailsWith(transaction, "Failed requirement: $UPDATE_COMMAND_SHOULD_HAVE_ONLY_ONE_OUTPUT_STATE") - } - - @Test - fun idShouldNotChange(){ - val existingState = createInitialChatState() - val updatedOutputChatState = existingState.state.contractState - .updateMessage(bobName, "bobResponse") - .copy(id = UUID.randomUUID()) - val transaction = buildTransaction { - addInputState(existingState.ref) - addOutputState(updatedOutputChatState) - addCommand(ChatContract.Update()) - addSignatories(updatedOutputChatState.participants) - } - assertFailsWith(transaction, "Failed requirement: $UPDATE_COMMAND_ID_SHOULD_NOT_CHANGE") - } - - @Test - fun chatNameShouldNotChange(){ - val existingState = createInitialChatState() - val updatedOutputChatState = existingState.state.contractState - .updateMessage(bobName, "bobResponse") - .copy(chatName = "newName") - val transaction = buildTransaction { - addInputState(existingState.ref) - addOutputState(updatedOutputChatState) - addCommand(ChatContract.Update()) - addSignatories(updatedOutputChatState.participants) - } - assertFailsWith(transaction, "Failed requirement: $UPDATE_COMMAND_CHATNAME_SHOULD_NOT_CHANGE") - } - - @Test - fun participantsShouldNotChange(){ - val existingState = createInitialChatState() - val updatedOutputChatState = existingState.state.contractState - .updateMessage(bobName, "bobResponse") - .copy(participants = listOf(bobKey, charlieKey)) - val transaction = buildTransaction { - addInputState(existingState.ref) - addOutputState(updatedOutputChatState) - addCommand(ChatContract.Update()) - addSignatories(updatedOutputChatState.participants) - } - assertFailsWith(transaction, "Failed requirement: $UPDATE_COMMAND_PARTICIPANTS_SHOULD_NOT_CHANGE") - } - - @Test - fun outputStateMustBeSigned() { - val existingState = createInitialChatState() - val updatedOutputChatState = existingState.state.contractState.updateMessage(bobName, "bobResponse") - val transaction = buildTransaction { - addInputState(existingState.ref) - addOutputState(updatedOutputChatState) - addCommand(ChatContract.Update()) - } - assertFailsWith(transaction, "Failed requirement: $TRANSACTION_SHOULD_BE_SIGNED_BY_ALL_PARTICIPANTS") - } - - @Test - fun outputStateCannotBeSignedByOnlyOneParticipant() { - val existingState = createInitialChatState() - val updatedOutputChatState = existingState.state.contractState.updateMessage(bobName, "bobResponse") - val transaction = buildTransaction { - addInputState(existingState.ref) - addOutputState(updatedOutputChatState) - addCommand(ChatContract.Update()) - addSignatories(updatedOutputChatState.participants[0]) - } - assertFailsWith(transaction, "Failed requirement: $TRANSACTION_SHOULD_BE_SIGNED_BY_ALL_PARTICIPANTS") - } -} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 2150187..6c184c3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,11 +2,11 @@ kotlin.code.style=official # 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. -cordaApiVersion=5.0.0.763-Iguana1.0 +cordaApiVersion=5.0.0.765-GA-RC12 # 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. -cordaNotaryPluginsVersion=5.0.0.0-Iguana1.0 +cordaNotaryPluginsVersion=5.0.0.0-GA-RC12 # Specify the version of the Combined Worker to use combinedWorkerJarVersion=5.0.0.0-Iguana1.0 @@ -15,7 +15,7 @@ combinedWorkerJarVersion=5.0.0.0-Iguana1.0 cordaPluginsVersion=7.0.3 # Specify the version of the CSDE gradle plugin to use -csdePluginVersion=1.2.0-beta-+ +csdePluginVersion=1.1.0 # Specify the name of the workflows module workflowsModule=workflows @@ -35,13 +35,13 @@ junitVersion = 5.8.2 mockitoKotlinVersion=4.0.0 mockitoVersion=4.6.1 hamcrestVersion=2.2 -contractTestingVersion=0.9.0-beta-+ # Specify the maximum amount of time allowed for the CPI upload # As your CorDapp grows you might need to increase this # Value is in milliseconds cpiUploadDefault=10000 +#todo remove for actual GA build # 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 diff --git a/settings.gradle b/settings.gradle index 6b718c0..15b29ef 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,6 +4,8 @@ pluginManagement { gradlePluginPortal() mavenCentral() mavenLocal() + + //todo remove for actual GA maven { url = "$artifactoryContextUrl/corda-os-maven" authentication { From 48024f84e5f0a8850126c089522cc19be8fbb5c3 Mon Sep 17 00:00:00 2001 From: Christian Napoles Date: Tue, 18 Jul 2023 14:42:21 +0100 Subject: [PATCH 4/4] CORE-15443: update combined worker version to RC12 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 6c184c3..fdcf8a7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ cordaApiVersion=5.0.0.765-GA-RC12 cordaNotaryPluginsVersion=5.0.0.0-GA-RC12 # Specify the version of the Combined Worker to use -combinedWorkerJarVersion=5.0.0.0-Iguana1.0 +combinedWorkerJarVersion=5.0.0.0-GA-RC12 # Specify the version of the cordapp-cpb and cordapp-cpk plugins cordaPluginsVersion=7.0.3