diff --git a/constants.properties b/constants.properties index 8cdd9f18a5..82ecfebd2c 100644 --- a/constants.properties +++ b/constants.properties @@ -2,7 +2,7 @@ # because some versions here need to be matched by app authors in # their own projects. So don't get fancy with syntax! -cordaVersion=4.8.5.5-CONCLAVE-SNAPSHOT +cordaVersion=4.8.5.6-CONCLAVE-SNAPSHOT versionSuffix= gradlePluginsVersion=5.0.12 kotlinVersion=1.2.71 diff --git a/core/src/main/kotlin/net/corda/core/conclave/common/CordaEnclaveClient.kt b/core/src/main/kotlin/net/corda/core/conclave/common/CordaEnclaveClient.kt index fb6d1cacad..9ba94e146e 100644 --- a/core/src/main/kotlin/net/corda/core/conclave/common/CordaEnclaveClient.kt +++ b/core/src/main/kotlin/net/corda/core/conclave/common/CordaEnclaveClient.kt @@ -3,6 +3,7 @@ package net.corda.core.conclave.common import net.corda.core.conclave.common.dto.ConclaveLedgerTxModel import net.corda.core.conclave.common.dto.EncryptedVerifiableTxAndDependencies import net.corda.core.flows.FlowException +import net.corda.core.identity.CordaX500Name import net.corda.core.serialization.SingletonSerializeAsToken import net.corda.core.transactions.EncryptedTransaction import java.util.* @@ -112,7 +113,7 @@ interface CordaEnclaveClient { fun encryptEncryptedTransactionForRemote(invokeId: UUID, locallyEncryptedTx: EncryptedTransaction): EncryptedTransaction } -class DummyCordaEnclaveClient: CordaEnclaveClient, SingletonSerializeAsToken() { +class DummyCordaEnclaveClient(val x500: CordaX500Name): CordaEnclaveClient, SingletonSerializeAsToken() { override fun getEnclaveInstanceInfo(): ByteArray { throw UnsupportedOperationException("Add your custom enclave client implementation") diff --git a/core/src/main/kotlin/net/corda/core/node/services/EncryptedTransactionService.kt b/core/src/main/kotlin/net/corda/core/node/services/EncryptedTransactionService.kt index 7f37647f39..c5c2beaa73 100644 --- a/core/src/main/kotlin/net/corda/core/node/services/EncryptedTransactionService.kt +++ b/core/src/main/kotlin/net/corda/core/node/services/EncryptedTransactionService.kt @@ -5,12 +5,13 @@ import net.corda.core.conclave.common.DummyCordaEnclaveClient import net.corda.core.conclave.common.CordaEnclaveClient import net.corda.core.conclave.common.dto.ConclaveLedgerTxModel import net.corda.core.conclave.common.dto.EncryptedVerifiableTxAndDependencies +import net.corda.core.identity.CordaX500Name import net.corda.core.internal.FlowStateMachine import net.corda.core.serialization.SingletonSerializeAsToken import net.corda.core.transactions.EncryptedTransaction import java.util.* -class EncryptedTransactionService(val enclaveClient: CordaEnclaveClient = DummyCordaEnclaveClient()) : SingletonSerializeAsToken() { +class EncryptedTransactionService(val enclaveClient: CordaEnclaveClient = DummyCordaEnclaveClient(CordaX500Name("PartyDummy", "London", "GB" ))) : SingletonSerializeAsToken() { private fun getCurrentFlowIdOrGenerateNewInvokeId(): UUID { val currentFiber = Fiber.currentFiber() as? FlowStateMachine<*> diff --git a/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt b/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt index 83f76f3d3b..51978fe2b3 100644 --- a/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt +++ b/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt @@ -1068,8 +1068,10 @@ abstract class AbstractNode(val configuration: NodeConfiguration, } } + + return clazz?.let { - EncryptedTransactionService(Class.forName(it).getDeclaredConstructor().newInstance() as CordaEnclaveClient) + EncryptedTransactionService(Class.forName(it).getDeclaredConstructor(CordaX500Name::class.java).newInstance(configuration.myLegalName) as CordaEnclaveClient) } ?: run { EncryptedTransactionService() } diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockServices.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockServices.kt index a8f4f5ca5a..d99170f62e 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockServices.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockServices.kt @@ -89,7 +89,7 @@ open class MockServices private constructor( identityService, *arrayOf(initialIdentity.keyPair) + moreKeys ), - override val encryptedTransactionService : EncryptedTransactionService = makeEncryptedTransactionService(cordappLoader) + override val encryptedTransactionService : EncryptedTransactionService = makeEncryptedTransactionService(cordappLoader, initialIdentity) ) : ServiceHub { companion object { @@ -288,7 +288,7 @@ open class MockServices private constructor( attachment } - internal fun makeEncryptedTransactionService(cordappLoader: CordappLoader): EncryptedTransactionService { + internal fun makeEncryptedTransactionService(cordappLoader: CordappLoader, initialIdentity: TestIdentity): EncryptedTransactionService { val clazz = cordappLoader.cordapps .map { it.cordappClasses @@ -303,7 +303,7 @@ open class MockServices private constructor( } return clazz?.let { - EncryptedTransactionService(Class.forName(it).getDeclaredConstructor().newInstance() as CordaEnclaveClient) + EncryptedTransactionService(Class.forName(it).getDeclaredConstructor(CordaX500Name::class.java).newInstance(initialIdentity.name) as CordaEnclaveClient) } ?: run { EncryptedTransactionService() }