Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/corda/corda into minorUpd…
Browse files Browse the repository at this point in the history
…ateToContractErrorMessage
  • Loading branch information
rogersanick committed Aug 21, 2019
2 parents 9b24463 + b13f00e commit e095d73
Show file tree
Hide file tree
Showing 584 changed files with 17,043 additions and 6,781 deletions.
6 changes: 2 additions & 4 deletions .ci/api-current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1537,8 +1537,6 @@ public final class net.corda.core.crypto.CordaSecurityProvider extends java.secu
public static final class net.corda.core.crypto.CordaSecurityProvider$Companion extends java.lang.Object
public <init>(kotlin.jvm.internal.DefaultConstructorMarker)
##
public final class net.corda.core.crypto.CordaSecurityProviderKt extends java.lang.Object
##
public final class net.corda.core.crypto.Crypto extends java.lang.Object
@NotNull
public static final java.security.PrivateKey decodePrivateKey(String, byte[])
Expand Down Expand Up @@ -2897,7 +2895,7 @@ public abstract class net.corda.core.identity.AbstractParty extends java.lang.Ob
##
@DoNotImplement
@CordaSerializable
public final class net.corda.core.identity.AnonymousParty extends net.corda.core.identity.AbstractParty
public final class net.corda.core.identity.AnonymousParty extends net.corda.core.identity.AbstractParty implements net.corda.core.flows.Destination
public <init>(java.security.PublicKey)
@Nullable
public net.corda.core.identity.CordaX500Name nameOrNull()
Expand Down Expand Up @@ -2978,7 +2976,7 @@ public final class net.corda.core.identity.IdentityUtils extends java.lang.Objec
##
@DoNotImplement
@CordaSerializable
public final class net.corda.core.identity.Party extends net.corda.core.identity.AbstractParty
public final class net.corda.core.identity.Party extends net.corda.core.identity.AbstractParty implements net.corda.core.flows.Destination
public <init>(java.security.cert.X509Certificate)
public <init>(net.corda.core.identity.CordaX500Name, java.security.PublicKey)
@NotNull
Expand Down
372 changes: 370 additions & 2 deletions .idea/compiler.xml

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Corda Build

## Build Environment Variables

CORDA_CORE_TESTING_FORKS : Number of JVMS to fork for running unit tests in :core

CORDA_NODE_INT_TESTING_FORKS : Number of JVMS to fork for running integration tests in :node
CORDA_NODE_TESTING_FORKS : Number of JVMS to fork for running unit tests in :node

