Commit Graph

1139 Commits

Author SHA1 Message Date
Ross Nicoll
fdb63b7611 Add RPC operation for resolving well known identity 2017-08-10 13:25:53 +01:00
josecoll
7cdcc48173 Specify correct use of Hibernate SQL statement debug output (and set in our log4j2-test.xml). (#1181) 2017-08-09 15:59:46 +01:00
mkit
0b33214fea Removing clauses (#1195)
* Removing clauses

* Removing clauses from JavaCommercialPaper

* Addressing review comments
2017-08-09 15:25:31 +01:00
Rick Parker
28610868c4 Remove Kryo from core module completely, including gradle dependencies (#1161) 2017-08-09 14:53:46 +01:00
szymonsztuka
a3ffd92544 Database.isolatedTransaction removal 2017-08-09 09:31:48 +01:00
Ross Nicoll
1d965b1785 Correct handling of trying to record state more than once
* Check transactions to be recorded before filtering rather than after, as currently if the entire
list of transactions is already recorded, it's mis-reported as an empty input.
* Notify listeners only of recorded transactions, not all
2017-08-08 17:37:41 +01:00
Konstantinos Chalkias
bd0944e799 TransactionSignature MetaData support (#1040)
Support signature metadata
2017-08-07 16:21:52 +01:00
Andrzej Cichocki
3a3ead2dfe Remove ListenableFuture from core/main (#1030) 2017-08-07 14:31:24 +01:00
Balaji More
d9eb9fe64f Add interactive shell parsing for UniqueIdentifier and UUID.
Add interactive shell parsing for UniqueIdentifier and UUID.
2017-08-07 12:14:37 +02:00
josecoll
bef8630fe0 Improvements to Vault Query Service soft locked state querying (#1174)
* Improvements to Vault Query Service soft locked state querying (removed old mechanism from VaultService).

* Fixed rst document formatting.

* Added additional soft locking criteria mode: all unlocked plus those locked as specified by lockId(s).

* Addressed comments from PR feedback.
2017-08-04 17:23:31 +01:00
josecoll
67361188e5 Vault Query fix: query by multiple issuer party names. (#1170)
* Fixed query by multiple issuer party names.

* Changes following feedback from PR review.
Added changelog entry.
2017-08-04 16:22:21 +01:00
Andrzej Cichocki
42e29d3b22 Retire FileUploader and subtypes (#1154) 2017-08-04 15:57:11 +01:00
Patrick Kuo
56fda1e5b5 Replace data vending service with SendTransactionFlow (#964)
* WIP - Removed data Vending services, fixed all flow test

* * separated out extra data, extra data are sent after the SendTransactionFlow if required
* New SendProposalFlow for sending TradeProposal, which contains StateAndRef.
* WIP

* * removed TradeProposal interface.
* changed SendProposalFlow to SendStateAndRefFlow, same for receive side.
* fixup after rebase.

* * undo changes in .idea folder

* * remove unintended changes

* * Addressed PR issues

* * doc changes

* * addressed pr issues
* moved ResolveTransactionsFlow to internal
* changed FlowLogic<Unit> to FlowLogic<Void?> for java use case

* * addressed PR issues
* renamed DataVendingFlow in TestUtill to TestDataVendingFlow to avoid name confusion, and moved it to core/test

* * removed reference to ResolveTransactionsFlow
2017-08-04 11:26:31 +01:00
josecoll
014387162d Expose a JDBC connection (session) via the ServiceHub for generic JDB… (#1000)
* Expose a JDBC connection (session) via the ServiceHub for generic JDBC usage.

* Updated documentation.

* Fix failing JUnit following rebase from master.

* JDBC session Tutorial WIP

* Fix broken JUnits following update to consumeCash() using observable event update as return.

* Fixed broken JUnits.

* Refactoring createSession() into new CordaPersistence class following rebase from master.

* Updated fully working example.

* Minor updates following feedback from MH.

* Fixed compiler error following rebase.

* Fixes following rebase from master.

* Further updates and clarifications to documentation.
2017-08-04 09:26:27 +01:00
josecoll
818cbce789 Removed all deprecated Vault Service query code. (#1167) 2017-08-03 17:45:53 +01:00
Richard Green
ef8deba07c Added CordaCon to node startup banner 2017-08-03 13:08:51 +01:00
josecoll
64ba8d3a88 Updated samples and demos to use new Vault Query service. (#924)
* Updated all sample code to use new Vault Query service APIs.

* Fix broken Unit test.

* Added missing transaction boundary.

* Fix broken ScheduledFlow test (caused by assertion on non-ordered collection)

* Remove redundant negative test (as new Vault Query no longer returns iterators).

* Whitespace formatting fixed following PR review from SA.

* Force query to specify a PAGE SIZE equivalent to total states to be exited (RP review comment).

* Use single (and fail fast) instead of first - when only expecting a single result.

* Demonstrate paging and sorting; failfast on single expected result.

* Enhancement: added Sorting by CommonStateAttribute (StateRef txnId and index)

* Fix: incorrect total states count.

* Fixed incorrect total states counting.

* Remove redundant filter (UNCONSUMED).

* Updated tutorial code and associated documentation (building transactions).

* Updated all vaultAndUpdates to vault[Track|Query]By.

* Temporary disable failing Vault Query tests (awaiting pagination PR fix).

* Rebase from master to pick up pagination changes/fix.

* Fixed criteria filter on track.

* Cleanup redundant print output.

* Refactor to extract common function for Vault Query paging and sorting.

* Identified problem in SimmValuation demo failing test caused by query by single participant in participants list (not yet supported in VaultQuery criteria).

* Minor fixes following rebase from master.

* Minor updates following rebase.

* Removed redundant import.

* Fixed type casting error.

* Minor fixes following rebase from master.

* VQ Fix - applied in other PR.

* Removed duplication after rebase and minor fix to failing smoke test.
2017-08-03 11:47:15 +01:00
Andrzej Cichocki
73528d287d Refactoring related to obsolete attachments directory (#1150)
* No longer create obsolete "attachments" directory
* Remove redundant NodeAttachmentService param
* Add type param to MockNetwork.Factory to eliminate casts
* Use null not -1 for unforced node ID
* Remove redundant createNode args
2017-08-03 11:06:22 +01:00
josecoll
3c8368e25d Applied contract type filtering to ALL Query Criteria types (#1159)
* Applied contract type filtering to ALL Query Criteria types (was only applied in general)

* Do not filter when all contract state types specified.
2017-08-03 10:46:45 +01:00
Shams Asari
4312dc0771 Resolved all non-deprecation warnings 2017-08-02 12:17:52 +01:00
Joel Dudley
85accf93e8 Update FlowStateMachineImpl.kt 2017-08-02 09:05:17 +01:00
Roger Willis
f6e05aeae9 Use LinkedHashSet instead of HashSet as HashSet is BLACKLISTED!! (#1146) 2017-08-01 09:56:54 +01:00
szymonsztuka
7620874e5f Szymon db confing (#1141)
database transaction isolation level and database initialisation are configurable
2017-07-31 16:36:34 +01:00
Andrius Dagys
9eb1a0c9d5 Add a test for notary change transaction updates in the vault.
Fix a minor related issue with update type propagation.

Add static NoNotaryUpdate object

Added isEmpty check to Vault.Update
2017-07-31 16:25:21 +01:00
Shams Asari
4a600121cc Removed deprecated methods in DataFeed and deprecated feed-based methods in CordaRPCOps 2017-07-31 15:11:00 +01:00
Andrius Dagys
4ca8b8d681 Remove type-specific transaction builder. Normal transactions should use TransactionBuilder and notary change transactions are created directly. 2017-07-31 14:31:17 +01:00
Andrius Dagys
59edd6f9ae Remove type property from transactions 2017-07-31 14:31:17 +01:00
Konstantinos Chalkias
36b50aab2d Nonce per tx component (#1125)
Add salt to wire tx and nonces to tx components
2017-07-31 12:19:47 +01:00
Richard Green
907ef97346 Removed training banner for the interim as we are no longer planning for regular classroom training 2017-07-30 00:01:49 +01:00
Patrick Kuo
3a63f0c606 * remove x500 name validation when loading config file (#1137)
* added x500 name validation in Network registration.
* fix for github issue #1130
2017-07-28 16:18:49 +01:00
Shams Asari
1a879df0e7 Attempting to initiate flow that's not in the destination's classpath returns back a session reject 2017-07-28 10:22:26 +01:00
Michal Kit
818f8a5f77 Addressing review comments 2017-07-27 16:12:14 +01:00
Michal Kit
66d6c2b44e Extending NetwokMapCache with a convenience method for by type service retrieval 2017-07-27 16:12:13 +01:00
Andrius Dagys
4487408526 Refactor notary change mechanism (#1019)
* Introduce new NotaryChangeWireTransaction (similar to WireTransaction and NotaryChangeTransaction (similar to LedgerTransaction) types.

Remove 'mustSign' and 'signers' fields from transactions

Deprecate the TransactionType concept. When receiving a SignedTransaction, the verification and signature checking branches out for regular and notary change transactions.

Add custom handling logic for notary change transactions to the vault
2017-07-27 08:32:33 +01:00
Andrzej Cichocki
25be649f7b Workaround BFT bug that causes redundant replicas to get stuck in startup (#1100) 2017-07-26 19:41:29 +01:00
Mike Hearn
a9a50ce8f3 Add generics to Vault.Update 2017-07-26 18:30:59 +02:00
Matthew Nesbit
b4ca0cdde9 Remove getCashBalances first part
More removal of getCashBalances

Get rid of duplicated code

Move onto new getCashBalance extension methods

Move onto new getCashBalance extension methods

Correct balance query code

Address PR request comments

Address PR request comments

Address PR request comments
2017-07-26 15:00:03 +01:00
Andrzej Cichocki
dca2274bff Retire setup, and start return value. (#1101) 2017-07-25 12:42:02 +01:00
Shams Asari
407b467f67 Moved the majority of the contents of Utils.kt into either InternalUtils.kt or KotlinUtils.kt.
What remains is being dealt with in another PR.
2017-07-24 19:25:56 +01:00
Shams Asari
800f710fbb Generified Command so that it's more easier to use when querying from LedgerTransaction 2017-07-24 15:33:41 +01:00
Andrius Dagys
d2eb5507f9 Refactor transaction serialization caching (#1078)
* Cache deserialized rather than serialized WireTransaction. Prevent repeated deserialization when adding signatures to the SignedTransaction.

* Added a test to check that stx copying and signature collection still works properly after (de)serialization
2017-07-24 14:48:39 +01:00
Shams Asari
3e199e51fc Simplified the implementation of the tx query APIs with the introduction of Class.castIfPossible 2017-07-21 19:18:48 +01:00
Shams Asari
a485bbada8 Moved ThreadBox into core.internal 2017-07-21 18:01:29 +01:00
Matthew Nesbit
9a02a27619 Add state query methods to LedgerTransaction.
Update to use LedgerTransaction api

Push query output logic onto BaseTransaction and update usages where possible

Migrate a few more uses

Address some PR comments

Address some PR comments

Fixup after rebase
2017-07-21 15:41:00 +01:00
Rick Parker
fe9db6f1f7 Remove links to Kryo from serialization "clients" (#1079) 2017-07-21 14:23:05 +01:00
Shams Asari
e702025f62 Cleaned up TimeWindow and added a bit more docs. 2017-07-20 13:43:11 +01:00
Patrick Kuo
0e0b99eaf0 * Remove Kryo from ServiceIdentityGenerator (#1083)
* Store encoded private, public and composite key to file instead of Party and Key using Kryo.
2017-07-19 16:34:56 +01:00
Ross Nicoll
9d3ad5fe06 Remove dummy cash issuer from two party trade flows
Switch to using a dedicated bank node in two party trade flows so that when KYC checks are enforced, all nodes on the network know who the issuer is.
2017-07-19 16:00:14 +01:00
Shams Asari
070f0c040e Moved a bunch of stuff which shouldn't be public out of core.utilities and into core.internal 2017-07-19 14:09:03 +01:00
Ross Nicoll
c4c551dbd2 Confidential identities API improvements
* Registering anonymous identities now takes in AnonymisedIdentity
* AnonymousParty.toString() now uses toStringShort() to match other toString() functions
* Add verifyAnonymousIdentity() function to verify without storing an identity
* Replace pathForAnonymous() with anonymousFromKey() which matches actual use-cases better
* Add unit test for fetching the anonymous identity from a key
* Update verifyAnonymousIdentity() function signature to match registerAnonymousIdentity()
* Rename AnonymisedIdentity to AnonymousPartyAndPath
* Remove certificate from AnonymousPartyAndPath as it's not actually used.
* Rename registerAnonymousIdentity() to verifyAndRegisterAnonymousIdentity()
2017-07-19 14:03:34 +01:00
Patrick Kuo
264b9316e3 Store notaries's identity composite key in keystore (#1036)
* * Store composite key in keystore from file for notaries's identity.
* Some refactoring.

* * Addressed PR issues

* * Remove unintended format changes

* * Fixed failing test due to getting keys from wrong keystore
2017-07-19 11:14:48 +01:00
Andrius Dagys
cb306a22fe Modify NodeVaultServiceTest to not access makeUpdate() directly 2017-07-18 17:38:45 +01:00
Ross Nicoll
f571aeb6a7 Remove createTwoNodes()
Remove `createTwoNodes()` from mock network as its behaviour is inconsistent with creating a set of nodes. `createSomeNodes()` is generally a better fit and creates a network map and notary, and registers all nodes. Where that's not the intention, it's acceptable to manually create each node.
2017-07-18 16:54:32 +01:00
Shams Asari
2778e294f3 FiberBox and RetryableException removed as they're not used 2017-07-18 15:14:35 +01:00
Shams Asari
b0c299707b Moved DeclaredField utility to internal and expanded its use 2017-07-18 14:33:09 +01:00
Clinton
0ccfae252f POMs generated by publishing are now correct. (#1055)
* POMs generated by publishing are now correct. The publish extension now requires an explicit call to configure the publishing instead of waiting until after evaluation. This prevents evaluation order issues with the artifact renaming code that causes the POM to have the original, incorrect, artifact names.

* Fixed new test compile issues caused by removal of some dependencies in test utils that caused webserver code to be automatically included in any project also compiling test utils.
2017-07-18 12:34:56 +01:00
Shams Asari
561a329064 Moved the various extension methods for creating Durations from Utils.kt to KotlinUtils.kt 2017-07-18 10:26:53 +01:00
josecoll
65ce5fec4b Fixed Vault Query over RPC using custom attributes. (#1066)
* Implemented Kryo custom serializers for Field and KProperty types.

* Adjusted KPropertySerializer to use kotlin member properties upon read() due to failing RPC tests.
Added additional Kotlin and Java tests (CordaRPCClient, StandaaloneCordaRPCClient)
Annotated schemas to be CordaSerializable (required when referencing as KProperty in custom queries).
Cleanup some outstanding compiler warnings.

* Added client RPC Java integration and smoke tests to build.

* Clean up compiler warnings in Java tests.

* Fixed incorrect assertion expectation.

* Backed out Field and KProperty custom serializers.

* Backed out Field and KProperty custom serializers.

* Store VaultQueryCustom custom column references as name and class (from Java Field and Kotlin KProperty1 types respectively).
Custom serialization of Field and KProperty type no longer required.

* Removed blank lines as per RP review comments.
2017-07-17 18:20:02 +01:00
Shams Asari
195189070a Moved the Path extension methods that were in Utils.kt into the internal package 2017-07-17 16:01:19 +01:00
Joel Dudley
b37c73827f Splits verifySigs into verifySigsExcept and verifyRequiredSigs to clarify usage. 2017-07-17 15:42:08 +01:00
Matthew Nesbit
7d1d5cc0f8 Merge pull request #1050 from corda/mnesbit-services-in-separate-files
Put Services.kt in separate files
2017-07-17 14:29:01 +01:00
Ross Nicoll
dfbf06a66d Flow cleanup
* Change "for who" to "for whom"
* Don't pass parties to FinalityFlow, it can derive them automatically
* Create a basket of nodes instead of individually assembling nodes
* Switch two party trade flow tests to generate a full anonymous identity
2017-07-17 10:24:20 +01:00
Matthew Nesbit
7a06d941c4 Put Services.kt in clear files, so that at a glance people can see what public services there are.
Fix include

Correct doc links after code movement
2017-07-17 09:34:07 +01:00
Andrius Dagys
7aafcf8c57 Prevent exception causes showing up as null in logs (#1018)
* Passing exception messages via constructor instead of overriding toString
2017-07-14 20:40:21 +01:00
Mike Hearn
a56540a3d6 Fix support for large attachments by de-batching tx/attachment fetch. This is a workaround until the upstream Artemis large message streaming bugs are fixed. 2017-07-14 18:21:33 +01:00
Shams Asari
ae01d658b6 Renamed FlowSessionException to UnexpectedFlowEndException 2017-07-14 15:14:54 +01:00
szymonsztuka
05327f3826 decouple Exposed (#1028)
Exposed library decoupled from transaction management and JDBC connection creation for Hibernate and ReQuery
2017-07-14 14:39:59 +01:00
Andrzej Cichocki
1996c39b9a Disable the BFT tests. (#1051) 2017-07-14 14:06:59 +01:00
Shams Asari
a49baddd4b Moved KeyStoreUtilities out of core and into node 2017-07-13 16:54:30 +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
Ross Nicoll
f6aa672215 Add unit tests around vault update derivation 2017-07-13 11:10:23 +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
josecoll
d6deeb2bd6 Fixed failing SmokeTests using Vault Query (#1032)
* Fixed failing SmokeTest caused by incorrect default count filter.

* Fixed incorrect spend value for expected assertion.

* Remove deprecated test (unintentionally merged after rebase from master)
2017-07-12 18:11:04 +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
Matthew Nesbit
0b2188d27b Fix a bug in the wrapper code for the vault.
If we dip down to zero subscribers, no future updates are streamed. This hasn't been seen historically, because the cash metrics observer is always present, but this will be moved out of node.
2017-07-11 14:13:52 +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
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
Andrzej Cichocki
365364ddd5 Re-enable BFT tests after porting away from NodeBasedTest (#889) 2017-07-10 09:30:28 +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
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
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
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
Patrick Kuo
4e355ba95e Add certificate subject name check on node startup (#897)
* Add certificate subject name check on node startup

* address PR issues
2017-07-05 15:34:04 +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