From 725441b39c11a5e8cc1da316622efa5c5a86fb8c Mon Sep 17 00:00:00 2001 From: Shams Asari Date: Thu, 13 Sep 2018 12:53:06 +0100 Subject: [PATCH] Minor changes to bring in-sync with OS (#1390) --- .../net/corda/client/rpc/CordaRPCClient.kt | 11 +-------- .../rpc/internal/CordaRPCClientUtils.kt | 7 ------ .../rpc/internal/RPCClientProxyHandler.kt | 2 +- .../crypto/internal/PlatformSecureRandom.kt | 2 -- .../net/corda/core/internal/InternalUtils.kt | 3 --- .../notary/TrustedAuthorityNotaryService.kt | 1 - .../net/corda/core/messaging/CordaRPCOps.kt | 6 ----- .../net/corda/core/schemas/PersistentTypes.kt | 2 +- .../core/transactions/TransactionBuilder.kt | 7 ------ .../net/corda/core/flows/FlowsInJavaTest.java | 12 ---------- .../core/contracts/DummyContractV2Tests.kt | 1 - .../net/corda/behave/logging/LogUtilities.kt | 9 ------- .../node/configuration/NotaryConfiguration.kt | 2 +- .../net/corda/rpcWorker/CordaRpcWorkerOps.kt | 4 +++- .../corda/finance/flows/CashConfigDataFlow.kt | 4 ---- .../net/corda/finance/schemas/CashSchemaV1.kt | 3 +-- .../schemas/CommercialPaperSchemaV1.kt | 3 +-- .../internal/config/ConfigUtilities.kt | 2 +- .../node/services/BFTNotaryServiceTests.kt | 4 +--- .../node/services/RaftNotaryServiceTests.kt | 9 +++---- .../RaftTransactionCommitLogTests.kt | 2 -- .../services/messaging/P2PMessagingTest.kt | 8 +++---- .../main/kotlin/net/corda/node/VersionInfo.kt | 8 +++---- .../net/corda/node/internal/AbstractNode.kt | 1 - .../kotlin/net/corda/node/internal/Node.kt | 4 +--- .../cordapp/JarScanningCordappLoader.kt | 3 ++- .../services/identity/IdentityServiceUtil.kt | 24 ------------------- ...bstractPartyToX500NameAsStringConverter.kt | 1 + .../node/services/statemachine/SubFlow.kt | 2 +- .../identity/InMemoryIdentityServiceTests.kt | 6 ++++- .../services/network/NetworkMapCacheTest.kt | 1 - .../schema/PersistentStateServiceTests.kt | 1 - .../node/services/vault/VaultQueryTests.kt | 4 ++-- .../attachmentdemo/AttachmentDemoTest.kt | 1 - .../net/corda/test/spring/SpringDriver.kt | 1 - .../resources/application-BankA.properties | 10 -------- .../resources/application-BankB.properties | 10 -------- .../application-NotaryService.properties | 10 -------- .../src/main/resources/application.properties | 10 -------- .../serialization/internal/SharedContexts.kt | 1 - .../internal/amqp/AMQPSerializationScheme.kt | 2 +- .../internal/amqp/AMQPSerializerFactories.kt | 1 + .../internal/amqp/EvolvabilityTests.kt | 5 ++-- .../net/corda/testing/driver/DriverTests.kt | 8 +++++-- .../net/corda/testing/node/MockServices.kt | 1 - .../node/internal/InternalTestUtils.kt | 5 ---- .../corda/testing/node/internal/RPCDriver.kt | 2 +- .../node/internal/TestCordappDirectories.kt | 4 ++-- .../node/internal/performance/Injectors.kt | 3 --- .../service/proxy/CordaRPCProxyClient.kt | 3 +++ 50 files changed, 52 insertions(+), 184 deletions(-) delete mode 100644 experimental/behave/src/main/kotlin/net/corda/behave/logging/LogUtilities.kt delete mode 100644 node/src/main/kotlin/net/corda/node/services/identity/IdentityServiceUtil.kt diff --git a/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt b/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt index 31a34abee3..116e6baf84 100644 --- a/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt +++ b/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt @@ -286,15 +286,6 @@ class CordaRPCClient private constructor( ): CordaRPCClient { return CordaRPCClient(hostAndPort, configuration, sslConfiguration, classLoader) } - - internal fun createWithSslAndClassLoader( - haAddressPool: List, - configuration: CordaRPCClientConfiguration = CordaRPCClientConfiguration.DEFAULT, - sslConfiguration: ClientRpcSslOptions? = null, - classLoader: ClassLoader? = null - ): CordaRPCClient { - return CordaRPCClient(haAddressPool.first(), configuration, sslConfiguration, classLoader, haAddressPool) - } } init { @@ -311,7 +302,7 @@ class CordaRPCClient private constructor( private fun getRpcClient(): RPCClient { return when { - // Client->RPC broker + // Client->RPC broker haAddressPool.isEmpty() -> RPCClient( rpcConnectorTcpTransport(hostAndPort, config = sslConfiguration), configuration, diff --git a/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/CordaRPCClientUtils.kt b/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/CordaRPCClientUtils.kt index 2f60b2514a..9b07c405a9 100644 --- a/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/CordaRPCClientUtils.kt +++ b/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/CordaRPCClientUtils.kt @@ -16,13 +16,6 @@ fun createCordaRPCClientWithSslAndClassLoader( classLoader: ClassLoader? = null ) = CordaRPCClient.createWithSslAndClassLoader(hostAndPort, configuration, sslConfiguration, classLoader) -fun createCordaRPCClientWithSslAndClassLoader( - haAddressPool: List, - configuration: CordaRPCClientConfiguration = CordaRPCClientConfiguration.DEFAULT, - sslConfiguration: ClientRpcSslOptions? = null, - classLoader: ClassLoader? = null -) = CordaRPCClient.createWithSslAndClassLoader(haAddressPool, configuration, sslConfiguration, classLoader) - fun CordaRPCOps.drainAndShutdown(): Observable { setFlowsDrainingModeEnabled(true) diff --git a/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/RPCClientProxyHandler.kt b/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/RPCClientProxyHandler.kt index 5afaa1a364..f7438b02f4 100644 --- a/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/RPCClientProxyHandler.kt +++ b/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/RPCClientProxyHandler.kt @@ -480,7 +480,7 @@ class RPCClientProxyHandler( try { Thread.sleep(retryInterval.toMillis()) } catch (e: InterruptedException) {} - // could not connect, try with next server transport + // Could not connect, try with next server transport. reconnectAttempts-- retryInterval = minOf(maxRetryInterval, retryInterval.times(rpcConfiguration.connectionRetryIntervalMultiplier.toLong())) continue diff --git a/core/src/main/kotlin/net/corda/core/crypto/internal/PlatformSecureRandom.kt b/core/src/main/kotlin/net/corda/core/crypto/internal/PlatformSecureRandom.kt index 17a032c754..076a45d168 100644 --- a/core/src/main/kotlin/net/corda/core/crypto/internal/PlatformSecureRandom.kt +++ b/core/src/main/kotlin/net/corda/core/crypto/internal/PlatformSecureRandom.kt @@ -5,7 +5,6 @@ package net.corda.core.crypto.internal import net.corda.core.DeleteForDJVM import net.corda.core.crypto.CORDA_SECURE_RANDOM_ALGORITHM import net.corda.core.crypto.DummySecureRandom -import net.corda.core.internal.VisibleForTesting import net.corda.core.utilities.SgxSupport import java.security.SecureRandom @@ -13,7 +12,6 @@ import java.security.SecureRandom * This has been migrated into a separate class so that it * is easier to delete from the core-deterministic module. */ -@VisibleForTesting internal val platformSecureRandom = when { SgxSupport.isInsideEnclave -> DummySecureRandom else -> SecureRandom.getInstance(CORDA_SECURE_RANDOM_ALGORITHM) diff --git a/core/src/main/kotlin/net/corda/core/internal/InternalUtils.kt b/core/src/main/kotlin/net/corda/core/internal/InternalUtils.kt index 6d11610d5f..078cfcaa11 100644 --- a/core/src/main/kotlin/net/corda/core/internal/InternalUtils.kt +++ b/core/src/main/kotlin/net/corda/core/internal/InternalUtils.kt @@ -5,9 +5,6 @@ package net.corda.core.internal import net.corda.core.DeleteForDJVM import net.corda.core.KeepForDJVM import net.corda.core.crypto.* -import net.corda.core.flows.FlowLogic -import net.corda.core.node.ServicesForResolution -import net.corda.core.schemas.MappedSchema import net.corda.core.serialization.* import net.corda.core.utilities.OpaqueBytes import net.corda.core.utilities.UntrustworthyData diff --git a/core/src/main/kotlin/net/corda/core/internal/notary/TrustedAuthorityNotaryService.kt b/core/src/main/kotlin/net/corda/core/internal/notary/TrustedAuthorityNotaryService.kt index fa1476c632..148b506e82 100644 --- a/core/src/main/kotlin/net/corda/core/internal/notary/TrustedAuthorityNotaryService.kt +++ b/core/src/main/kotlin/net/corda/core/internal/notary/TrustedAuthorityNotaryService.kt @@ -50,7 +50,6 @@ abstract class TrustedAuthorityNotaryService : NotaryService() { } } else throw e } catch (e: Exception) { - if (e is NotaryInternalException) throw e log.error("Internal error", e) throw NotaryInternalException(NotaryError.General(Exception("Service unavailable, please try again later"))) } diff --git a/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt b/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt index 1bb68fb0d5..5de709dec0 100644 --- a/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt +++ b/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt @@ -98,12 +98,6 @@ data class StateMachineTransactionMapping(val stateMachineRunId: StateMachineRun /** RPC operations that the node exposes to clients. */ interface CordaRPCOps : RPCOps { - /** - * Returns the RPC protocol version, which is the same the node's Platform Version. Exists since version 1 so guaranteed - * to be present. - */ - override val protocolVersion: Int get() = nodeInfo().platformVersion - /** Returns a list of currently in-progress state machine infos. */ fun stateMachinesSnapshot(): List diff --git a/core/src/main/kotlin/net/corda/core/schemas/PersistentTypes.kt b/core/src/main/kotlin/net/corda/core/schemas/PersistentTypes.kt index 836bda27ca..07f88f3f43 100644 --- a/core/src/main/kotlin/net/corda/core/schemas/PersistentTypes.kt +++ b/core/src/main/kotlin/net/corda/core/schemas/PersistentTypes.kt @@ -47,7 +47,7 @@ open class MappedSchema(schemaFamily: Class<*>, val name: String = schemaFamily.name /** - * Points to a classpath resource containing the database changes for the [mappedTypes] + * Optional classpath resource containing the database changes for the [mappedTypes] */ open val migrationResource: String? = null diff --git a/core/src/main/kotlin/net/corda/core/transactions/TransactionBuilder.kt b/core/src/main/kotlin/net/corda/core/transactions/TransactionBuilder.kt index 1c18f5721b..f4f1d66784 100644 --- a/core/src/main/kotlin/net/corda/core/transactions/TransactionBuilder.kt +++ b/core/src/main/kotlin/net/corda/core/transactions/TransactionBuilder.kt @@ -17,8 +17,6 @@ import net.corda.core.node.services.AttachmentId import net.corda.core.node.services.KeyManagementService import net.corda.core.serialization.SerializationContext import net.corda.core.serialization.SerializationFactory -import net.corda.core.utilities.contextLogger -import net.corda.core.utilities.loggerFor import java.security.PublicKey import java.time.Duration import java.time.Instant @@ -49,11 +47,6 @@ open class TransactionBuilder @JvmOverloads constructor( protected var privacySalt: PrivacySalt = PrivacySalt(), protected val references: MutableList = arrayListOf() ) { - - private companion object { - val logger = loggerFor() - } - private val inputsWithTransactionState = arrayListOf>() private val referencesWithTransactionState = arrayListOf>() diff --git a/core/src/test/java/net/corda/core/flows/FlowsInJavaTest.java b/core/src/test/java/net/corda/core/flows/FlowsInJavaTest.java index 0b66781cbb..41bd180466 100644 --- a/core/src/test/java/net/corda/core/flows/FlowsInJavaTest.java +++ b/core/src/test/java/net/corda/core/flows/FlowsInJavaTest.java @@ -100,18 +100,6 @@ public class FlowsInJavaTest { } } - @InitiatedBy(PrimitiveReceiveFlow.class) - private static class PrimitiveSendFlow extends FlowLogic { - public PrimitiveSendFlow(FlowSession session) { - } - - @Suspendable - @Override - public Void call() throws FlowException { - return null; - } - } - @InitiatingFlow private static class PrimitiveReceiveFlow extends FlowLogic { private final Party otherParty; diff --git a/core/src/test/kotlin/net/corda/core/contracts/DummyContractV2Tests.kt b/core/src/test/kotlin/net/corda/core/contracts/DummyContractV2Tests.kt index 8b13789179..e69de29bb2 100644 --- a/core/src/test/kotlin/net/corda/core/contracts/DummyContractV2Tests.kt +++ b/core/src/test/kotlin/net/corda/core/contracts/DummyContractV2Tests.kt @@ -1 +0,0 @@ - diff --git a/experimental/behave/src/main/kotlin/net/corda/behave/logging/LogUtilities.kt b/experimental/behave/src/main/kotlin/net/corda/behave/logging/LogUtilities.kt deleted file mode 100644 index 16491e6c87..0000000000 --- a/experimental/behave/src/main/kotlin/net/corda/behave/logging/LogUtilities.kt +++ /dev/null @@ -1,9 +0,0 @@ -package net.corda.behave.logging - -import org.slf4j.Logger -import org.slf4j.LoggerFactory - -// TODO Already available in corda core - -inline fun getLogger(): Logger = - LoggerFactory.getLogger(T::class.java) diff --git a/experimental/behave/src/main/kotlin/net/corda/behave/node/configuration/NotaryConfiguration.kt b/experimental/behave/src/main/kotlin/net/corda/behave/node/configuration/NotaryConfiguration.kt index be6422bc09..9cfa15b652 100644 --- a/experimental/behave/src/main/kotlin/net/corda/behave/node/configuration/NotaryConfiguration.kt +++ b/experimental/behave/src/main/kotlin/net/corda/behave/node/configuration/NotaryConfiguration.kt @@ -1,6 +1,6 @@ package net.corda.behave.node.configuration -class NotaryConfiguration(val notaryType: NotaryType = NotaryType.NONE) : ConfigurationTemplate() { +class NotaryConfiguration(private val notaryType: NotaryType = NotaryType.NONE) : ConfigurationTemplate() { override val config: (Configuration) -> String get() = { diff --git a/experimental/rpc-worker/src/main/kotlin/net/corda/rpcWorker/CordaRpcWorkerOps.kt b/experimental/rpc-worker/src/main/kotlin/net/corda/rpcWorker/CordaRpcWorkerOps.kt index bd123fcdfd..568b1bbef4 100644 --- a/experimental/rpc-worker/src/main/kotlin/net/corda/rpcWorker/CordaRpcWorkerOps.kt +++ b/experimental/rpc-worker/src/main/kotlin/net/corda/rpcWorker/CordaRpcWorkerOps.kt @@ -70,7 +70,9 @@ class CordaRpcWorkerOps( private val flowReplyStateMachineRunIdMap = ConcurrentHashMap>() private val flowReplyResultMap = ConcurrentHashMap>() - override val networkParameters: NetworkParameters = services.networkParameters + override val protocolVersion: Int get() = services.myInfo.platformVersion + + override val networkParameters: NetworkParameters get() = services.networkParameters fun start() { session = artemisClient.start().session diff --git a/finance/src/main/kotlin/net/corda/finance/flows/CashConfigDataFlow.kt b/finance/src/main/kotlin/net/corda/finance/flows/CashConfigDataFlow.kt index a74ceaa28a..f53457a3de 100644 --- a/finance/src/main/kotlin/net/corda/finance/flows/CashConfigDataFlow.kt +++ b/finance/src/main/kotlin/net/corda/finance/flows/CashConfigDataFlow.kt @@ -14,11 +14,8 @@ import net.corda.finance.EUR import net.corda.finance.GBP import net.corda.finance.USD import net.corda.finance.flows.ConfigHolder.Companion.supportedCurrencies -import java.io.BufferedReader import java.io.IOException import java.io.InputStream -import java.nio.charset.Charset -import java.nio.charset.StandardCharsets.UTF_8 import java.nio.file.Files import java.nio.file.OpenOption import java.nio.file.Path @@ -36,7 +33,6 @@ class ConfigHolder(services: AppServiceHub) : SingletonSerializeAsToken() { private operator fun Path.div(other: String): Path = resolve(other) private operator fun String.div(other: String): Path = Paths.get(this) / other private fun Path.inputStream(vararg options: OpenOption): InputStream = Files.newInputStream(this, *options) - private fun Path.reader(charset: Charset = UTF_8): BufferedReader = Files.newBufferedReader(this, charset) private inline fun Path.read(vararg options: OpenOption, block: (InputStream) -> R): R = inputStream(*options).use(block) } diff --git a/finance/src/main/kotlin/net/corda/finance/schemas/CashSchemaV1.kt b/finance/src/main/kotlin/net/corda/finance/schemas/CashSchemaV1.kt index 6a478707b1..7486ddb590 100644 --- a/finance/src/main/kotlin/net/corda/finance/schemas/CashSchemaV1.kt +++ b/finance/src/main/kotlin/net/corda/finance/schemas/CashSchemaV1.kt @@ -19,8 +19,7 @@ object CashSchema * at the time of writing. */ @CordaSerializable -object CashSchemaV1 : MappedSchema( - schemaFamily = CashSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCashState::class.java)) { +object CashSchemaV1 : MappedSchema(schemaFamily = CashSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCashState::class.java)) { override val migrationResource = "cash.changelog-master" diff --git a/finance/src/main/kotlin/net/corda/finance/schemas/CommercialPaperSchemaV1.kt b/finance/src/main/kotlin/net/corda/finance/schemas/CommercialPaperSchemaV1.kt index eaa306281c..87c31cfc4a 100644 --- a/finance/src/main/kotlin/net/corda/finance/schemas/CommercialPaperSchemaV1.kt +++ b/finance/src/main/kotlin/net/corda/finance/schemas/CommercialPaperSchemaV1.kt @@ -22,8 +22,7 @@ object CommercialPaperSchema * as it stood at the time of writing. */ @CordaSerializable -object CommercialPaperSchemaV1 : MappedSchema( - schemaFamily = CommercialPaperSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCommercialPaperState::class.java)) { +object CommercialPaperSchemaV1 : MappedSchema(schemaFamily = CommercialPaperSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCommercialPaperState::class.java)) { override val migrationResource = "commercial-paper.changelog-master" diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/config/ConfigUtilities.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/config/ConfigUtilities.kt index dafc82fed1..cf3245837c 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/config/ConfigUtilities.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/config/ConfigUtilities.kt @@ -303,4 +303,4 @@ enum class UnknownConfigKeysPolicy(private val handle: (Set, logger: Log handle.invoke(unknownKeys, logger) } } -} \ No newline at end of file +} diff --git a/node/src/integration-test/kotlin/net/corda/node/services/BFTNotaryServiceTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/BFTNotaryServiceTests.kt index cd584ce97e..f6fa0fe452 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/BFTNotaryServiceTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/BFTNotaryServiceTests.kt @@ -105,13 +105,11 @@ class BFTNotaryServiceTests { networkParameters.install(mockNet.baseDirectory(node.id)) node.start() }.last() + return Pair(notaryIdentity, node) } } - - - @Test fun `detect double spend`() { node.run { diff --git a/node/src/integration-test/kotlin/net/corda/node/services/RaftNotaryServiceTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/RaftNotaryServiceTests.kt index cc0026addb..4b215aabce 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/RaftNotaryServiceTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/RaftNotaryServiceTests.kt @@ -16,8 +16,8 @@ import net.corda.testing.core.DUMMY_BANK_A_NAME import net.corda.testing.core.dummyCommand import net.corda.testing.core.singleIdentity import net.corda.testing.driver.DriverParameters +import net.corda.testing.driver.InProcess import net.corda.testing.driver.driver -import net.corda.testing.driver.internal.InProcessImpl import net.corda.testing.internal.IntegrationTest import net.corda.testing.internal.IntegrationTestSchemas import net.corda.testing.internal.toDatabaseSchemaName @@ -45,7 +45,7 @@ class RaftNotaryServiceTests : IntegrationTest() { extraCordappPackagesToScan = listOf("net.corda.testing.contracts"), notarySpecs = listOf(NotarySpec(notaryName, cluster = ClusterSpec.Raft(clusterSize = 3))) )) { - val bankA = startNode(providedName = DUMMY_BANK_A_NAME).map { (it as InProcessImpl) }.getOrThrow() + val bankA = startNode(providedName = DUMMY_BANK_A_NAME).map { (it as InProcess) }.getOrThrow() val inputState = issueState(bankA, defaultNotaryIdentity) val firstTxBuilder = TransactionBuilder(defaultNotaryIdentity) @@ -78,15 +78,16 @@ class RaftNotaryServiceTests : IntegrationTest() { extraCordappPackagesToScan = listOf("net.corda.testing.contracts"), notarySpecs = listOf(NotarySpec(notaryName, cluster = ClusterSpec.Raft(clusterSize = 3))) )) { - val bankA = startNode(providedName = DUMMY_BANK_A_NAME).map { (it as InProcessImpl) }.getOrThrow() + val bankA = startNode(providedName = DUMMY_BANK_A_NAME).map { (it as InProcess) }.getOrThrow() val builder = DummyContract.generateInitial(Random().nextInt(), defaultNotaryIdentity, bankA.services.myInfo.singleIdentity().ref(0)) .setTimeWindow(bankA.services.clock.instant(), 30.seconds) val issueTx = bankA.services.signInitialTransaction(builder) + bankA.startFlow(NotaryFlow.Client(issueTx)).getOrThrow() } } - private fun issueState(nodeHandle: InProcessImpl, notary: Party): StateAndRef<*> { + private fun issueState(nodeHandle: InProcess, notary: Party): StateAndRef<*> { val builder = DummyContract.generateInitial(Random().nextInt(), notary, nodeHandle.services.myInfo.singleIdentity().ref(0)) val stx = nodeHandle.services.signInitialTransaction(builder) nodeHandle.services.recordTransactions(stx) diff --git a/node/src/integration-test/kotlin/net/corda/node/services/transactions/RaftTransactionCommitLogTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/transactions/RaftTransactionCommitLogTests.kt index e3243c5c24..3edb3d3f3e 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/transactions/RaftTransactionCommitLogTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/transactions/RaftTransactionCommitLogTests.kt @@ -1,6 +1,5 @@ package net.corda.node.services.transactions -import com.typesafe.config.ConfigFactory import io.atomix.catalyst.transport.Address import io.atomix.copycat.client.ConnectionStrategies import io.atomix.copycat.client.CopycatClient @@ -24,7 +23,6 @@ import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.driver.PortAllocation import net.corda.testing.internal.LogHelper import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties -import net.corda.testing.node.internal.makeInternalTestDataSourceProperties import org.hamcrest.Matchers.instanceOf import org.junit.After import org.junit.Assert.assertThat diff --git a/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMessagingTest.kt b/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMessagingTest.kt index 6e850f0143..8e560bc538 100644 --- a/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMessagingTest.kt +++ b/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMessagingTest.kt @@ -77,11 +77,11 @@ class P2PMessagingTest : IntegrationTest() { } private fun InProcess.respondWith(message: Any) { - internalServices.networkService.addMessageHandler("test.request") { netMessage, _, handle -> + internalServices.networkService.addMessageHandler("test.request") { netMessage, _, handler -> val request = netMessage.data.deserialize() val response = internalServices.networkService.createMessage("test.response", message.serialize().bytes) internalServices.networkService.send(response, request.replyTo) - handle.afterDatabaseTransaction() + handler.afterDatabaseTransaction() } } @@ -103,12 +103,12 @@ class P2PMessagingTest : IntegrationTest() { */ inline fun MessagingService.runOnNextMessage(topic: String, crossinline callback: (ReceivedMessage) -> Unit) { val consumed = AtomicBoolean() - addMessageHandler(topic) { msg, reg, handle -> + addMessageHandler(topic) { msg, reg, handler -> removeMessageHandler(reg) check(!consumed.getAndSet(true)) { "Called more than once" } check(msg.topic == topic) { "Topic/session mismatch: ${msg.topic} vs $topic" } callback(msg) - handle.afterDatabaseTransaction() + handler.afterDatabaseTransaction() } } diff --git a/node/src/main/kotlin/net/corda/node/VersionInfo.kt b/node/src/main/kotlin/net/corda/node/VersionInfo.kt index dd2d65b539..eacbb25133 100644 --- a/node/src/main/kotlin/net/corda/node/VersionInfo.kt +++ b/node/src/main/kotlin/net/corda/node/VersionInfo.kt @@ -16,7 +16,7 @@ data class VersionInfo( /** The node vendor */ val vendor: String) { - companion object { - val UNKNOWN = VersionInfo(1, "Unknown", "Unknown", "Unknown") - } -} \ No newline at end of file + companion object { + val UNKNOWN = VersionInfo(1, "Unknown", "Unknown", "Unknown") + } +} 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 3fe950a099..355caa45f8 100644 --- a/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt +++ b/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt @@ -69,7 +69,6 @@ import net.corda.node.utilities.AffinityExecutor import net.corda.node.utilities.JVMAgentRegistry import net.corda.node.utilities.NamedThreadFactory import net.corda.node.utilities.NodeBuildProperties -import net.corda.nodeapi.internal.DevIdentityGenerator import net.corda.nodeapi.internal.NodeInfoAndSigned import net.corda.nodeapi.internal.SignedNodeInfo import net.corda.nodeapi.internal.config.CertificateStore diff --git a/node/src/main/kotlin/net/corda/node/internal/Node.kt b/node/src/main/kotlin/net/corda/node/internal/Node.kt index 62da845fb6..108703f7c6 100644 --- a/node/src/main/kotlin/net/corda/node/internal/Node.kt +++ b/node/src/main/kotlin/net/corda/node/internal/Node.kt @@ -132,9 +132,7 @@ open class Node(configuration: NodeConfiguration, private val sameVmNodeCounter = AtomicInteger() - @JvmStatic - protected fun makeCordappLoader(configuration: NodeConfiguration, versionInfo: VersionInfo): CordappLoader { - + private fun makeCordappLoader(configuration: NodeConfiguration, versionInfo: VersionInfo): CordappLoader { return JarScanningCordappLoader.fromDirectories(configuration.cordappDirectories, versionInfo) } diff --git a/node/src/main/kotlin/net/corda/node/internal/cordapp/JarScanningCordappLoader.kt b/node/src/main/kotlin/net/corda/node/internal/cordapp/JarScanningCordappLoader.kt index 00dd9965f9..be3c8e4deb 100644 --- a/node/src/main/kotlin/net/corda/node/internal/cordapp/JarScanningCordappLoader.kt +++ b/node/src/main/kotlin/net/corda/node/internal/cordapp/JarScanningCordappLoader.kt @@ -34,7 +34,8 @@ import kotlin.streams.toList * * @property cordappJarPaths The classpath of cordapp JARs */ -class JarScanningCordappLoader private constructor(private val cordappJarPaths: List, versionInfo: VersionInfo = VersionInfo.UNKNOWN) : CordappLoaderTemplate() { +class JarScanningCordappLoader private constructor(private val cordappJarPaths: List, + versionInfo: VersionInfo = VersionInfo.UNKNOWN) : CordappLoaderTemplate() { override val cordapps: List by lazy { loadCordapps() + coreCordapp } diff --git a/node/src/main/kotlin/net/corda/node/services/identity/IdentityServiceUtil.kt b/node/src/main/kotlin/net/corda/node/services/identity/IdentityServiceUtil.kt deleted file mode 100644 index b5f065cc85..0000000000 --- a/node/src/main/kotlin/net/corda/node/services/identity/IdentityServiceUtil.kt +++ /dev/null @@ -1,24 +0,0 @@ -package net.corda.node.services.identity - -import net.corda.core.identity.CordaX500Name -import net.corda.core.identity.Party - - -fun partiesFromName(query: String, exactMatch: Boolean, x500name: CordaX500Name, results: LinkedHashSet, party: Party) { - - val components = listOfNotNull(x500name.commonName, x500name.organisationUnit, x500name.organisation, x500name.locality, x500name.state, x500name.country) - components.forEach { component -> - if (exactMatch && component == query) { - results += party - } else if (!exactMatch) { - // We can imagine this being a query over a lucene index in future. - // - // Kostas says: We can easily use the Jaro-Winkler distance metric as it is best suited for short - // strings such as entity/company names, and to detect small typos. We can also apply it for city - // or any keyword related search in lists of records (not raw text - for raw text we need indexing) - // and we can return results in hierarchical order (based on normalised String similarity 0.0-1.0). - if (component.contains(query, ignoreCase = true)) - results += party - } - } -} \ No newline at end of file diff --git a/node/src/main/kotlin/net/corda/node/services/persistence/AbstractPartyToX500NameAsStringConverter.kt b/node/src/main/kotlin/net/corda/node/services/persistence/AbstractPartyToX500NameAsStringConverter.kt index bfcfdd221b..b476872172 100644 --- a/node/src/main/kotlin/net/corda/node/services/persistence/AbstractPartyToX500NameAsStringConverter.kt +++ b/node/src/main/kotlin/net/corda/node/services/persistence/AbstractPartyToX500NameAsStringConverter.kt @@ -31,6 +31,7 @@ class AbstractPartyToX500NameAsStringConverter(private val wellKnownPartyFromX50 if (dbData != null) { val party = wellKnownPartyFromX500Name(CordaX500Name.parse(dbData)) if (party != null) return party + log.warn("Identity service unable to resolve X500name: $dbData") } return null // non resolvable anonymous parties are stored as nulls } diff --git a/node/src/main/kotlin/net/corda/node/services/statemachine/SubFlow.kt b/node/src/main/kotlin/net/corda/node/services/statemachine/SubFlow.kt index fb232492ee..5ddd0e6630 100644 --- a/node/src/main/kotlin/net/corda/node/services/statemachine/SubFlow.kt +++ b/node/src/main/kotlin/net/corda/node/services/statemachine/SubFlow.kt @@ -73,4 +73,4 @@ sealed class SubFlow { } } } -} \ No newline at end of file +} diff --git a/node/src/test/kotlin/net/corda/node/services/identity/InMemoryIdentityServiceTests.kt b/node/src/test/kotlin/net/corda/node/services/identity/InMemoryIdentityServiceTests.kt index 476ce6e880..f4ce075b1e 100644 --- a/node/src/test/kotlin/net/corda/node/services/identity/InMemoryIdentityServiceTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/identity/InMemoryIdentityServiceTests.kt @@ -169,7 +169,11 @@ class InMemoryIdentityServiceTests { val issuerKeyPair = generateKeyPair() val issuer = getTestPartyAndCertificate(x500Name, issuerKeyPair.public) val txKeyPair = Crypto.generateKeyPair() - val txCert = X509Utilities.createCertificate(CertificateType.CONFIDENTIAL_LEGAL_IDENTITY, issuer.certificate, issuerKeyPair, x500Name.x500Principal, + val txCert = X509Utilities.createCertificate( + CertificateType.CONFIDENTIAL_LEGAL_IDENTITY, + issuer.certificate, + issuerKeyPair, + x500Name.x500Principal, txKeyPair.public) val txCertPath = X509Utilities.buildCertPath(txCert, issuer.certPath.x509Certificates) return Pair(issuer, PartyAndCertificate(txCertPath)) diff --git a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapCacheTest.kt b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapCacheTest.kt index 11b489485f..ca5ae8827c 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapCacheTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapCacheTest.kt @@ -7,7 +7,6 @@ import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.BOB_NAME import net.corda.testing.core.getTestPartyAndCertificate import net.corda.testing.core.singleIdentity -import net.corda.testing.node.MockNodeParameters import net.corda.testing.node.internal.InternalMockNetwork import net.corda.testing.node.internal.InternalMockNodeParameters import org.assertj.core.api.Assertions.assertThat diff --git a/node/src/test/kotlin/net/corda/node/services/schema/PersistentStateServiceTests.kt b/node/src/test/kotlin/net/corda/node/services/schema/PersistentStateServiceTests.kt index d8a8b510b7..d2198115d6 100644 --- a/node/src/test/kotlin/net/corda/node/services/schema/PersistentStateServiceTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/schema/PersistentStateServiceTests.kt @@ -8,7 +8,6 @@ import net.corda.core.crypto.SecureHash import net.corda.core.identity.AbstractParty import net.corda.core.identity.CordaX500Name import net.corda.core.node.services.Vault -import net.corda.core.schemas.CommonSchemaV1 import net.corda.core.schemas.MappedSchema import net.corda.core.schemas.PersistentState import net.corda.core.schemas.QueryableState diff --git a/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt b/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt index a98183f6a6..c7bd33ce49 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt @@ -18,11 +18,11 @@ import net.corda.finance.contracts.Commodity import net.corda.finance.contracts.DealState import net.corda.finance.contracts.asset.Cash import net.corda.finance.contracts.asset.cash.selection.AbstractCashSelection -import net.corda.finance.schemas.SampleCashSchemaV2 -import net.corda.finance.schemas.SampleCashSchemaV3 import net.corda.finance.schemas.CashSchemaV1 import net.corda.finance.schemas.CashSchemaV1.PersistentCashState import net.corda.finance.schemas.CommercialPaperSchemaV1 +import net.corda.finance.schemas.SampleCashSchemaV2 +import net.corda.finance.schemas.SampleCashSchemaV3 import net.corda.node.internal.configureDatabase import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.DatabaseConfig diff --git a/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt b/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt index b4bb4710de..a5721741a0 100644 --- a/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt +++ b/samples/attachment-demo/src/integration-test/kotlin/net/corda/attachmentdemo/AttachmentDemoTest.kt @@ -25,7 +25,6 @@ class AttachmentDemoTest : IntegrationTest() { } // run with a 10,000,000 bytes in-memory zip file. In practice, a slightly bigger file will be used (~10,002,000 bytes). - // Force INFO logging to prevent printing 10MB arrays in logfiles @Test fun `attachment demo using a 10MB zip file`() { val numOfExpectedBytes = 10_000_000 diff --git a/samples/irs-demo/src/integration-test/kotlin/net/corda/test/spring/SpringDriver.kt b/samples/irs-demo/src/integration-test/kotlin/net/corda/test/spring/SpringDriver.kt index 2fac454498..5a20843cc2 100644 --- a/samples/irs-demo/src/integration-test/kotlin/net/corda/test/spring/SpringDriver.kt +++ b/samples/irs-demo/src/integration-test/kotlin/net/corda/test/spring/SpringDriver.kt @@ -14,7 +14,6 @@ import okhttp3.OkHttpClient import okhttp3.Request import java.net.ConnectException import java.net.URL -import java.nio.file.Paths import java.util.concurrent.TimeUnit fun springDriver( diff --git a/samples/irs-demo/web/src/main/resources/application-BankA.properties b/samples/irs-demo/web/src/main/resources/application-BankA.properties index 332df578f6..507a605a82 100644 --- a/samples/irs-demo/web/src/main/resources/application-BankA.properties +++ b/samples/irs-demo/web/src/main/resources/application-BankA.properties @@ -1,13 +1,3 @@ -# -# R3 Proprietary and Confidential -# -# Copyright (c) 2018 R3 Limited. All rights reserved. -# -# The intellectual and technical concepts contained herein are proprietary to R3 and its suppliers and are protected by trade secret law. -# -# Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited. -# - corda.host=localhost:10006 server.port=10007 liquibase.enabled=false \ No newline at end of file diff --git a/samples/irs-demo/web/src/main/resources/application-BankB.properties b/samples/irs-demo/web/src/main/resources/application-BankB.properties index 4b4fa3c2ab..9726da7b95 100644 --- a/samples/irs-demo/web/src/main/resources/application-BankB.properties +++ b/samples/irs-demo/web/src/main/resources/application-BankB.properties @@ -1,13 +1,3 @@ -# -# R3 Proprietary and Confidential -# -# Copyright (c) 2018 R3 Limited. All rights reserved. -# -# The intellectual and technical concepts contained herein are proprietary to R3 and its suppliers and are protected by trade secret law. -# -# Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited. -# - corda.host=localhost:10009 server.port=10010 liquibase.enabled=false \ No newline at end of file diff --git a/samples/irs-demo/web/src/main/resources/application-NotaryService.properties b/samples/irs-demo/web/src/main/resources/application-NotaryService.properties index f0364749a4..566c3fc3a0 100644 --- a/samples/irs-demo/web/src/main/resources/application-NotaryService.properties +++ b/samples/irs-demo/web/src/main/resources/application-NotaryService.properties @@ -1,13 +1,3 @@ -# -# R3 Proprietary and Confidential -# -# Copyright (c) 2018 R3 Limited. All rights reserved. -# -# The intellectual and technical concepts contained herein are proprietary to R3 and its suppliers and are protected by trade secret law. -# -# Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited. -# - corda.host=localhost:10003 server.port=10004 liquibase.enabled=false \ No newline at end of file diff --git a/samples/irs-demo/web/src/main/resources/application.properties b/samples/irs-demo/web/src/main/resources/application.properties index 05ec783dcc..8ded80ca5c 100644 --- a/samples/irs-demo/web/src/main/resources/application.properties +++ b/samples/irs-demo/web/src/main/resources/application.properties @@ -1,13 +1,3 @@ -# -# R3 Proprietary and Confidential -# -# Copyright (c) 2018 R3 Limited. All rights reserved. -# -# The intellectual and technical concepts contained herein are proprietary to R3 and its suppliers and are protected by trade secret law. -# -# Distribution of this file or any portion thereof via any medium without the express permission of R3 is strictly prohibited. -# - corda.user=user corda.password=password liquibase.enabled=false \ No newline at end of file diff --git a/serialization/src/main/kotlin/net/corda/serialization/internal/SharedContexts.kt b/serialization/src/main/kotlin/net/corda/serialization/internal/SharedContexts.kt index fee445db09..c2d12e8b55 100644 --- a/serialization/src/main/kotlin/net/corda/serialization/internal/SharedContexts.kt +++ b/serialization/src/main/kotlin/net/corda/serialization/internal/SharedContexts.kt @@ -5,7 +5,6 @@ package net.corda.serialization.internal import net.corda.core.DeleteForDJVM import net.corda.core.KeepForDJVM import net.corda.core.serialization.* -import net.corda.serialization.internal.CordaSerializationEncoding.SNAPPY import net.corda.serialization.internal.amqp.amqpMagic val AMQP_P2P_CONTEXT = SerializationContextImpl( diff --git a/serialization/src/main/kotlin/net/corda/serialization/internal/amqp/AMQPSerializationScheme.kt b/serialization/src/main/kotlin/net/corda/serialization/internal/amqp/AMQPSerializationScheme.kt index ce1c4b76fa..f35c808077 100644 --- a/serialization/src/main/kotlin/net/corda/serialization/internal/amqp/AMQPSerializationScheme.kt +++ b/serialization/src/main/kotlin/net/corda/serialization/internal/amqp/AMQPSerializationScheme.kt @@ -47,7 +47,7 @@ abstract class AbstractAMQPSerializationScheme( constructor(cordapps: List) : this(cordapps.customSerializers, AccessOrderLinkedHashMap(128)) // TODO: This method of initialisation for the Whitelist and plugin serializers will have to change - // when we have per-cordapp contexts and dynamic app reloading but for now it's the easiest way + // when we have per-cordapp contexts and dynamic app reloading but for now it's the easiest way companion object { const val SCAN_SPEC_PROP_NAME = "amqp.custom.serialization.scanSpec" diff --git a/serialization/src/main/kotlin/net/corda/serialization/internal/amqp/AMQPSerializerFactories.kt b/serialization/src/main/kotlin/net/corda/serialization/internal/amqp/AMQPSerializerFactories.kt index 7c11319a0e..aacde49dac 100644 --- a/serialization/src/main/kotlin/net/corda/serialization/internal/amqp/AMQPSerializerFactories.kt +++ b/serialization/src/main/kotlin/net/corda/serialization/internal/amqp/AMQPSerializerFactories.kt @@ -1,4 +1,5 @@ @file:JvmName("AMQPSerializerFactories") + package net.corda.serialization.internal.amqp import net.corda.core.serialization.SerializationContext diff --git a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EvolvabilityTests.kt b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EvolvabilityTests.kt index 6658e85526..e0109515d6 100644 --- a/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EvolvabilityTests.kt +++ b/serialization/src/test/kotlin/net/corda/serialization/internal/amqp/EvolvabilityTests.kt @@ -46,7 +46,6 @@ class EvolvabilityTests { // Original version of the class for the serialised version of this class // data class C (val a: Int, val b: Int) // File(URI("$localPath/$resource")).writeBytes(SerializationOutput(sf).serialize(C(A, B)).bytes) - // println (path) // new version of the class, in this case the order of the parameters has been swapped data class C(val b: Int, val a: Int) @@ -69,7 +68,6 @@ class EvolvabilityTests { // Original version of the class as it was serialised // data class C (val a: Int, val b: String) // File(URI("$localPath/$resource")).writeBytes(SerializationOutput(sf).serialize(C(A, B)).bytes) - // println (path) // new version of the class, in this case the order of the parameters has been swapped data class C(val b: String, val a: Int) @@ -90,7 +88,7 @@ class EvolvabilityTests { // Original version of the class as it was serialised // data class C(val a: Int) - // File(URI("$localPath/$resource")).writeBytes( SerializationOutput(sf).serialize(C(A)) + // File(URI("$localPath/$resource")).writeBytes(SerializationOutput(sf).serialize(C(A)).bytes) data class C(val a: Int, val b: Int?) @@ -375,6 +373,7 @@ class EvolvabilityTests { val resource1 = "EvolvabilityTests.multiVersion.1" val resource2 = "EvolvabilityTests.multiVersion.2" val resource3 = "EvolvabilityTests.multiVersion.3" + val a = 100 val b = 200 val c = 300 diff --git a/testing/node-driver/src/integration-test/kotlin/net/corda/testing/driver/DriverTests.kt b/testing/node-driver/src/integration-test/kotlin/net/corda/testing/driver/DriverTests.kt index b59b7b0bd3..5f07b942dc 100644 --- a/testing/node-driver/src/integration-test/kotlin/net/corda/testing/driver/DriverTests.kt +++ b/testing/node-driver/src/integration-test/kotlin/net/corda/testing/driver/DriverTests.kt @@ -38,7 +38,7 @@ import kotlin.streams.toList import kotlin.test.assertEquals class DriverTests : IntegrationTest() { - companion object { + private companion object { val DUMMY_REGULATOR_NAME = CordaX500Name("Regulator A", "Paris", "FR") val executorService: ScheduledExecutorService = Executors.newScheduledThreadPool(2) @@ -103,7 +103,11 @@ class DriverTests : IntegrationTest() { // Make sure we're using the log4j2 config which writes to the log file val logConfigFile = projectRootDir / "config" / "dev" / "log4j2.xml" assertThat(logConfigFile).isRegularFile() - driver(DriverParameters(isDebug = true,notarySpecs = emptyList(), systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))) { + driver(DriverParameters( + isDebug = true, + notarySpecs = emptyList(), + systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()) + )) { val baseDirectory = startNode(providedName = DUMMY_BANK_A_NAME).getOrThrow().baseDirectory val logFile = (baseDirectory / NodeStartup.LOGS_DIRECTORY_NAME).list { it.sorted().findFirst().get() } val debugLinesPresent = logFile.readLines { lines -> lines.anyMatch { line -> line.startsWith("[DEBUG]") } } 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 5f00f8a03b..3fb2881e27 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 @@ -28,7 +28,6 @@ import net.corda.node.services.schema.NodeSchemaService import net.corda.node.services.transactions.InMemoryTransactionVerifierService import net.corda.node.services.vault.NodeVaultService import net.corda.nodeapi.internal.persistence.CordaPersistence -import net.corda.nodeapi.internal.persistence.HibernateConfiguration import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.TestIdentity import net.corda.testing.internal.DEV_ROOT_CA diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalTestUtils.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalTestUtils.kt index 2cce63301c..7b528e9fa9 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalTestUtils.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalTestUtils.kt @@ -21,7 +21,6 @@ import net.corda.node.services.config.ConfigHelper import net.corda.node.services.config.configOf import net.corda.node.services.config.parseToDbSchemaFriendlyName import net.corda.node.services.messaging.Message -import net.corda.node.services.messaging.MessagingService import net.corda.nodeapi.internal.persistence.DatabaseConfig import net.corda.nodeapi.internal.persistence.TransactionIsolationLevel import net.corda.testing.database.DatabaseConstants @@ -120,10 +119,6 @@ fun StartedNodeServices.newContext(): InvocationContext = testContext(myInfo.cho fun InMemoryMessagingNetwork.MessageTransfer.getMessage(): Message = message -internal interface InternalMockMessagingService : MessagingService { - fun pumpReceive(block: Boolean): InMemoryMessagingNetwork.MessageTransfer? -} - /** * Make properties appropriate for creating a DataSource for unit tests. * Defaults configuration of in-memory H2 instance. If 'databaseProvider' system property is set then creates diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/RPCDriver.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/RPCDriver.kt index b4de807349..05b5662a83 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/RPCDriver.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/RPCDriver.kt @@ -115,7 +115,7 @@ fun rpcDriver( notarySpecs: List = emptyList(), externalTrace: Trace? = null, jmxPolicy: JmxPolicy = JmxPolicy(), - networkParameters: NetworkParameters = testNetworkParameters(notaries = emptyList()), + networkParameters: NetworkParameters = testNetworkParameters(), notaryCustomOverrides: Map = emptyMap(), inMemoryDB: Boolean = true, cordappsForAllNodes: Set = cordappsInCurrentAndAdditionalPackages(), diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/TestCordappDirectories.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/TestCordappDirectories.kt index 8cb65b0202..d2ccb1c2b5 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/TestCordappDirectories.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/TestCordappDirectories.kt @@ -11,7 +11,7 @@ import java.nio.file.Paths import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.ConcurrentMap - object TestCordappDirectories { +object TestCordappDirectories { private val logger = loggerFor() @@ -20,7 +20,7 @@ import java.util.concurrent.ConcurrentMap private val cordappsCache: ConcurrentMap, Path> = ConcurrentHashMap, Path>() - fun cached(cordapps: Iterable, replaceExistingOnes: Boolean = false, cordappsDirectory: Path = defaultCordappsDirectory): Iterable { + fun cached(cordapps: Iterable, replaceExistingOnes: Boolean = false, cordappsDirectory: Path = defaultCordappsDirectory): Iterable { cordappsDirectory.toFile().deleteOnExit() return cordapps.map { cached(it, replaceExistingOnes, cordappsDirectory) } diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/performance/Injectors.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/performance/Injectors.kt index eafd572ecb..1bd7efc6e3 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/performance/Injectors.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/performance/Injectors.kt @@ -1,16 +1,13 @@ package net.corda.testing.node.internal.performance - import com.codahale.metrics.Gauge import com.codahale.metrics.MetricRegistry -import com.google.common.base.Stopwatch import net.corda.core.concurrent.CordaFuture import net.corda.core.utilities.getOrThrow import net.corda.testing.internal.performance.Rate import net.corda.testing.node.internal.ShutdownManager import org.slf4j.LoggerFactory import java.time.Duration -import java.util.* import java.util.concurrent.CountDownLatch import java.util.concurrent.Executors import java.util.concurrent.Semaphore diff --git a/testing/qa/behave/tools/rpc-proxy/src/main/kotlin/net/corda/behave/service/proxy/CordaRPCProxyClient.kt b/testing/qa/behave/tools/rpc-proxy/src/main/kotlin/net/corda/behave/service/proxy/CordaRPCProxyClient.kt index 6a1708aebe..420fcccd11 100644 --- a/testing/qa/behave/tools/rpc-proxy/src/main/kotlin/net/corda/behave/service/proxy/CordaRPCProxyClient.kt +++ b/testing/qa/behave/tools/rpc-proxy/src/main/kotlin/net/corda/behave/service/proxy/CordaRPCProxyClient.kt @@ -24,6 +24,7 @@ import net.corda.core.serialization.serialize import net.corda.core.transactions.SignedTransaction import net.corda.core.utilities.NetworkHostAndPort import net.corda.core.utilities.contextLogger +import net.corda.nodeapi.internal.PLATFORM_VERSION import net.corda.testing.common.internal.testNetworkParameters import java.io.InputStream import java.net.URL @@ -76,6 +77,8 @@ class CordaRPCProxyClient(private val targetHostAndPort: NetworkHostAndPort) : C return doGet(targetHostAndPort, "registered-flows") } + override val protocolVersion: Int get() = PLATFORM_VERSION + override val networkParameters: NetworkParameters get() = testNetworkParameters() override fun stateMachinesSnapshot(): List {