CORDA_INT_TESTING_FORKS : Global number of JVMS to fork for running integration tests
CORDA_TESTING_FORKS : Global number of JVMS to fork for running unit tests
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ see changes to this list.
* Milen Dobrinov (Industria)
* Mohamed Amine LEGHERABA
* Mustafa Ozturk (Natixis)
* Manish Kumar (ChainThat)
* Nick Skinner (Northern Trust)
* Nigel King (R3)
* Nitesh Solanki (Persistent Systems Limited)
Expand All @@ -161,6 +162,7 @@ see changes to this list.
* Pekka Kaipio (OP Financial)
* Phillip Griffin
* Piotr Piskorski (Nordea)
* Prannav Kotamraju (Digiledge)
* Przemyslaw Bak (R3)
* quiark
* RangerOfFire
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Corda is an open source blockchain project, designed for business from the start
1. Read the [Getting Started](https://docs.corda.net/getting-set-up.html) documentation
2. Run the [Example CorDapp](https://docs.corda.net/tutorial-cordapp.html)
3. Read about Corda's [Key Concepts](https://docs.corda.net/key-concepts.html)
3. Follow the [Hello, World! tutorial](https://docs.corda.net/hello-world-introduction.html)
4. Follow the [Hello, World! tutorial](https://docs.corda.net/hello-world-introduction.html)

## Useful links

Expand Down
21 changes: 21 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Security Policy

## Reporting a Vulnerability

Vulnerabilities in Corda can be reported by following the Corda responsible disclosure policy:

https://www.corda.net/participate/security.html

## Security Advisories

Security announcements affecting Corda will be published on the Corda mailing list. People can subscribe to [email protected] to receive security updates when they are made available.

## Supported Versions

Security updates are made for the latest version of Corda.

| Version | Supported |
| ------- | ------------------ |
| 4.x | :white_check_mark: |
| 3.x | :x: |
| < 3 | :x: |
106 changes: 66 additions & 40 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,72 +15,96 @@ buildscript {

ext.quasar_group = 'co.paralleluniverse'
ext.quasar_version = constants.getProperty("quasarVersion")
ext.quasar_exclusions = [
'co.paralleluniverse**',
'groovy**',
'com.esotericsoftware.**',
'jdk**',
'junit**',
'kotlin**',
'net.rubygrapefruit.**',
'org.gradle.**',
'org.apache.**',
'org.jacoco.**',
'org.junit**',
'org.slf4j**',
'worker.org.gradle.**',
'com.nhaarman.mockito_kotlin**',
'org.assertj**',
'org.hamcrest**',
'org.mockito**',
'org.opentest4j**'
]

// gradle-capsule-plugin:1.0.2 contains capsule:1.0.1 by default.
// We must configure it manually to use the latest capsule version.
ext.capsule_version = '1.0.3'

ext.asm_version = '5.0.4'
ext.asm_version = '7.1'
ext.artemis_version = '2.6.2'
ext.jackson_version = '2.9.8'
ext.jetty_version = '9.4.7.v20170914'
// TODO Upgrade Jackson only when corda is using kotlin 1.3.10
ext.jackson_version = '2.9.7'
ext.jetty_version = '9.4.19.v20190610'
ext.jersey_version = '2.25'
ext.assertj_version = '3.8.0'
ext.slf4j_version = '1.7.25'
ext.log4j_version = '2.9.1'
ext.servlet_version = '4.0.1'
ext.assertj_version = '3.12.2'
ext.slf4j_version = '1.7.26'
ext.log4j_version = '2.11.2'
ext.bouncycastle_version = constants.getProperty("bouncycastleVersion")
ext.guava_version = constants.getProperty("guavaVersion")
ext.caffeine_version = constants.getProperty("caffeineVersion")
ext.disruptor_version = constants.getProperty("disruptorVersion")
ext.metrics_version = constants.getProperty("metricsVersion")
ext.metrics_new_relic_version = constants.getProperty("metricsNewRelicVersion")
ext.okhttp_version = '3.14.1'
ext.okhttp_version = '3.14.2'
ext.netty_version = '4.1.22.Final'
ext.typesafe_config_version = constants.getProperty("typesafeConfigVersion")
ext.fileupload_version = '1.3.3'
ext.fileupload_version = '1.4'
// Legacy JUnit 4 version
ext.junit_version = '4.12'
// Need this version to access classpath scanning error handling fix -
// see https://github.com/junit-team/junit5/commit/389de48c2a18c5a93a7203ef424aa47a8a835a74
// Upgrade to 5.5.x when GA release is available.
ext.junit_vintage_version = '5.5.0-M1'
ext.junit_jupiter_version = '5.5.0-M1'
ext.junit_platform_version = '1.4.2'
ext.mockito_version = '2.18.3'
ext.mockito_kotlin_version = '1.5.0'
ext.hamkrest_version = '1.4.2.2'
ext.junit_vintage_version = '5.5.0-RC1'
ext.junit_jupiter_version = '5.5.0-RC1'
ext.junit_platform_version = '1.5.0-RC1'
ext.mockito_version = '2.28.2'
ext.mockito_kotlin_version = '1.6.0'
ext.hamkrest_version = '1.7.0.0'
ext.jopt_simple_version = '5.0.2'
ext.jansi_version = '1.14'
ext.hibernate_version = '5.3.10.Final'
ext.h2_version = '1.4.197' // Update docs if renamed or removed.
ext.jansi_version = '1.18'
ext.hibernate_version = '5.4.3.Final'
ext.h2_version = '1.4.199' // Update docs if renamed or removed.
ext.postgresql_version = '42.2.5'
ext.rxjava_version = '1.3.8'
ext.dokka_version = '0.9.17'
ext.eddsa_version = '0.2.0'
ext.dependency_checker_version = '4.0.0'
ext.commons_collections_version = '4.1'
ext.dependency_checker_version = '5.2.0'
ext.commons_collections_version = '4.3'
ext.beanutils_version = '1.9.3'
ext.crash_version = '810d2b774b85d4938be01b9b65e29e4fddbc450b'
ext.jsr305_version = constants.getProperty("jsr305Version")
ext.shiro_version = '1.4.0'
ext.shiro_version = '1.4.1'
ext.artifactory_plugin_version = constants.getProperty('artifactoryPluginVersion')
ext.hikari_version = '2.5.1'
ext.liquibase_version = '3.5.5'
ext.hikari_version = '3.3.1'
ext.liquibase_version = '3.6.3'
ext.artifactory_contextUrl = 'https://ci-artifactory.corda.r3cev.com/artifactory'
ext.snake_yaml_version = constants.getProperty('snakeYamlVersion')
ext.docker_compose_rule_version = '0.33.0'
ext.selenium_version = '3.8.1'
ext.docker_compose_rule_version = '0.35.0'
ext.selenium_version = '3.141.59'
ext.ghostdriver_version = '2.1.0'
ext.eaagentloader_version = '1.0.3'
ext.proguard_version = constants.getProperty('proguardVersion')
ext.jsch_version = '0.1.54'
ext.commons_cli_version = '1.4'
ext.jsch_version = '0.1.55'
ext.protonj_version = '0.33.0' // Overide Artemis version
ext.snappy_version = '0.4'
ext.class_graph_version = '4.6.12'
ext.class_graph_version = '4.8.41'
ext.jcabi_manifests_version = '1.1'
ext.picocli_version = '3.8.0'
ext.picocli_version = '3.9.6'
ext.commons_io_version = '2.6'
ext.controlsfx_version = '8.40.15'
ext.fontawesomefx_commons_version = '8.15'
ext.fontawesomefx_fontawesome_version = '4.7.0-5'

// Name of the IntelliJ SDK created for the deterministic Java rt.jar.
// ext.deterministic_idea_sdk = '1.8 (Deterministic)'
Expand Down Expand Up @@ -208,24 +232,14 @@ allprojects {
}

tasks.withType(Test) {
useJUnitPlatform()

forkEvery = 10
failFast = project.hasProperty('tests.failFast') ? project.property('tests.failFast').toBoolean() : false

// Prevent the project from creating temporary files outside of the build directory.
systemProperty 'java.io.tmpdir', buildDir.absolutePath

maxHeapSize = "1g"

if (project.hasProperty('test.parallel') && project.property('test.parallel').toBoolean()) {
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) as int ?: 1
}

if (System.getProperty("test.maxParallelForks") != null) {
maxParallelForks = Integer.getInteger('test.maxParallelForks')
logger.debug("System property test.maxParallelForks found - setting max parallel forks to $maxParallelForks for $project")
}

if (project.path.startsWith(':experimental') && System.getProperty("experimental.test.enable") == null) {
enabled = false
}
Expand All @@ -235,6 +249,16 @@ allprojects {
extensions.configure(TypeOf.typeOf(JacocoTaskExtension)) { ex ->
ex.append = false
}

maxParallelForks = (System.env.CORDA_TESTING_FORKS == null) ? 1 : "$System.env.CORDA_TESTING_FORKS".toInteger()

systemProperty 'java.security.egd', 'file:/dev/./urandom'
}

tasks.withType(Test){
if (name.contains("integrationTest")){
maxParallelForks = (System.env.CORDA_INT_TESTING_FORKS == null) ? 1 : "$System.env.CORDA_INT_TESTING_FORKS".toInteger()
}
}

group 'net.corda'
Expand Down Expand Up @@ -375,6 +399,7 @@ bintrayConfig {
'corda-node-api',
'corda-test-common',
'corda-test-utils',
'corda-test-db',
'corda-jackson',
'corda-webserver-impl',
'corda-webserver',
Expand All @@ -390,7 +415,8 @@ bintrayConfig {
'corda-tools-cliutils',
'corda-common-configuration-parsing',
'corda-common-validation',
'corda-common-logging'
'corda-common-logging',
'corda-tools-network-builder'
]
license {
name = 'Apache-2.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,17 @@ open class StringToMethodCallParser<in T : Any> @JvmOverloads constructor(
/** Returns a string-to-string map of commands to a string describing available parameter types. */
val availableCommands: Map<String, String>
get() {
return methodMap.entries().map { entry ->
val (name, args) = entry // TODO: Kotlin 1.1
val argStr = if (args.parameterCount == 0) "" else {
val paramNames = methodParamNames[name]!!
val typeNames = args.parameters.map { it.type.simpleName }
val paramTypes = paramNames.zip(typeNames)
paramTypes.joinToString(", ") { "${it.first}: ${it.second}" }
return methodMap.entries().mapNotNull { (name, args) ->
if (args.parameterCount == 0) {
Pair(name, "")
} else {
methodParamNames[name]?. let { params ->
val typeNames = args.parameters.map { it.type.simpleName }
val paramTypes = params.zip(typeNames)
val paramNames = paramTypes.joinToString(", ") { "${it.first}: ${it.second}" }
Pair(name, paramNames)
}
}
Pair(name, argStr)
}.toMap()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package net.corda.client.jackson.internal

import com.fasterxml.jackson.annotation.*
import com.fasterxml.jackson.annotation.JsonCreator.Mode.*
import com.fasterxml.jackson.annotation.JsonCreator.Mode.DISABLED
import com.fasterxml.jackson.annotation.JsonInclude.Include
import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.core.JsonParseException
Expand Down Expand Up @@ -34,6 +34,7 @@ import net.corda.core.internal.DigitalSignatureWithCert
import net.corda.core.internal.createComponentGroups
import net.corda.core.internal.kotlinObjectInstance
import net.corda.core.node.NodeInfo
import net.corda.core.serialization.SerializeAsToken
import net.corda.core.serialization.SerializedBytes
import net.corda.core.serialization.deserialize
import net.corda.core.serialization.serialize
Expand All @@ -43,7 +44,8 @@ import net.corda.core.utilities.NetworkHostAndPort
import net.corda.core.utilities.parseAsHex
import net.corda.core.utilities.toHexString
import net.corda.serialization.internal.AllWhitelist
import net.corda.serialization.internal.amqp.*
import net.corda.serialization.internal.amqp.SerializerFactoryBuilder
import net.corda.serialization.internal.amqp.hasCordaSerializable
import java.math.BigDecimal
import java.security.PublicKey
import java.security.cert.CertPath
Expand Down Expand Up @@ -97,7 +99,7 @@ private class CordaSerializableBeanSerializerModifier : BeanSerializerModifier()
beanDesc: BeanDescription,
beanProperties: MutableList<BeanPropertyWriter>): MutableList<BeanPropertyWriter> {
val beanClass = beanDesc.beanClass
if (hasCordaSerializable(beanClass) && beanClass.kotlinObjectInstance == null) {
if (hasCordaSerializable(beanClass) && beanClass.kotlinObjectInstance == null && !SerializeAsToken::class.java.isAssignableFrom(beanClass)) {
val typeInformation = serializerFactory.getTypeInformation(beanClass)
val properties = typeInformation.propertiesOrEmptyMap
val amqpProperties = properties.mapNotNull { (name, property) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ class JacksonSupportTest(@Suppress("unused") private val name: String, factory:
}

private fun JsonNode.assertHasOnlyFields(vararg fieldNames: String): List<JsonNode> {
assertThat(fieldNames()).containsOnly(*fieldNames)
assertThat(fieldNames()).toIterable().containsOnly(*fieldNames)
return fieldNames.map { this[it] }
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package net.corda.client.jfx.model

import javafx.application.Platform
import javafx.beans.property.SimpleObjectProperty
import net.corda.client.rpc.internal.ReconnectingCordaRPCOps
import net.corda.client.rpc.internal.asReconnectingWithInitialValues
import net.corda.core.contracts.ContractState
import net.corda.core.flows.StateMachineRunId
import net.corda.core.identity.Party
Expand Down Expand Up @@ -85,24 +83,19 @@ class NodeMonitorModel : AutoCloseable {
}.toSet()
val consumedStates = statesSnapshot.states.toSet() - unconsumedStates
val initialVaultUpdate = Vault.Update(consumedStates, unconsumedStates, references = emptySet())
vaultUpdates.asReconnectingWithInitialValues(listOf(initialVaultUpdate))
.subscribe(
onNext = vaultUpdatesSubject::onNext,
onDisconnect = { Platform.runLater { proxyObservable.value = null } },
onReconnect = { Platform.runLater { proxyObservable.value = rpc } },
onStop = {})
vaultUpdates.startWith(initialVaultUpdate).subscribe(vaultUpdatesSubject::onNext)

// Transactions
val (transactions, newTransactions) = rpc.internalVerifiedTransactionsFeed()
newTransactions.asReconnectingWithInitialValues(transactions).subscribe(transactionsSubject::onNext)
newTransactions.startWith(transactions).subscribe(transactionsSubject::onNext)

// SM -> TX mapping
val (smTxMappings, futureSmTxMappings) = rpc.stateMachineRecordedTransactionMappingFeed()
futureSmTxMappings.asReconnectingWithInitialValues(smTxMappings).subscribe(stateMachineTransactionMappingSubject::onNext)
futureSmTxMappings.startWith(smTxMappings).subscribe(stateMachineTransactionMappingSubject::onNext)

// Parties on network
val (parties, futurePartyUpdate) = rpc.networkMapFeed()
futurePartyUpdate.asReconnectingWithInitialValues(parties.map(MapChange::Added)).subscribe(networkMapSubject::onNext)
futurePartyUpdate.startWith(parties.map(MapChange::Added)).subscribe(networkMapSubject::onNext)

val stateMachines = rpc.stateMachinesSnapshot()

Expand Down
Loading

0 comments on commit e095d73

Please sign in to comment.