Skip to content

Commit c4748e0

Browse files
committed
Postpone notary configuration in driver DSL (matching original behaviour) to get around the service name check in registration.
1 parent 19e1161 commit c4748e0

File tree

1 file changed

+7
-4
lines changed
  • testing/node-driver/src/main/kotlin/net/corda/testing/node/internal

1 file changed

+7
-4
lines changed

testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt

+7-4
Original file line numberDiff line numberDiff line change
@@ -542,16 +542,15 @@ class DriverDSLImpl(
542542
rootCert: X509Certificate,
543543
compatibilityZone: CompatibilityZoneParams
544544
): CordaFuture<Pair<NodeConfig,NotaryInfo>> {
545-
val notaryConfig = mapOf("notary" to mapOf("validating" to spec.validating))
546-
val parameters = NodeParameters(rpcUsers = spec.rpcUsers, verifierType = spec.verifierType, customOverrides = notaryConfig + notaryCustomOverrides, maximumHeapSize = spec.maximumHeapSize)
545+
val parameters = NodeParameters(rpcUsers = spec.rpcUsers, verifierType = spec.verifierType, customOverrides = notaryCustomOverrides, maximumHeapSize = spec.maximumHeapSize)
547546
return createSchema(createConfig(spec.name, parameters), false).flatMap { config ->
548547
startNodeRegistration(config, rootCert, compatibilityZone.config())}.flatMap { config ->
549548
// Node registration only gives us the node CA cert, not the identity cert. That is only created on first
550549
// startup or when the node is told to just generate its node info file. We do that here.
551550
if (startNodesInProcess) {
552551
executorService.fork {
553552
val nodeInfo = Node(config.corda, MOCK_VERSION_INFO, initialiseSerialization = false).generateAndSaveNodeInfo()
554-
Pair(config, NotaryInfo(nodeInfo.legalIdentities[0], spec.validating))
553+
Pair(config.withNotaryDefinition(spec.validating), NotaryInfo(nodeInfo.legalIdentities[0], spec.validating))
555554
}
556555
} else {
557556
// TODO The config we use here is uses a hardocded p2p port which changes when the node is run proper
@@ -563,7 +562,7 @@ class DriverDSLImpl(
563562
.get()
564563
}
565564
val nodeInfo = nodeInfoFile.readObject<SignedNodeInfo>().verified()
566-
Pair(config,NotaryInfo(nodeInfo.legalIdentities[0], spec.validating))
565+
Pair(config.withNotaryDefinition(spec.validating), NotaryInfo(nodeInfo.legalIdentities[0], spec.validating))
567566
}
568567
}
569568
}
@@ -819,6 +818,10 @@ class DriverDSLImpl(
819818
val corda: NodeConfiguration = typesafe.parseAsNodeConfiguration().value()
820819
}
821820

821+
private fun NodeConfig.withNotaryDefinition(validating: Boolean): NodeConfig {
822+
return NodeConfig(this.typesafe.plus(mapOf("notary" to mapOf("validating" to validating))))
823+
}
824+
822825
companion object {
823826
private val RPC_CONNECT_POLL_INTERVAL: Duration = 100.millis
824827
internal val log = contextLogger()

0 commit comments

Comments
 (0)