Commit Graph

885 Commits

Author SHA1 Message Date
Katelyn Baker
d76c1e75a4 Carpenter / amqp syntesis tidyup
- squashes a lot of WIP / rebase / code reformat commits
2017-07-14 10:35:33 +01:00
Katelyn Baker
b4a62722fc Add recursive dependency resolution to schema generation
A complete amqp schema can now be used to generate a set of carpetner
schemas representing all of the classes not found on the deserialzing
end.

A dependency and depdendent chain is setup such that all classes are
created in the order required

Squashed commit messages:
	* IntelliJ reformat of the code

	* Merge the interface synthesis changes and rebase onto the tip of master

	  Somethign is very broken in the AMQP -> Carpenter schema code but want a
	  commit so I at least know the actual carpenter is merged

	* Nested schema creation now works with dependencies recursvly created in
	  the carpenter

	* Unit test fixes

	* Remove spurious prints from tests

	* Remove warnings

	* Don't add cladd member dep by name

	  Since that's the name of the field, not the type we depend on. If we do
	  we'll never actually be able to craft the type as the dependency chain
	  will be horribly broken

	  Various bug fixes
2017-07-14 10:35:33 +01:00
Katelyn Baker
ce172887d0 Unit Tests for the amqp -> carpenter schema
Squahed commit mesages:
	* Better tests
	* WIP
	* WIP
2017-07-14 10:35:00 +01:00
Katelyn Baker
4cbf31681b Initial work towards integrating the serializer with the carpenter
Unit tests that pull out the envelope from a deserialsed object (which
we have already serialised) then using the AMQP schema contained within
convert that to a carpenter schema and build an object

Currently testing only simple classes with a single type member

Squashed merge commits:
	* Fix for the type issue in the SerializerFactory

  	  Needs to pull in the actual Java types otherwise we use the Kotlin types
	  as the map keys which will never correspond to the java types that the
	  wrapper wraps around the primitive before doing a map lookup

	  Boolean just doesn't seem to work as pulling that in starts breaking
	  Kotlin and Character also seems broken. There is a fix for this also on
	  Rick's branch so pushing this in for now and can use his actual changes
	  when they're available on Master

	* Better tests

	* Add support for sub classes known to the JVM

	* Initial work towards integrating serializer with the carpenter

	  Unit tests that pull out the envelope from a deserialsed object (which
	  we have already serialized) then using the AMQP schema contained within
	  convert that to a carpenter schema and build an object

	  Currently testing only simple classes with a single type member
2017-07-14 10:28:36 +01:00
Katelyn Baker
e48c1c1689 Merge pull request #1042 from corda/carpenterBeans
Fix toString generated method that breaks Introspection for BEANS
2017-07-13 18:40:24 +01:00
Shams Asari
a49baddd4b Moved KeyStoreUtilities out of core and into node 2017-07-13 16:54:30 +01:00
Katelyn Baker
5438e82e68 Merge pull request #1029 from corda/kat-makePutObjectExtensible
Make serialise putObject function an open function
2017-07-13 16:38:55 +01:00
Katelyn Baker
056811845b Review Comments - rename putObject to writeSchema 2017-07-13 14:23:08 +01:00
Katelyn Baker
0d0a6d7966 Fix toString generated method that breaks Introspection for BEANS
Pass signature as null, not empty string, otherwise the class asm isn't
correct. Using javap at the command line prior to the fix yields

