Commit Graph

1139 Commits

Author SHA1 Message Date
Clinton Alexander
ce7ce6c8b7 Used a more robust location for the caplet classes now that gradle 4 has changed the classes directory structure. 2017-08-24 15:58:41 +01:00
Matthew Nesbit
738f288428 Merge pull request #1301 from corda/mnesbit-finance-package2
Rename finance module to own package
2017-08-22 14:29:23 +01:00
Matthew Nesbit
c86e78599f Rename finance module to own package
Fixup after rebase

Correct bad merges

Fixup docs

Fix integration test

Correct doc references to finance
2017-08-22 13:25:31 +01:00
szymonsztuka
709495957d rewrite NodeMessagingClient to use Hibernate 2017-08-22 13:22:15 +01:00
szymonsztuka
09adba8275 Hibernate session leak fix
* Hibernate session was not closed when JDBC connection was closed

* combined few instances of HibernateSession objects into one field inside CordaPersistence 

* HibernateConfiguration improved caching of schema factories
2017-08-22 13:08:36 +01:00
szymonsztuka
c3c2ffcc2f rewrite PersistentNetworkMapService to use Hibernate 2017-08-21 12:22:16 +01:00
josecoll
a2ede0fc73 Requery removal (#1276)
* Removed Requery object relational mapping usage (and associated schemas including node-schemas module)

* Fixed issues with NodeAttachmentService tests.
Cannot use JPA custom converters with Primary Key fields.
Hibernate entities require explicit call to flush() to persist to disk.

* Removed redundant requery converters (equivalents not even required in Hibernate).

* Removed remaining gradle requery dependency definitions.

* Fixed broken tests.

* Fixes for failing NodeVaultService tests:
- Dynamic SQL updates (in soft locking code)
- Explicit request by session to participate in transaction (causing "TransactionRequiredException" Executing an update/delete query)
- Explicit flush() required to persist to disk

* Updated changelog.
Fixed compiler warning.

* Fixed WHERE clause AND/OR condition.
Enforced immediate data visibility through transaction commit.

* Final fixes to address failing tests.

* Deferred all hibernate session/txn management to DatabaseTransactionManager.

* Fixed transaction boundaries in failing Cash tests.

* Fixes to address failing tests (transaction boundaries, merge detached object, config clean-up).

* Final adjustment to transaction boundaries in JUnit tests.

* Refactored AttachmentSchemaV1 into NodeAttachmentService itself and referenced from NodeServicesV1.

* Refactored HSQL UPDATE statements to use CriteriaUpdate API.

* Updated all criteria API getters to reference attribute names by type.

* Remove redundant VaultSchema entity name (required when previously using HSQL UPDATE syntax)

* Fix compiler warnings.

* Minor changes following rebase from master.

* Fixed suppress warning type.
2017-08-21 10:42:59 +01:00
Matthew Nesbit
8ec33d67e4 Remove finance dependencies
Re-enable code now DealState PR is in.

Add plugable JSON serialisation

Add docs for new plugin api.

Move parseCurrency back to core to prevent dependency issues with crash shell parsing.

Use :finance module as a proper CorDapp

Move parseCurrency back onto Amount companion.

Fix smoke tests

Fixup after merge.
2017-08-18 14:27:49 +01:00
szymonsztuka
4278bce5c8 rewrite NodeSchedulerService to use Hibernate 2017-08-18 14:20:17 +01:00
Mike Hearn
d22cdac2dd Move some extension methods for summing to new locations.
This improves the Java API and makes it more idiomatic. The methods
were not moved to be static methods of the relevant types in all cases
due to a bad interaction with a Kotlin auto-completion bug, and because
static methods on interfaces are new in Java 8 and Kotlin is not yet
emitting Java 8 bytecode.

Also, introduce a packages.md file so packages can be documented.
2017-08-18 12:39:12 +02:00
mkit
ec83735ea3 Adding hint on how to fix the 'not instrumented' error message (#1274)
* Adding hint on how to fix the 'not instrumented' error message

* Addressing review comments
2017-08-18 10:16:16 +01:00
Patrick Kuo
ae85759067 Added notifyVault flag to recordTransaction and skip notify for irrelevant TX (#1250)
* Add notifyVault flag to recordTransaction to skip notifying the vault for transactions from ResolveTransactionFlow.

* added methods for use in Java

* reverted format changes

* addressed PR issues
changed recordTransaction method signature
2017-08-18 09:46:59 +01:00
Andrzej Cichocki
e49d3aa834 Use native VisibleForTesting everywhere. (#1189) 2017-08-17 18:05:19 +01:00
Viktor Kolomeyko
51ed943272 Remove SerializationFactory parameter from the places where it is not needed
Also minor improvements to the looping/if-branching code and documentation changes

Functionally, this change is a NOP
2017-08-17 17:53:40 +01:00
josecoll
48e8aa55fa Vault identity cleanup (#1194)
* Removed notary_key (and all references) from vault schema.
Fixed incorrect NOTARY usage in certain tests (cash consumption)

* Fixed broken test.

* Replace CommonSchemaV1.Party in all VaultSchema tables (and associated queries) with string'ified X500Name's only.

* Fix broken tests.

* Completely remove CommonSchemaV1.Party and all references (in favour of X500Name's)

* Updated all schema attribute identity references to use AbstractParty.

* Updated all schema attribute identity references to use AbstractParty.

* Standarised attribute naming for parties (removed 'Name')

* Updated deprecate identity API references following rebase.

* Configurable IdentityService as a lambda in JUnit tests.

* Additional WARNING logging to enable troubleshooting of identity lookup failures.

* Final identity updates to sample schemas.
Cleaned up several compiler warnings.
2017-08-17 09:30:27 +01:00
Shams Asari
dc8d232480 Creating a PartyAndCertificate only requires a CertPath 2017-08-16 16:36:03 +01:00
Shams Asari
3860b22339 Made all the members of Crypto.kt static so that Java users aren't forced to use Crypto.INSTANCE. 2017-08-16 13:47:11 +01:00
josecoll
b9eac635b8 Vault Query performance fix (#1256)
* Do not query database to maintain list of contract state interfaces to concrete concrete state types (use vault observable to construct same)
(note this mechanism is tied to transaction boundaries for visibility of updated states)

* Build contract types list from vault rawupdates observable(to avoid waiting for transaction commits).
Reverted all JUnits to original state.

* Bootstrap map from vault database state (node re-start)
Skip reflection for already seen types.

* Explicitly close session instances after query execution.

* Use auto-closeable to scope sessions.
2017-08-16 12:28:54 +01:00
Andrius Dagys
1e0a26e8e5 Ensure transactions in tests have commands (#1200)
* Ensure transactions in tests have commands
2017-08-16 10:06:46 +01:00
Ross Nicoll
b76d036843 Change CashIssueFlow to always issue to ourselves
Change CashIssueFlow to always issue to ourselves, and require the cash is then moved in a separate payment
operation. This more closely models actual operation inside banks, and is a step towards making all move-like
operations go through a uniform verification process.
2017-08-15 22:32:30 +01:00
Ross Nicoll
89476904fc Remove IssuerFlow
* Remove IssuerFlow as it is dangerous and its presence in the finance module risks accidental use in non-test code. As written it will issue arbitary amounts of currency on request from any node on the network, with no validation barring that the currency type is valid.
* Unify interface to CashIssueFlow to match the previous IssuerFlow
2017-08-15 22:32:30 +01:00
Shams Asari
3888635055 Removed redundant serialisation of checkpoints (#1004) 2017-08-15 19:07:44 +01:00
Shams Asari
3138e2b6de Cleaned up the flow stack snapshot API 2017-08-15 18:37:39 +01:00
Shams Asari
62b26bcd89 Moved Currency stuff in ContractsDSL out of core and into finance 2017-08-15 18:08:02 +01:00
Andras Slemmer
f6e7814638 Merge pull request #1207 from corda/aslemmer-move-testclock-branching-to-Node
Move useTestClock conditional to Node constructor
2017-08-15 17:35:59 +01:00
Viktor Kolomeyko
88308a70c7 - Remove usages of deprecated methods
- Fix typos
- Fix other Kotlin warnings
2017-08-15 16:45:44 +01:00
Joel Dudley
ccdab6af4d For convenience, creates RPC snapshot methods for feeds. 2017-08-15 16:18:15 +01:00
Patrick Kuo
eb925904ce Fix composite key cert path in AbstractNode (#1249)
* fix composite key cert path

* address PR issues

* added comment

* added the wrong keypair to the identity service
2017-08-15 15:54:02 +01:00
Ross Nicoll
1a44f98379 Correct behaviour of anonymousToParty()
Correct behaviour of anonymousToParty() in identity API; it previously presumed any Party was a well known
identity, now it tries to look up the well known identity irrespective of whether it's been given a full
party or not.
2017-08-15 15:40:44 +01:00
Andrius Dagys
43adbfd66c Remove junit-quickcheck and redundant generators 2017-08-15 11:12:02 +01:00
Matthew Nesbit
e546b554fc Remove DealState dependency inside Vault. Use the linearId.externalId for all ref data uses.
Rename as per PR comments

Correct a comment
2017-08-15 09:25:44 +01:00
mkit
3ba42b4ccd Flow stack snapshot feature (#1094)
* flows: Add StackDump, debugStackDump, test (doesnt work)

* Polishing Quasar dump feature, extending it with persisting to a file, adding integration tests

* Addressing review comments

* Addressing 2nd round of review comments

* Refactoring implementation according to Shams suggestion

* Reverting changes and restoring the feature to be the part of the core API

* Switching to ServiceLoader
2017-08-15 08:22:37 +01:00
Ross Nicoll
8f8a5ff774 Remove deprecated code
*Remove dummy public keys in preference for EdDSA keys generated from fixed entropy sources, as a more accurate reflection of real uses. Also eliminates a serialization format issue with dummy keys which would have to be resolved otherwise.
* Remove deprecated 'by' keyword from contracts DSL
* Remove deprecated parts of CordaPluginRegistry
2017-08-15 01:17:36 +01:00
Ross Nicoll
62576b12b3 Simplify identity registration API
* Merge identity registration of well known and confidential identities
* Move verification logic into PartyAndCertificate from IdentityService
* Add note about why PartyAndCertificate exists
2017-08-15 00:17:21 +01:00
Viktor Kolomeyko
3f9270e38d Merge branch 'master' into minorTestChanges 2017-08-14 17:26:04 +01:00
Rick Parker
2f08425c43 Refactor KryoAMQPSerializer to go through generic APIs to access AMQP serialization (#1225) 2017-08-14 17:24:04 +01:00
Viktor Kolomeyko
944a6d80a2 Minor changes to the unit test
To test my Git permissions more than anything else
2017-08-14 15:56:44 +01:00
Shams Asari
3407cd4580 Fix to test in InMemoryIdentityServiceTests 2017-08-14 15:11:20 +01:00
szymonsztuka
a6bf8e35dd rewrite few services to use Hibernate
* DBTransactionMappingStorage
* DBTransactionStorage
* DBCheckpointStorage
* PersistentUniquenessProvider
* PersistentKeyManagementService
2017-08-14 15:06:06 +01:00
Shams Asari
1124383c2a Fixed bug in flow framework with regards to sendAndReceive and session-ends 2017-08-11 20:13:47 +01:00
Shams Asari
008301c4e8 Introduced FlowLogic.getFlowContext which provides the flow version and app name of the other side. 2017-08-11 18:01:16 +01:00
Ross Nicoll
f0c7d7665a Remove deprecated signing functions
* Remove TransactionBuilder.signWith()
* Remove TransactionBuilder.addSignatureUnchecked()
* Rename signInitialTransaction to toSignedTransaction
* Remove checkAndAddSignature()
* Require all unit tests sign transactions via services
2017-08-11 17:37:50 +01:00
Andras Slemmer
ea0d10787a Move useTestClock conditional to Node constructor 2017-08-11 15:27:36 +01:00
Rick Parker
31df43bd76 Some preparation work for AMQP serialization integration & a refactor fix (#1214) 2017-08-11 13:23:00 +01:00
Matthew Nesbit
af13371510 Move certificate builder code from core to node utilities.
Address PR comments

Fixup dead reference
2017-08-11 12:02:38 +01:00
josecoll
54cf46952c JPA Hibernate AbstractParty converter (#1205)
* Added JPA AbstractParty converter (using IdentityService to resolve anonymous parties).

* Use partyFromX500Name. Add meaningful exception messages.

* AutoApply the JPA AbstractParty converter.

* Entity attribute still needs the Convert annotation.

* Fix incorrect registration of custom attribute converter.

* Deal with non-resolvable anonymous parties (eg. store as null and ignore)

* Updates following PR review feedback.

* Added documentation.

* Added entry to changelog.

* Added code documentation as per RN PR feedback request.

* Updates required following rebase from master.

* Renamed converter for clarity.
2017-08-10 17:17:12 +01:00
Ross Nicoll
2b8b3298dc Tweak scheduled flow tests to improve error diagnosis
* Add logging of the specific differences rather than dumping a long list of states to stdout
* Verify all flows complete successfully
2017-08-10 15:50:44 +01:00
Matthew Nesbit
3bc7914a09 Merge pull request #1184 from corda/mnesbit-generic-generatespend
Move generateSpend onto Cash contract. Add fully generic replacement.
2017-08-10 15:25:40 +01:00
Matthew Nesbit
f4f2d35375 Make a generic generate spend. Tests pass.
Fixup after rebase

Fixup after rebase

Make node have only test compile dependency against finance module.

Use original query code.

Fixup after rebase

Update docs

Edit docs

Add to changelog

Follow recommendations from PR

Follow recommendations from PR

Make a re-usable helper function to create MockServices with database for tests

Tweak a few comments

Don't include tryLockFungibleStateForSpending in soft lock docs.

Respond to PR comments

Fix whitespace error

Fix compile error

Fixup after rebase
2017-08-10 13:29:08 +01:00
Ross Nicoll
d86cb1ac64 Remove deprecated partyFromName() function 2017-08-10 13:25:53 +01:00