Commit Graph

192 Commits

Author SHA1 Message Date
Konstantinos Chalkias
1a4d908b63 Remove grouping from FungibleAsset (Issue and Move) (#1185)
Clean-up FungibleAsset - remove Command grouping and get rid of IssueCommand as no nonce is required anymore.
2017-08-21 16:14:04 +01:00
mkit
2744079b4b Removing usages of the deprecated CashFlowCommand (#1289)
* Removing usages of the deprecated CashFlowCommand

* Addressing review comments
2017-08-21 13:32:08 +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
Viktor Kolomeyko
06ad2ddd45 Eliminate warnings in Java and Kotlin code
Functionally this change is a NOP
2017-08-21 09:36:24 +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
Andrzej Cichocki
2829faa01f Retire legalContractReference (#1188)
* Add LegalProseReference annotation
* Migrate code from autogenerated javascript to TypeScript source
* Add instructions to rebuild the web resources
* Make installWeb more reproducible
2017-08-18 13:30:39 +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
Andrzej Cichocki
e49d3aa834 Use native VisibleForTesting everywhere. (#1189) 2017-08-17 18:05:19 +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
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
62b26bcd89 Moved Currency stuff in ContractsDSL out of core and into finance 2017-08-15 18:08:02 +01:00
Andrius Dagys
43adbfd66c Remove junit-quickcheck and redundant generators 2017-08-15 11:12:02 +01:00
Andrius Dagys
f69273027c Verifier test: make sure only correct transactions are generated 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
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
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
Ross Nicoll
4602739e93 Issue commercial paper from the Bank of Corda node (#1196)
* Remove hard coded commercial paper issuer from trader demo
* Issue commercial paper from the Bank of Corda node, as per previous hard-coded issuer name
* Issue cash from the Bank of Corda node rather than in response to the buyer node requesting issuance
2017-08-11 10:20:27 +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
mkit
c8bbe453f5 Removing clauses from the core module (#1203) 2017-08-10 17:09:08 +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
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
Matthew Nesbit
bc4223712b Remove kotlin.Pair from Public APIs 2017-08-08 14:44:04 +01:00
Shams Asari
fa7c2b71f7 Removed Kt suffix of Strutures in Java 2017-08-07 17:12:32 +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
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
818cbce789 Removed all deprecated Vault Service query code. (#1167) 2017-08-03 17:45:53 +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
Shams Asari
4312dc0771 Resolved all non-deprecation warnings 2017-08-02 12:17:52 +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
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
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
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
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
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
Matthew Nesbit
0fdd4ae6c6 Remove TransactionForContract and just use LedgerTransaction
Fix minor doc error

Get rid of @deprecated method that was only present for technical reasons.

Minor fix and include in changelog
2017-07-20 09:16:07 +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
Ross Nicoll
298287fe28 Expand documentation on obligation contract
Expand documentation on obligation contract and add an example issuance function for cash obligations.
2017-07-19 13:34:28 +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
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