public class MyClass implements
net.corda.core.serialization.carpenter.SimpleFieldAccess {
    protected final java.lang.Integer a;
        descriptor: Ljava/lang/Integer;
    public MyClass(java.lang.Integer);
        descriptor: (Ljava/lang/Integer;)V

    public java.lang.Integer getA();
        descriptor: ()Ljava/lang/Integer;

    public java.lang.Object get(java.lang.String);
        descriptor:
(Ljava/lang/String;)Ljava/lang/Object;
Error: A serious internal error has occurred: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
2017-07-13 13:32:31 +01:00
Shams Asari
e93cdf29f8 Moved the core flows into net.corda.core.flows 2017-07-13 13:27:11 +01:00
Shams Asari
fa4577d236 Cleaned up NonEmptySet and expanded its usage in the codebase 2017-07-13 12:32:33 +01:00
Konstantinos Chalkias
ce06ad3878 Remove DigitalSignature.LegallyIdentifiable
Remove DigitialSignature.LegallyIdentifiable
2017-07-13 11:24:33 +01:00
Ross Nicoll
773aa28873 Clean up IssuerFlow
* Switch to using anonymous party as recipient
* Enable anonymisation for issuance as well as move in issuer flows.
* Pass notary into issuer flow rather than taking a notary at random from the network map.
* Enable anonymisation in Bank of Corda RPC test
* Parameterize issuer flow tests into anonymous and deanonymised versions
2017-07-13 11:23:56 +01:00
Shams Asari
7eed258bcb Fixed incorrect package declarations in CommonSchema and VaultSchema 2017-07-12 20:04:28 +01:00
Shams Asari
6e570b4d65 Moved dummy stuff from core into test-utils 2017-07-12 18:11:57 +01:00
Katelyn Baker
534f60dc57 Make serialise putObject function an open function
For testing I need to be able to mess with the schema before it gets
added to the envelope, extract the function where that happens and make
it open so the tests can do what they want
2017-07-12 14:37:02 +01:00
Patrick Kuo
78ecff7933 Added composite key provider for storing composite keys in keystore (#1006)
* Add unit tests around decoding composite keys

(cherry picked from commit 9ccdd8e)

* Start writing a Composite signature scheme

(cherry picked from commit 72ac3a5)

* Composite key serialisation

* refactoring

* * Address PR issues

* * Address PR issues

* * Address PR issues

* * Address PR issues

* fix up after rebase
2017-07-12 12:13:29 +01:00
josecoll
5f7b8f6ec3 Vault Query Pagination simplification (#997)
* Pagination improvements (fail-fast on too many results without pagination specification)
* Fix incorrectly returned results count.
* Performance optimisation: only return totalStatesAvailable count on Pagination specification.
* Changed DEFAULT_PAGE_NUMBER to 1 (eg. page numbering starts from 1)
* Changed MAX_PAGE_SIZE to Int.MAX_VALUE
* Fixed compiler WARNINGs in Unit tests.
* Fixed minimum page size check (1).
* Updated API-RST docs with behavioural notes.
* Updated documentation (RST and API);
2017-07-12 09:53:15 +01:00
Katelyn Baker
057fa0443b Remove debug println that snuck past code review 2017-07-11 14:42:22 +01:00
Shams Asari
7caee508ec Refactored ErrorOr into Try, with Success and Failure data sub-classes, and moved it into core.utilities 2017-07-11 12:10:38 +01:00
Patrick Kuo
7e8de79848 Legal name validation for X500Name (#983)
* * Legal name validation for X500Name while loading from config file.

* * Removed unintended changes.
2017-07-11 12:09:30 +01:00
Konstantinos Chalkias
d52b0e5db9 NodeAndWeight deterministic comparator (#1003)
NodeAndWeight deterministic ordering by comparing hashes of public keys when required.
2017-07-11 10:18:22 +01:00
Katelyn Baker
5b78863e57 Merge pull request #942 from corda/kat-carpentty
Add array support to the class carpenter
2017-07-10 17:24:28 +01:00
josecoll
c81ef7eb93 Vault Query Sort by StateRef (or constituents: txId, index) (#990)
* Provide sorting by state reference (and individual constituents of: txId, index)

* Fixed formatting.

* Updated import following rebase from master.

* Updated import following rebase from master.
2017-07-10 12:49:00 +01:00
Katelyn Baker
fd3a827438 Annotation testing 2017-07-10 11:50:24 +01:00
Shams Asari
f718acb939 Moved CordaException.kt to base core package 2017-07-10 10:36:59 +01:00
Andrzej Cichocki
d2869e4f45 Refactor then/success/failure (#984)
to make ListenableFuture replacement less fiddly.
2017-07-07 15:50:50 +01:00
Shams Asari
fb0a043485 Moved dummy contracts to test-utils 2017-07-07 15:16:29 +01:00
Andrzej Cichocki
cefa14507a Retire HostAndPort (#962)
* Don't attempt to parse a resolved InetSocketAddress toString
* A mock node isn't reachable via an address
2017-07-07 15:11:07 +01:00
Shams Asari
7822118835 Moved random63BitValue() to CryptoUtils 2017-07-07 12:19:55 +01:00
Shams Asari
984fbd8995 Moved loggerFor and other useful Kotlin extensions into KotilnUtils.kt and moved LogHelper into test-utils 2017-07-07 00:14:20 +01:00
Shams Asari
8f1529b863 Moved ByteArrays.kt to core.utilities 2017-07-06 17:58:18 +01:00
Katelyn Baker
c1cd7d6b79 Take out blanket import of Character TYPE 2017-07-06 17:03:29 +01:00
Shams Asari
fc97fb2368 Removed DeserializeAsKotlinObjectDef interface as serialisation of Kotlin objects is now handled automatically 2017-07-06 15:57:20 +01:00
Shams Asari
8fc76b3803 Moved VersionInfo out of core and into node 2017-07-06 14:31:43 +01:00
Joel Dudley
3063debd98 Moves to builder syntax for TxBuilder. Adds attachments and time-windows to withItems. 2017-07-06 14:23:43 +01:00
Katelyn Baker
81b84ebf5c Review comments
Name Exceptions <blah>Exception
Swap null / non null annotations onto the correct classes
Don't shadow parameters with local vars
Explicitly handle Character Type
2017-07-06 14:09:14 +01:00
Shams Asari
c6e165947b Added background checkpoint checker to make sure they're at least deserialisable 2017-07-06 13:11:46 +01:00
Shams Asari
54aa4802f9 Clarifying the need for a single Party c'tor for InitiatedBy flows 2017-07-06 12:31:22 +01:00
Shams Asari
182c9cceb5 Cleaned up the QueryCriteria API to be more Java friendly 2017-07-06 11:08:54 +01:00
josecoll
44f57639d2 Vault Query Aggregate Function support (#950)
* Partial (ie. incomplete) implementation of Aggregate Functions.

* Completed implementation of Aggregate Functions (sum, count, max, min, avg) with optional grouping.

* Completed Java DSL and associated JUnit tests.

* Added optional sorting by aggregate function.

* Added Jvm filename annotation on QueryCriteriaUtils.

* Added documentation (API and RST with code samples).

* Incorporating feedback from MH - improved readability in structuring Java and/or queries.

* Remove redundant import.

* Removed redundant commas.

* Streamlined expression parsing (in doing so, remove the ugly try-catch raised by RP in PR review comments.)

* Added JvmStatic and JvmOverloads to Java DSL; removed duplicate Kotlin DSL functions using default params; changed varargs to lists due to ambiguity

* Fix missing imports after rebase from master.

* Fix errors following rebase from master.

* Updates on expression handling following feedback from RP.
2017-07-06 10:57:59 +01:00
Konstantinos Chalkias
baaef30d5b CompositeKey validation checks (#956) 2017-07-05 16:14:18 +01:00
Katelyn Baker
32543021c9 Review comments and fix warnings 2017-07-05 14:26:03 +01:00
Shams Asari
2973755bc8 Moved TestConstants.kt from core into test-utils 2017-07-05 11:54:43 +01:00
Ross Nicoll
3176ecfecf Clean up transaction key flow
* Identities returned from TxKeyFlow were backwards, meaning keys were incorrectly assigned to the remote and local identities. Added unit test covering this case and corrected the flow logic.
* Rename TxKeyFlow to TransactionKeyFlow
* Correct registration of transaction key flows
* Move TransactionKeyFlow.Provider into CoreFlowHandlers
* Move TransactionKeyFlow.Request up to the top level class instead of being a class within an object.
* Remove AbstractIdentityFlow and move the validation logic into individual flows to make it clearer that it's registering the received identities.
* Cash flows now return the recipient identity instead of full identity lookup, as this is what
the caller actually needs and simplifies a lot of cases.
2017-07-05 11:39:08 +01:00
Katelyn Baker
7d8d17ac08 Small tidyup 2017-07-05 11:05:27 +01:00
Joel Dudley
65f385953f Changes the name of the addTimeWindow method to setTimeWindow. 2017-07-05 10:57:18 +01:00
Katelyn Baker
6dc7f694e4 Add explicit support for nullable types
Remove prohibition against non string object classes such as arrays

Squashed Commmits:
	* Tidyup whitespace
	* WIP
	* Review Comments
	* WIP - adding concept of nullabltily into the carpenter
	* Add explicit nullable and non nullable fields
	* Rebase onto master, fix package names in carpenter
2017-07-05 10:47:26 +01:00
Matthew Nesbit
7eaac8a306 Merge pull request #968 from corda/mnesbit-tidy-test-classes
Move test classes out of api namespaces
2017-07-05 10:20:03 +01:00
josecoll
f732d2cefe FIX Vault Query defaults to UNCONSUMED in all QueryCriteria types (#958)
* Fix https://github.com/corda/corda/issues/949 by providing a default StateStatus argument to all QueryCriteria types.

* Abstracted Common Criteria into its own abstract data class + associated visitor.

* Incorporating feedback from RP PR review.
2017-07-05 10:01:35 +01:00