Commit Graph

941 Commits

Author SHA1 Message Date
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
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
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
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
Joel Dudley
65f385953f Changes the name of the addTimeWindow method to setTimeWindow. 2017-07-05 10:57:18 +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
Matthew Nesbit
3ef5c39633 Put test classes into clear namespaces, so that they don't pollute the API. 2017-07-05 09:14:22 +01:00
Katelyn Baker
88a8eabd60 Merge pull request #946 from corda/carpenterTestingBootstrap
Add secondry deserializer to return amqp envelope
2017-07-05 08:48:07 +01:00
Katelyn Baker
a33d5dcd2f Add Tests to class name 2017-07-04 20:24:00 +01:00
Shams Asari
46e23b7716 Clean up of ServiceHubInternal, including how it's created in AbstractNode 2017-07-03 17:05:36 +01:00
Katelyn Baker
56402c744a Merge pull request #955 from corda/kat-carpenterMoveToCore
Move carpenter into core
2017-07-03 16:53:03 +01:00
Joel Dudley
7df8c50167 Adds helper methods to grab a LedgerTx or verify a SignedTx. Deprecates builder signing methods. 2017-07-03 15:53:48 +01:00
Katelyn Baker
88ed35636c Fix mis-move 2017-07-03 15:04:51 +01:00
Katelyn Baker
f11f17e2aa Move carpenter into core 2017-07-03 14:42:59 +01:00
Katelyn Baker
fcba32700c Review comment changes 2017-07-03 12:12:28 +01:00
Katelyn Baker
04d7432622 Add secondry deserializer to return amqp envelope
Useful for testing the carpenter by giving access to a cosntructed
envelope rather than manually building one every time
2017-06-30 14:12:36 +01:00
Mike Hearn
82f68f212a Minor: add another emoji, import a couple of changes for Enterprise 2017-06-30 13:06:46 +01:00
Shams Asari
a08f701dc5 Removed the StorageService and puts its components directly into the service hub 2017-06-30 09:37:29 +01:00
Andrius Dagys
00b272906a Decouple notary implementations from AbstractNode. Allow custom notaries to be provided via CorDapps. 2017-06-29 18:05:44 +01:00
Ross Nicoll
083b8265b5 Restructure Crypto to use ASN.1 algorithm identifiers
Remove use of Sun internal APIs and algorithm identifiers (which are incomplete and non-standard) in Crypto. Also eliminates uncertainty about which signature scheme is being used (and therefore iterating through several to find the correct one).
2017-06-29 14:36:39 +01:00
Rick Parker
5a45459b9d AMQP serialization part 3: some custom serializers, integration with Kryo (disabled) (#859) 2017-06-29 14:03:41 +01:00
Ross Nicoll
b791530b28 Correct trackBy() call
Correct trackBy() call on vault service, which should call _trackBy() but previously called _queryBy()
2017-06-29 12:13:33 +01:00
Ross Nicoll
1a4965c294 Change CashIssueFlow to use anonymous identity
* Add functions for:
    * Retrieving nodes via their legal identity
    * Filtering a set of public keys down to those the node has corresponding private keys for
* Modify contract upgrade flows to handle identifying participants after an anomymisation step
* Correct terminology: "party who" -> "party which"
* Modify CashIssueFlow and CashPaymentFlow to optionally use an anonymous identity for the recipient.
2017-06-28 13:47:50 +01:00
Andrzej Cichocki
e5395fe1b7 Enforce node death on failure to register with network map (#905)
* Give up polling when result future cancelled
2017-06-28 12:07:53 +01:00
Patrick Kuo
c3ca2744aa Replace Vault.PageAndUpdates with DataFeed data class (#931)
* Replace kotlin Pair with DataFeed data class

* remove unintended changes

* Replace Vault.PageAndUpdates with DataFeed data class

* Remove PageAndUpdates
2017-06-28 11:29:14 +01:00
Patrick Kuo
e02c37c06d Replace kotlin Pair with DataFeed data class (#930)
* Replace kotlin Pair with DataFeed data class

* remove unintended changes

* minor fix

* address PR issues
2017-06-28 11:06:06 +01:00
Andrzej Cichocki
0aadc037ef Make logging available in IntelliJ between gradle clean and assemble (#929)
* Enforce absence of node from client rpc smokeTest classpath
2017-06-28 09:54:09 +01:00
Katarzyna Streich
58da76c052 Network map redesign: Change field types in NodeInfo, move away messaging data from NodeInfo (#921)
* First stage of changing fields in NodeInfo.

Part of work related to NetworkMapService upgrade. Create slots for
multiple IP addresses and legalIdentities per node.

* NodeInfo stores HostAndPort.

Move information specific to messaging layer away from NodeInfo.
Only HostAndPort addresses are stored. Add peer name - peer handle
mapping to MockNetwork to reflect that change.
2017-06-27 18:14:51 +01:00
Ross Nicoll
14068f1b96 Enforce certificate constraints on all identities
* Enforce that the identity service must always have a root CA specified, which all identities have
certificates signed by (or intermediaries of). Also adds a certificate store to the identity service
for help building/verifying certificate paths.
* Add a certificate store for the CA certificate and intermediaries
* Use the certificate factory directly to build paths rather than assembling them via an interim
API call. After reducing the complexity of the utility API, it's replacing two lines of code,
at which point it seems better to make the behaviour clearer rather than having a function
hide what's actually going on.
2017-06-23 15:18:13 +01:00
josecoll
1866f6ff7f Align CordaRPCOps Vault Query API's for Java/Kotlin with VaultQuery service equivalents. (#914)
Added Kotlin extension functions for ease of use in simplest case.
Added missing Java contractType class (previously was forced cast of ContractState::class)

Fixed generic typing.

Addressed items raised in SA PR review.

Removed 2 blank lines.

Fixed generics typing.

Updates RST doc and grouped API helpers accordingly.
2017-06-23 14:35:55 +01:00
Konstantinos Chalkias
61a24897fe deriveKeyPair renaming 2017-06-23 13:48:21 +01:00
josecoll
f8ad5c9d10 Vault Query Service JPA implementation (#840)
* Vault Query Service API implementation using JPA Hibernate

Added queryBy(QueryCriteria) Vault API and Junit tests.

Minor cosmetic API changes following rebase.

Fixes following rebase from master

Upgraded to requery 1.3.1

WIP - removed 'latestOnly' from LinearStateQueryCriteria

WIP - CommercialSchemas V2, V3, V4 testing

WIP - sort out generics handling.

WIP - most general queries completed.

WIP - join queries, contractStateType derivation

WIP - refactoring Requery

WIP - refactored VaultService to extract a VaultQueryService interface (and associated Requery implementation).

WIP - HibernateVaultQuery implementation

WIP - Re-structured all Schema definitions (requery/jpa) and make Hibernate Config reusable.

WIP - Multi-version schema testing, hibernate query testing.

WIP - Custom Criteria and Fungible Criteria impl & testing.

WIP - Kotlin Comparable Generics error

WIP - Party queries all working now

WIP - All VaultQueryTests now working (refactored for AND / OR composition)

WIP - added schema registration in CordaPluginRegistry to enable custom vault queries on arbitrary schemas.

WIP - added new default Sort NULL order to be NONE + added lots more tests for Logical Operator testing.

Mostly identity fixes following rebase from master.

Exception handling and public API cleanup in prep for PR.

Additional tests for Logical Operators; additional tests for NULLS sort ordering; additional logging;

Additional parser to handle Nullable attribute values; added Unary and Collection logical expression handlers

Lots of cleanup: participants; trackBy interfaces; additional fungible tests; parser cleanup and improved support for Java

Removed all traces of Requery implementation.

Further minor cleanup and Junit test fix.

Final identity and schema related identity clean-up.

Revert unrelated changes.

PR review updates: blank lines, isRelevant.

Fixed wiring of updatesPublisher for dynamic trackBy queries.

PR review changes: multi-versioned schema samples and associated dummy contracts moved to test packages.

Fixed problem with sorted queries (not specifying any filterable criteria).

PR review: minor updates to address RP comments.

Typesafe custom query criteria

Cleanup: remove redundant tests.

Further clean-up and make all Java test work successfully.

Remove debugging print statements.

Rebased from master - changes required due to DealState module change.

fixed broken assertion caused by DealState ordering change (different package)

Fixed transaction demarcation issue causing "java.lang.IllegalStateException: Was not expecting to find existing database transaction on current strand"

trackBy() now filters on ContractType and StateStatus (CONSUMED, UNCONSUMED, ALL)

Added tests to exercise RPCOps trackBy and queryBy (RPC smoke test and CordaRPCOps)

Added additional @CordaSerializable annotations.

Updated documentation and referenced sample code.

Added deprecation annotations.

Re-added missing deprecation annotation.

Hibernate debug logging is now configurable and disabled by default.

Introduced common Sort attributes based on the node schemas.

Completely removed NULL_HANDLING sort parameter as this is not supported in JPA.

Revisited and fixed usage of @CordaSerializable.

* Minor fix following rebase from master.

* Remove blank line as per RP PR feedback request.

* Minor Java documentation and example clean-up.

* Disable BFT Notary Service tests.
2017-06-22 10:35:49 +01:00
Ross Nicoll
19ff72a411 Correct ISO country code in names 2017-06-21 14:04:22 +01:00
Shams Asari
a4e4ecff8a Moved FlowStateMachine into an internal package 2017-06-21 12:19:09 +01:00
Andrzej Cichocki
ef74a0a618 Fix the command line notary demos (#875)
* The fancy classloader setup in Cordform.loadCordformDefinition is defeated by certificates in 2 ways
** Class cast when creating a cert (via TestConstants) in a CordformDefinition
** Some issue when persisting a cert in ServiceIdentityGenerator
* This PR is a quickfix to get the demos working again
* Proper fix (not this PR) is to work out why it's not enough for eddsa to be in the project runtime classpath - if it can be removed from the gradle environment that ought to properly fix the above problems
2017-06-21 10:25:11 +01:00
Ross Nicoll
d54f66ccb0 Replace certificate path generation
Use the certificate factory directly to build paths rather than assembling them via an interim
API call. After reducing the complexity of the utility API, it's replacing two lines of code,
at which point it seems better to make the behaviour clearer rather than having a function
hide what's actually going on.
2017-06-20 17:59:38 +01:00
Ross Nicoll
b7bec90fae Add DER format encoding for CompositeKey
Add extremely rough DER format encoding for CompositeKey so that they can be used in X.509 certificates,
and switch service identity generator to using the proper identity cert for signing.
2017-06-20 16:39:11 +01:00
Shams Asari
155bb029da Cleaned up the trader, irs and simm demos so that things like the driver are used in test so that the node module isn't a compile dependency.
This has resulted in some classes moving into core, such as ClockUtils and FiberBox.
2017-06-20 16:02:51 +01:00
szymonsztuka
4195adfb7b Move Web API from CordaPluginRegistry to new class WebPluginRegistry (#864)
Move Web API from CordaPluginRegistry to new class WebPluginRegistry
2017-06-20 15:29:35 +01:00
Matthew Nesbit
beb0f876f5 Merge pull request #868 from corda/mnesbit-java-accessible-merkle-api
Java accessible API for merkle trees
2017-06-20 11:22:43 +01:00
Konstantinos Chalkias
cd0da5e093 DKG - Remove the modular reduction which may induce bias (#867)
Remove the modular reduction which may induce bias in DKG
2017-06-20 11:19:03 +01:00