mirror of
https://github.com/corda/corda.git
synced 2025-04-19 08:36:39 +00:00
Merge fixes
This commit is contained in:
parent
4984e92e31
commit
7696a570d1
2
.idea/compiler.xml
generated
2
.idea/compiler.xml
generated
@ -165,6 +165,8 @@
|
||||
<module name="ha-testing_integrationTest" target="1.8" />
|
||||
<module name="ha-testing_main" target="1.8" />
|
||||
<module name="ha-testing_test" target="1.8" />
|
||||
<module name="health-survey_main" target="1.8" />
|
||||
<module name="health-survey_test" target="1.8" />
|
||||
<module name="hsm-tool_main" target="1.8" />
|
||||
<module name="hsm-tool_test" target="1.8" />
|
||||
<module name="intellij-plugin_main" target="1.8" />
|
||||
|
@ -411,7 +411,7 @@ bintrayConfig {
|
||||
'corda-notary-raft',
|
||||
'corda-notary-bft-smart',
|
||||
'corda-notary-jpa',
|
||||
'corda-notary-mysql'
|
||||
'corda-notary-mysql',
|
||||
'corda-common-configuration-parsing',
|
||||
'corda-common-validation'
|
||||
]
|
||||
|
@ -76,9 +76,9 @@ object JarSignatureCollector {
|
||||
Party(it.signerCertPath.certificates[0] as X509Certificate)
|
||||
}.sortedBy { it.name.toString() } // Sorted for determinism.
|
||||
|
||||
private fun Set<CodeSigner>.toPartiesOrderedByName(): List<Party> = map {
|
||||
Party(it.signerCertPath.certificates[0] as X509Certificate)
|
||||
}.sortedBy { it.name.toString() } // Sorted for determinism.
|
||||
private fun Set<CodeSigner>.toOrderedPublicKeys(): List<PublicKey> = map {
|
||||
(it.signerCertPath.certificates[0] as X509Certificate).publicKey
|
||||
}.sortedBy { it.hash} // Sorted for determinism.
|
||||
|
||||
private fun Set<CodeSigner>.toCertificates(): List<X509Certificate> = map {
|
||||
it.signerCertPath.certificates[0] as X509Certificate
|
||||
|
@ -22,7 +22,9 @@ import net.corda.core.node.NodeInfo
|
||||
import net.corda.core.node.services.CordaService
|
||||
import net.corda.core.serialization.SerializeAsToken
|
||||
import net.corda.core.serialization.SingletonSerializeAsToken
|
||||
import net.corda.core.serialization.internal.*
|
||||
import net.corda.core.serialization.internal.SerializationEnvironment
|
||||
import net.corda.core.serialization.internal.effectiveSerializationEnv
|
||||
import net.corda.core.serialization.internal.nodeSerializationEnv
|
||||
import net.corda.core.utilities.contextLogger
|
||||
import net.corda.core.utilities.debug
|
||||
import net.corda.node.CordaClock
|
||||
@ -62,6 +64,7 @@ import net.corda.node.utilities.EnterpriseNamedCacheFactory
|
||||
import net.corda.node.utilities.profiling.getTracingConfig
|
||||
import net.corda.nodeapi.internal.NodeInfoAndSigned
|
||||
import net.corda.nodeapi.internal.persistence.CordaPersistence
|
||||
import net.corda.nodeapi.internal.persistence.contextTransaction
|
||||
import net.corda.nodeapi.internal.persistence.isH2Database
|
||||
import net.corda.serialization.internal.*
|
||||
import org.apache.activemq.artemis.utils.ReusableLatch
|
||||
@ -78,10 +81,15 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.ExecutorService
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import java.util.function.Consumer
|
||||
import javax.persistence.EntityManager
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
class FlowWorkerServiceHub(override val configuration: NodeConfiguration, override val myInfo: NodeInfo,
|
||||
private val ourKeyPair: KeyPair, private val trustRoot: X509Certificate, private val nodeCa: X509Certificate,
|
||||
class FlowWorkerServiceHub(override val configuration: NodeConfiguration,
|
||||
override val myInfo: NodeInfo,
|
||||
private val ourKeyPair: KeyPair,
|
||||
private val trustRoot: X509Certificate,
|
||||
private val nodeCa: X509Certificate,
|
||||
private val signedNetworkParameters: NetworkParametersReader.NetworkParametersAndSigned) : ServiceHubInternal, SingletonSerializeAsToken() {
|
||||
|
||||
override val networkParameters: NetworkParameters = signedNetworkParameters.networkParameters
|
||||
@ -236,6 +244,14 @@ class FlowWorkerServiceHub(override val configuration: NodeConfiguration, overri
|
||||
|
||||
override fun jdbcSession(): Connection = database.createSession()
|
||||
|
||||
override fun <T : Any> withEntityManager(block: EntityManager.() -> T): T {
|
||||
throw NotImplementedError()
|
||||
}
|
||||
|
||||
override fun withEntityManager(block: Consumer<EntityManager>) {
|
||||
throw NotImplementedError()
|
||||
}
|
||||
|
||||
override fun registerUnloadHandler(runOnStop: () -> Unit) {
|
||||
this.runOnStop += runOnStop
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ import net.corda.node.utilities.EnterpriseNamedCacheFactory
|
||||
import net.corda.node.utilities.profiling.getTracingConfig
|
||||
import net.corda.nodeapi.internal.NodeInfoAndSigned
|
||||
import net.corda.nodeapi.internal.persistence.CordaPersistence
|
||||
import net.corda.nodeapi.internal.persistence.contextTransaction
|
||||
import net.corda.nodeapi.internal.persistence.isH2Database
|
||||
import net.corda.serialization.internal.*
|
||||
import org.slf4j.Logger
|
||||
@ -59,8 +60,15 @@ import java.sql.Connection
|
||||
import java.time.Clock
|
||||
import java.time.Duration
|
||||
import java.util.*
|
||||
import java.util.function.Consumer
|
||||
import javax.persistence.EntityManager
|
||||
|
||||
class RpcWorkerServiceHub(override val configuration: NodeConfiguration, override val myInfo: NodeInfo, private val signedNetworkParameters: NetworkParametersReader.NetworkParametersAndSigned, private val ourKeyPair: KeyPair, private val trustRoot: X509Certificate, private val nodeCa: X509Certificate) : ServiceHubInternal, SingletonSerializeAsToken() {
|
||||
class RpcWorkerServiceHub(override val configuration: NodeConfiguration,
|
||||
override val myInfo: NodeInfo,
|
||||
private val signedNetworkParameters: NetworkParametersReader.NetworkParametersAndSigned,
|
||||
private val ourKeyPair: KeyPair,
|
||||
private val trustRoot: X509Certificate,
|
||||
private val nodeCa: X509Certificate) : ServiceHubInternal, SingletonSerializeAsToken() {
|
||||
|
||||
override val clock: CordaClock = SimpleClock(Clock.systemUTC())
|
||||
private val versionInfo = getVersionInfo()
|
||||
@ -169,6 +177,14 @@ class RpcWorkerServiceHub(override val configuration: NodeConfiguration, overrid
|
||||
throw NotImplementedError()
|
||||
}
|
||||
|
||||
override fun <T : Any> withEntityManager(block: EntityManager.() -> T): T {
|
||||
throw NotImplementedError()
|
||||
}
|
||||
|
||||
override fun withEntityManager(block: Consumer<EntityManager>) {
|
||||
throw NotImplementedError()
|
||||
}
|
||||
|
||||
override fun registerUnloadHandler(runOnStop: () -> Unit) {
|
||||
this.runOnStop += runOnStop
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ public class CordaCaplet extends Capsule {
|
||||
// Create cordapps directory if it doesn't exist.
|
||||
if (!checkIfCordappDirExists(cordappsDir)) {
|
||||
// If it fails, just return the existing class path. The main Corda jar will detect the error and fail gracefully.
|
||||
return cp;
|
||||
return (T) cp;
|
||||
}
|
||||
// Add additional directories of JARs to the classpath (at the end), e.g., for JDBC drivers.
|
||||
augmentClasspath(cp, new File(baseDir, "drivers"));
|
||||
|
@ -178,7 +178,7 @@ class NodeConfigurationImplTest {
|
||||
|
||||
@Test
|
||||
fun `mutual exclusion machineName set to default if not explicitly set`() {
|
||||
val config = getConfig("test-config-mutualExclusion-noMachineName.conf").parseAsNodeConfiguration(options = Configuration.Validation.Options(strict = false)).orThrow()
|
||||
val config = getConfig("test-config-mutualExclusion-noMachineName.conf").parseAsNodeConfiguration(options = Configuration.Validation.Options(strict = false)).value()
|
||||
assertEquals(InetAddress.getLocalHost().hostName, config.enterpriseConfiguration.mutualExclusionConfiguration.machineName)
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,6 @@ import net.corda.testing.node.internal.addressMustNotBeBound
|
||||
import net.corda.testing.node.internal.internalDriver
|
||||
import org.assertj.core.api.Assertions.*
|
||||
import org.json.simple.JSONObject
|
||||
import org.junit.Assume.assumeTrue
|
||||
import org.junit.ClassRule
|
||||
import org.junit.Test
|
||||
import java.util.*
|
||||
|
Loading…
x
Reference in New Issue
Block a user