Commit Graph

143 Commits

Author SHA1 Message Date
Katarzyna Streich
495e870b74 NodeInfo remove main identity (#1284)
* Remove node's main identitiy from NodeInfo.

Preparation for getting rid of services + supporting multiple identities
on the node.
NodeInfo keeps multiple identities as a list. For now the first one is treated as a special one.
Introduced function chooseIdentity in CoreTestUtils as a preparation for proper handling of multiple identities in the future.
Remove legalIdentityKey from ServiceHub, add extension function - chooseIdentity on ServiceHub.
Add `me` field on FlowStateMachineImplemetation, flows should know what the calling identity is.
Remove SERVICES_PREFIX in artemis messaging layer.

* Address minor comments.

* Fixes after rebase.

Remove chooseIdentity from ServiceHub

* Rename me to ourIdentity on FlowLogic

* Fixes after rebase

* Address Ross comments, fixes

* Fix after rebase

* Fix services certificate paths

Apply Patrick's patch.
2017-09-15 14:39:34 +01:00
Ross Nicoll
3d577e5eed CORDA-499: Remove further Kt classes (#1489)
* Change how NetworkHostAndPort is parsed

Change from using a global extension function to parse
NetworkHostAndPort strings, into using a function on the companion
object. This is a lot easier for Java interop and matches the common
style used elsewhere both in Corda and in Java libraries.

* Move JAR extraction into new utils file

* Move path verification function to ArtemisUtils

Move path verification function "requireOnDefaultFileSystem()" to new
ArtemisUtils.kt file, as this makes more sense from a Java interop
perspective.

* Add JvmName to AMQPSchemaExtensions

* Add JvmName to AMQPSerializationScheme

* Revert "Move JAR extraction into new utils file"

This reverts commit 1f0f41909b68ff21cc24b5efd6a1a360393a0a14.

* Reformat code

* Run formatter on ArtemisUtils
2017-09-14 17:34:01 +01:00
Katelyn Baker
2fc83b00a3 CORDA-539 - Integrate enum carpentry into serializer factory (#1508)
* CORDA-539 - Integrate enum carpentry into serializer factory

* CORDA-539 - Review comments

Responding to comments about my comments, mostly fixing spelling and
punctuation errors
2017-09-14 16:27:20 +01:00
Shams Asari
573987d929 Removed X509CertificateHolder from public API, using java.security.X509Certificate instead (#1510) 2017-09-14 15:48:33 +01:00
Shams Asari
943e873ff0 Moved AttachmentsClassLoader out of core (#1504) 2017-09-14 15:40:39 +01:00
Katelyn Baker
094187cfa1 Merge pull request #1473 from corda/feature/kat/carpentEnum
CORDA-539 - Add enum support to the carpenter
2017-09-14 12:58:27 +01:00
Rick Parker
988e3e5007 Some additional serializers to fill in the blanks vs. our default whitelist (#1490) 2017-09-14 09:14:09 +01:00
Ross Nicoll
c8b1eb5a1e CORDA-499: Further Dokka cleanup (#1437)
* Add JvmName annotation to ConfigUtilities
* Merge Kryo.addToWhitelist into KryoSerializationCustomization
2017-09-13 17:06:39 +01:00
Katelyn Baker
a93bd94c44 CORDA-539 - Review comments 2017-09-13 10:48:13 +01:00
Katelyn Baker
ef409c4d65 CORDA-539 - Fix for attempting to create a primitive nullable field
Refactoring meant that the secondary constructor wasn't being called any
more and thus the check wasn't being made. Originally, we always
created copies of fields when constructing a schema which meant we always
called the secondary constructor, now we don't
2017-09-13 10:35:59 +01:00
Katelyn Baker
063771fac4 CORDA-539 - Code Cleanup
Applying IntelliJ's white space reformat as no doubt I didn't follow the
coding convention too closely.

Remove some IntelliJ warnings
2017-09-13 09:52:00 +01:00
Katelyn Baker
c48a37a080 CORDA-539 - Add enum support to the carpenter
If the serializer is going to support enumerated types then the class
carpenter also has to

Refactor the Carpenter schema and fields to add an enum type, add code
in the carpenter to generate enum's and of course add tests
2017-09-13 09:52:00 +01:00
Ross Nicoll
de3468f8a7 Replace X500Name with CordaX500Name (#1447)
Replace X500Name with CordaX500Name, which enforces the specific constraints Corda expects on legal/service identity names.
2017-09-12 01:03:10 +01:00
Viktor Kolomeyko
64963d587c CORDA-540: Expose and fix AMQP serialization problem with UniquenessException (#1470) 2017-09-11 18:43:26 +01:00
Clinton
bc6628a072 ContractState now references contract by class name (#1407)
* ContractState's contract type has been moved to TransactionState and is now a string representing the class name of the contract class to allow classloading of arbitrary contracts from custom classloaders.

* Upgraded isolated JAR to new version.
2017-09-11 16:44:18 +01:00
Shams Asari
4c3ac89d6b Try.Failure is no longer parameterised on Nothing, to avoid any issues with Java 2017-09-10 14:54:32 +01:00
Viktor Kolomeyko
0edaea81d2 CORDA-540: Add a property to make sending stacktraces optional in AMQP mode (#1458) 2017-09-08 17:25:42 +01:00
Viktor Kolomeyko
8710090887 CORDA-540: Fixes to make "node" tests pass in AMQP mode, part 1 (#1455) 2017-09-08 13:46:22 +01:00
Rick Parker
691d9ea0bc Correctly unwrap MissingAttachmentException. (#1454) 2017-09-08 13:41:53 +01:00
Rick Parker
79f1e1ae7f Introduce current context concept for serialization in preparation for WireTransaction changes (#1448) 2017-09-08 08:16:38 +01:00
Rick Parker
6bf2871819 Change descriptor name from string to symbol on the wire to adhere to section 1.5 of the AMQP 1.0 spec (#1423) 2017-09-07 17:05:39 +01:00
Patrick Kuo
57412d4498 Enforce X500Name format defined in design doc (#1427)
* Standardise X500Name format - WIP

* address PR issues

* failing test fix and replace X500Name with getX500Name

* gradle plugin fix

* Added country code validation
2017-09-07 14:47:42 +01:00
Viktor Kolomeyko
d9d17be284 CORDA-540: Small changes to make "finance" tests pass in AMQP mode (#1445) 2017-09-07 13:31:41 +01:00
Viktor Kolomeyko
50c51493c3 CORDA-540: AMQP-forge "example-code" (#1439) 2017-09-07 11:17:55 +01:00
Viktor Kolomeyko
999515db95 CORDA-540: Allow maps as roots of serialization graph (#1432) 2017-09-06 15:06:35 +01:00
Andrzej Cichocki
b2051952d2 Add kotlin throwables to whitelist (#1424) 2017-09-06 12:58:06 +01:00
Viktor Kolomeyko
349692f831 CORDA-540: Tighten-up the unit test to prevent concrete collection classes to be used 2017-09-05 16:50:04 +01:00
Viktor Kolomeyko
cac2465ea5 CORDA-540: Special provisions when artificial "AnyType" is used 2017-09-05 16:50:04 +01:00
Viktor Kolomeyko
a01f390515 CORDA-540: Upgrade version of "org.apache.qpid:proton-j" used and minor project files changes 2017-09-05 16:50:04 +01:00
Viktor Kolomeyko
cd912f8add CORDA-540: Allow lists as root object in AMQP serialization graph 2017-09-05 16:50:04 +01:00
Rick Parker
ead4d09011 Plumb in plugin whitelist additions to AMQP implementation. (#1415) 2017-09-05 08:35:26 +01:00
Ross Nicoll
0df93e6e50 Start cleaning up node API Dokka comments (#1397)
* Change RPCApi comments to inline from Dokka, as the existing comments are not API documentation,
and render simply as "The RPC protocol:" in several places, which is unhelpful.
* Rewrite RPCApi comments to no longer be in semi-Dokka format, but instead better reflect they are functional documentation.
* Add Dokka documentation around RPC API
* Change JvmStatics to const
2017-09-04 22:29:41 +01:00
Rick Parker
015483656a Fix bad merge bdb87e38ca (#1411) 2017-09-04 16:21:58 +01:00
Katelyn Baker
a829dfadaa Bring enum serializer into line with AMQP
AMQP doesn't define an enum type itself yet the old implementation
listed our snum type as that in the schema despite what we are actually
doing which is serialising the enum down as a list of a string and an
int accompanied by a list of AMQP choices that represent all of the enum
values

Review Comments

Use fingerprinting of the enum types to catch whenever they're changed,
include the enum constants in the fingerprint to avoid any collisions
2017-09-04 11:56:45 +01:00
Katelyn Baker
ed2b2b02ca Add support for serialising enum types - Part 1
Part 2 will address the carpenting of enum classes
2017-09-04 11:56:36 +01:00
Rick Parker
f0b2b0a566 Change the condition for what is stored in AMQP object history for object reference logic (#1404) 2017-09-04 11:23:13 +01:00
Rick Parker
fef8a997f2 Fix the ToStringSerializer so it interacts with reference counting co… (#1385)
* Fix the ToStringSerializer so it interacts with reference counting correctly, and stop ref counting byte arrays since they are invariable wrapped in an object we do reference count.

* Pull out object reference condition into a helper function shared by serialization and deserialization
2017-09-01 16:07:30 +01:00
Viktor Kolomeyko
954ed69102 CORDA-540: Introduce mandatory reason for "kryoSpecific" (#1386)
* CORDA-540: Introduce mandatory reason for "kryoSpecific"

... before we forget why they are ignored in such a way

* CORDA-540: Write a test that exposes list serialization problem in AMQP mode

* Revert "Remove CompositeSignaturesWithKeys"

This reverts commit 9b3cad3
2017-09-01 14:45:14 +01:00
Ross Nicoll
7e3dd4c12c Restructure net.corda.core.crypto package
* Rename KeyFactory to CompositeKeyFactory
* Move expandedCompositeKeys into TestDSL as the only place that uses it
* Move NullKeys out of their own package
* Move remaining crypto classes into superpackage
* Move utility classes out of crypto and into utilities package
2017-09-01 10:55:58 +01:00
Rick Parker
9a8e7294e7 Fix AMQP object graph alignment bug and an issue with private constru… (#1376)
* Fix AMQP object graph alignment bug and an issue with private constructors.
2017-08-31 18:15:56 +01:00
Rick Parker
35dec9abdc Make addToWhitelist vararg for compactness. (#1361) 2017-08-31 13:24:45 +01:00
Viktor Kolomeyko
4387be0c4b CORDA-540: Mark CompositeKeyTests which works with cyclic graphs as Kryo specific (#1354) 2017-08-30 11:41:04 +01:00
Viktor Kolomeyko
0176184a86 CORDA-540: Cater for repeated object references found in the AMQP serialization graph (#1326)
Also provide unit test that clearly exposes the problem
2017-08-29 17:59:03 +01:00
Katelyn Baker
414f2b4b40 Review Comments - give test methods a better name 2017-08-29 16:23:10 +01:00
Katelyn Baker
1e023fcf54 Add alt serialise method that returns the schema and the bytes
For future testing it would be nice, post serialisation, to have easy
access to the serialised objects schema so we can check how it was
serialised. Adding a helper function to return a data class that does
this in the same way we can for deserialize
2017-08-29 15:20:43 +01:00
Rick Parker
c61b036844 Some custom serializers, fixes to generics handling, some annotations and added NonEmptySet as a special case of Set. (#1330) 2017-08-25 15:09:43 +01:00
Katelyn Baker
dda9d22264 Review Comments
* Typos in comments
 * Refactor some one liners
2017-08-24 17:36:01 +01:00
Katelyn Baker
e4a2529de0 More Review Comments
Move more logic into the constructor factory for the evolver seraliser
rather than everytime we read
2017-08-24 17:36:01 +01:00
Katelyn Baker
cf9fbc715d Review Comments
Refactor small bits of the serialiser, move things out of the read
methods and into the make factory companion object
2017-08-24 17:36:01 +01:00
Katelyn Baker
299b8026c7 Add constructor annotation for evolve selection
Current implementation is such that if we find *a* constructor that
works for us we use that, this is of course rather non deterministic, it
also means we may not select the best constructor

for example

old versions had constructors that took

V1: A B
V2: A B C D

if current version, V3 is

V3: A B C D E

which provides secondary constructors for the above then there is a
chance we'd de-serialise objects that were serialised as V2 using the V1
constructor and thus throw away information we don't need to

Additional Changes:

Fixes following rebase onto master
2017-08-24 17:36:01 +01:00