Mock node uses hard coded EnclaveClient instance

This commit is contained in:
adam.houston 2022-03-28 16:32:49 +01:00
parent a37486c6d7
commit dc840008f2

View File

@ -289,17 +289,11 @@ open class MockServices private constructor(
} }
internal fun makeEncryptedTransactionService(cordappLoader: CordappLoader, initialIdentity: TestIdentity): EncryptedTransactionService { internal fun makeEncryptedTransactionService(cordappLoader: CordappLoader, initialIdentity: TestIdentity): EncryptedTransactionService {
val clazz = cordappLoader.cordapps
.map { val clazz = try {
it.cordappClasses Class.forName("cbdc.r3.corda.conclave.client.CBDCEnclaveClient").name
} }catch(e: Exception) {
.flatten() null
.firstOrNull {
try {
it.contains("EnclaveClient") && Class.forName(it).interfaces.contains(CordaEnclaveClient::class.java)
} catch (e: NoClassDefFoundError) {
false
}
} }
return clazz?.let { return clazz?.let {