Commit Graph

302 Commits

Author SHA1 Message Date
Clinton
659b447362 V1 tests and fixes for the ContractConstraints work (#1739)
* V1 tests and fixes for the ContractConstraints work

* More fixes.
2017-10-02 17:54:31 +01:00
Rick Parker
9a16011448 * Move CompositeSignaturesWithKeys into net.corda.core.crypto package.
* Rename and move CordaPluginRegistry to reflect its real purpose now.
* Docs: docsite improvements
* Remove discussion of webserver from 'writing a cordapp' page.
* Fixup some flow docs.
* Add a couple more package descriptions.
* Review comments - always apply default whitelist and no longer load it via ServiceLoader
* Added wording about renaming services resource file
2017-10-02 16:03:07 +01:00
Joel Dudley
4641d3c4dd Moves code sections in tutorials to code files. 2017-10-01 23:33:15 +01:00
Matthew Nesbit
5fa7381883 Custom exceptions in corda, should either derive from an appropriate closely related java exception, or CordaException, or CordaRuntimeException. They should not inherit just from Exception, or RuntimeException.
Handle PR comments

Add nicer constructors to CordaException and CordaRuntimeException

(cherry picked from commit 89478c8)

Fix ambiguous defaulted constructor

(cherry picked from commit ec9bafe)

Address PR comment

Update a few more custom exceptions
2017-09-29 09:37:22 +01:00
Ross Nicoll
89ef4034c0 Clean up of Dokka comments (#1632)
* Remove use of @see as a cross-reference to actual docs; this is inappropriate (it reflects "See Also", not "See Other"), and often longer than having the actual documentation in place.
* Correct syntactical errors in docs
* Correct "@returns" to "@return"
* Add note about currencies with 3 decimal places
2017-09-28 17:42:32 +01:00
Ross Nicoll
2aaeb4c0b5 CORDA-652: Remove uses of createSomeNodes for consistency (#1492)
Replace use of `createSomeNodes()` with creating notary and party nodes individually. This typically results in less code as the basket of nodes isn't built first then the nodes, but instead the nodes generated directly. Notably this identified issues in notary change and contract upgrade tests, which were not actually using a validating notary and therefore it had been missed that the transactions were failing validation.

Renamed nodes in tests for consistency as well, so nodes are now `aliceNode`, `bobNode`, etc. instead of `a`, `b`, or `n0`, `n1`, or other variants of those.
2017-09-28 17:12:21 +01:00
Rick Parker
39160de0a3 BIGINT fix for H2 coin selection. (#1659) 2017-09-27 15:15:34 +01:00
josecoll
241f843555 Unification of VaultQuery And VaultService APIs (into single VaultService interface) to simplify node bootstrapping and usability. (#1677) 2017-09-27 13:33:23 +01:00
Maksymilian Pawlak
06cf741c0d Merge pull request #1684 from corda/m4ksio_irs_demo_fixes
IRS Demo UI Fixes
2017-09-27 13:21:13 +01:00
Andrzej Cichocki
9874e1ff34 uncheckedCast crusade (#1667) 2017-09-27 12:58:48 +01:00
Maksymilian Pawlak
c8739e83a9 IRS Fixes to bring UI closer to declared financial types 2017-09-27 12:41:40 +01:00
Ross Nicoll
e1b040ba0e Replace for ..-1 with until (#1513) 2017-09-26 13:37:13 +01:00
Michele Sollecito
63168c0299 [CORDA-481]: GH 965: Java 8 lambdas don't work properly in checkpointing (#1619) 2017-09-26 13:22:59 +01:00
Ross Nicoll
da82a0be40 CORDA-499: Dokka cleanup (#1575)
* Make functions in CompositeSignature static
* Make contract IDs constant
* Remove use of "e.g." which Dokka will take as end of the first sentence
* Move example onto function that it actually works with
* Change comment which refers to comment above it, without any linkage, to directly describe the function
* Move implementation notes out of Dokka comment
* Change contract IDs to constants in companion objects
2017-09-26 10:26:44 +01:00
Ross Nicoll
be0e7a8877 Correct flow calls to generateSpend() (#1643)
Correct flow calls to generateSpend() to match 1.0 API changes
2017-09-25 22:53:49 +01:00
Ross Nicoll
23f16b4b25 CORDA-604: Update cash spending to handle multiple identities (#1534)
Update cash spending to handle multiple identities per node. For test cases nodes typically have a single identity, which we extract using `chooseIdentity()`, however for production environments we need to support nodes having multiple identities they can represent, with none being special.
2017-09-25 22:00:24 +01:00
Rick Parker
175e53d3d2 Extract identity helpers (#1636)
* First compiling version.  internal package accessed from finance and irsdemo

* Renaming
2017-09-25 17:49:34 +01:00
Clinton
532bbb5cca Contract constraints (#1518)
* Contract constraints and attachment loading

Fix compiler warnings.

Fixed IdentitySyncFlowTests in confidential-identities.

Fixes.

Fix AttachmentClassLoaderTests.

Added a TODO.

Renamed cordapp service.

Fix compilation error in java code.

Fix RaftNotaryServiceTests

Fix AttachmentLoadingTest

Fix DistributedServiceTests and LargeTransactionTests.

Add cordapp packages to Verifier tests.

Refactor DummyContractBackdoor back out of internal package.

Resolve compiler warnings.

Consolidate excluding `isolated` project at top-level.

Fix contract attachment serialisation for remote verifier.

Fix integration tests for client:rpc.

Contract constraints and attachment loading

Fix compiler warnings.

Fixed IdentitySyncFlowTests in confidential-identities.

Fixes.

Fix AttachmentClassLoaderTests.

Added a TODO.

Renamed cordapp service.

Fix compilation error in java code.

Fix example compilation.

Fix RaftNotaryServiceTests

Fix AttachmentLoadingTest

Fix DistributedServiceTests and LargeTransactionTests.

Add cordapp packages to Verifier tests.

Refactor DummyContractBackdoor back out of internal package.

Resolve compiler warnings.

Consolidate excluding `isolated` project at top-level.

Fix integration tests for client:rpc.

Fixed issues with node driver and differing ZIPs.

Review changes.

Refactor GeneratedAttachment into node-api module.

Merge branch 'clint/hash-constraint' of https://github.com/corda/corda into clint/hash-constraint

Fixed compile error following rebase.

wip - test to check that app code isn't loaded from attachments sent over the wire.

Use Kotlin copyTo() rather than Apache's IOUtils.

Fixes

more fixes.

Removing unconstrained output.

More fixes.

Fixed another test.

Added missing plugin definition in net.corda.core.node.CordaPluginRegistry: net.corda.finance.contracts.isolated.IsolatedPlugin

Re-added missing magic string used in unit test.

Remove unused FlowSession variable.

* Review fixes.

* More review fixes.

* Moved Cordapp implementation to an internal package.

* More JVMOverloads.
2017-09-25 17:05:18 +01:00
Clinton Alexander
05e94e7425 Corrected isolated.jar excludes for all projects and corrected some test dependencies. 2017-09-22 18:19:07 +02:00
Ross Nicoll
c05e482c8f Change public constant values to Kotlin constants (#1588)
* Make string constants into Kotlin constants

* Add JvmName annotation to KeyStoreUtilities
2017-09-21 15:32:02 +01:00
Matthew Nesbit
c108637df6 Remove unused certificate method from IdentityService. (#1582)
Put wellKnownParty in methods that return a Party which is one.

Fixup rebase
2017-09-21 15:31:42 +01:00
Ross Nicoll
b0e9183850 CORDA-499: Dokka cleanup for 1.0 (#1579)
* Clean up Dokka comments on CordaRPCOps

* Remove use of "e.g." which Dokka will take as end of the first sentence
* Move example onto function that it actually works with
* Change comment which refers to comment above it, without any linkage, to directly describe the function
* Move implementation notes out of Dokka comment

* Make functions in CompositeSignature static

* Make contract IDs constant

* Correct contract ID in CashTestsJava
2017-09-21 14:46:36 +01:00
Patrick Kuo
80b3411fa5 Explorer advertising service fix (#1576)
* WIP
added a helper method to convert ObservableValue<List> to ObservableList

(cherry picked from commit 75306aa)

* Fix for cash explorer after advertising service removal

(cherry picked from commit 59d0278)

* remove unused changes

* address PR issues

* fixup after rebase

* fix CashState name rendering issue
added flow permission to gradle config
2017-09-21 13:27:05 +01:00
Andras Slemmer
33421bdd44 CORDA-577: FlowSession porting (#1530)
* Throw exception if a flow is initiated twice for the same Party

* Chunk of porting

* Need ReceiveTransactionFlow

(cherry picked from commit 774383e)

* Notaries compile

* TwoPartyTrade

* SimmFlow & StateRevisionFlow

(cherry picked from commit da602b1)

* TwoPArtyDealFlow regulator send

* installCoreFlow

* IRSTradeFlow
UpdateBusinessDayFlow
RatesFixFlow
NodeInterestRates

(cherry picked from commit 6c8d314)

* Added recordTransaction parameter to ReceiveTransactionFlow

* Some Tests, Flows

* Fixed typo in record tx param

* more things

* Fix CollectSignatures

* FlowFrameworkTests

(cherry picked from commit 2c50bc3)

* Fix TwoPartyTradeFlow

* CustomVaultQuery

(cherry picked from commit 48f88e8)

* FlowsInJavaTest

* WorkflowTransactionBuildTutorial

* PersistentNetworkMapCacheTest

* FlowCookBookJava

(cherry picked from commit 9b48114)

* Fix RatesFixFlow

* Fix TwoPartyDealFlow to get signature of initiating side

* Integration tests

(cherry picked from commit dbcd965)

* CordappSmokeTest

(cherry picked from commit d19cbd6)

* Inlined FinalityFlow

* Updated uses of FinalityFlow

* ContractUpgradeFlowTest passes

* CollectSignaturesFlow refactor

(cherry picked from commit 5e7b1a7)

* Check that we are not the recipient of cash

* Fix Simm demo

* WorkflowTransactionBuildTutorialTest

* Fix CashPaymentFlowTests

* ScheduledFlowTests

* FlowFrameworkTests

* Add cordappPackagesToScan Driver param

* FinalityFlowTests

* Fix LoaderTestFlow

* NodeMonitorModelTest

* BankOfCordaRPCClientTest

* rename to extraCordappPackagesToScan

* Fixed broken merge

* BankOfCordaHttpAPITest

* Fix CollectSignaturesFlow

* Fix annotation on DummyFlow to stop warning

* Fix TraderDemoTest

* Review feedback

* Doc improvements and minor changes

* Address some PR comments

* Looping regulators into the FinalityFlow broadcast rather than sending separately in TwoPartyDealFlow.

* Add Uninitiated FlowState

* Add test for double initiateFlow exception

* Some more s&r victims

* FlowSession utilities (#1562)

* Merge fix

* CollectSignatureFlow can handle several signing keys

* Actually handle several signing keys

* update kdoc

* Correct SignTransactionFlow error message

* Create deprecated flows package

* Add internal deprecated flows

* Reverted FinalityFlow to auto-broadcast all tx participants

* Move the deprecated packages into another PR
2017-09-21 12:12:25 +01:00
Ross Nicoll
78500205df Move IdentitySyncFlow into confidential-identities (#1583) 2017-09-21 11:22:01 +01:00
Katarzyna Streich
fd57cf1c0c Remove advertised services from NodeInfo (#1521)
* Remove advertisedServices from NodeInfo.

Introduce notaryIdentities in NetworkMapCache, that will be filled in
later from NetworkParameters. Clean up NetworkMapCache API. Expose
notaryIdentities through RPC. For now we assume as temporary solution
that notaries in NetworkMap have to contain "notary" in name.

* Further clean up of NetworkMapCache API

Remve partyNodes. Introduce getAllNodeInfos function

* Remove notaryIdentity from ServiceHub

* Address Shams review comments

* Address Andrius review comments

* Add comments, cleanup

* Fixes

* Address comments

* Yet another commit with comments addressed

* Move ServiceType and ServiceInfo to node-api

Add changelog entry. Address rest of comments.

* Minor comments
2017-09-20 13:19:57 +01:00
Shams Asari
838e753164 Moved PhysicalLocationStructures into finance (#1557) 2017-09-19 17:36:26 +01:00
Shams Asari
8e0b8477af Changed FlowLogic.ourIdentity to return Party and added FlowLogic.ourIdentityAndCert which returns PartyAndCertificate. (#1537)
Updated code base to make use of these instead of chooseIdentity(). Also improved the serialisation of fiber checkpoints so that it doesn't store the entire cert parth of this identity.
2017-09-18 15:28:23 +01:00
Ross Nicoll
8f86068807 Move SwapIdentitiesFlow to confidential-identities module (#1531)
* Move SwapIdentitiesFlow to confidential-identities module

* Clean up confidential-identities build.gradle

* Change description to include Experimental

* Move confidential-identities to a dependency of node rather than node-api
2017-09-18 14:19:20 +01:00
josecoll
2c5aa4eead FIX - Modify generateSpend() to send change to a fresh confidential identity (#1533)
* Modify generateSpend() to send change to a fresh confidential identity

* Update cash tests to handle change being sent to a new address

* Add comments explaining intent

* Fix broken master build.
2017-09-16 15:46:11 +01:00
josecoll
bce0cbf38a Revert "Modify generateSpend() to send change to a fresh confidential identity (#1522)" (#1532)
This reverts commit 114cc47024.
2017-09-15 19:49:57 +01:00
Ross Nicoll
114cc47024 Modify generateSpend() to send change to a fresh confidential identity (#1522)
* Modify generateSpend() to send change to a fresh confidential identity

* Update cash tests to handle change being sent to a new address

* Add comments explaining intent
2017-09-15 18:39:01 +01:00
Clinton
64f2bf7b09 Fixed a bug in the CorDapp loader that crashed when plugins were loaded (#1527)
* Fixed a bug in the CorDapp loader that crashed when plugins were loaded
due to an incorrect classloader definition.

* Removed debug statement.
2017-09-15 16:22:22 +01:00
Katarzyna Streich
495e870b74 NodeInfo remove main identity (#1284)
* Remove node's main identitiy from NodeInfo.

Preparation for getting rid of services + supporting multiple identities
on the node.
NodeInfo keeps multiple identities as a list. For now the first one is treated as a special one.
Introduced function chooseIdentity in CoreTestUtils as a preparation for proper handling of multiple identities in the future.
Remove legalIdentityKey from ServiceHub, add extension function - chooseIdentity on ServiceHub.
Add `me` field on FlowStateMachineImplemetation, flows should know what the calling identity is.
Remove SERVICES_PREFIX in artemis messaging layer.

* Address minor comments.

* Fixes after rebase.

Remove chooseIdentity from ServiceHub

* Rename me to ourIdentity on FlowLogic

* Fixes after rebase

* Address Ross comments, fixes

* Fix after rebase

* Fix services certificate paths

Apply Patrick's patch.
2017-09-15 14:39:34 +01:00
Ross Nicoll
fec7919edc CORDA-499: Rename CurrencyUtils to Currencies (#1476)
* Rename CurrencyUtils to Currencies

Rename CurrencyUtils to Currencies to explain why it's not in the finance utils package.

* Correct reference in CordaRPCJavaClientTest

* Remove spurious newline
2017-09-15 09:03:44 +01:00
Andrzej Cichocki
cfd6739d23 Introduce StartedNode (#1491) 2017-09-13 17:34:52 +01:00
Shams Asari
ed0aede1f1 In preparation for the removal of advertised services, @CordaService no longer expects a static "type" field for the ServiceType.
Instead @CordaServices will use the main identity of the node.
2017-09-13 15:53:50 +01:00
Michele Sollecito
ea61e6e9d5 [CORDA-461] Remove deprecated APIs. (#1480)
https://r3-cev.atlassian.net/browse/CORDA-461
2017-09-13 15:39:39 +01:00
Ross Nicoll
024285b007 Rename TransactionKeyFlow to SwapIdentitiesFlow (#1499) 2017-09-13 15:01:42 +01:00
josecoll
5504493c8d Improved support for testing custom schemas using a MockNetwork. (#1450)
* Improved support for testing custom schemas using a MockNetwork.

* Removed `requiredSchemas` from CordaPluginREgistry configuration
Custom schema registration now uses classpath scanning (CorDapps) and explicit registration (tests) following same mechanisms as flow registration.

* Updated following PR review feedback.

* Helper function to return Kotlin object instance fixed and moved to core InternalUtils class.

* Fixed auto-scanning Unit test to assert correct registration of custom schema.

* cleanup comment.

* Changes following rebase from master.
2017-09-13 12:06:24 +01:00
Ross Nicoll
de3468f8a7 Replace X500Name with CordaX500Name (#1447)
Replace X500Name with CordaX500Name, which enforces the specific constraints Corda expects on legal/service identity names.
2017-09-12 01:03:10 +01:00
Andrzej Cichocki
1565b395b6 Introduce AttachmentConstraint (#1370)
Introduced attachment constraint interface to TransactionState as a base for extension.
2017-09-11 17:51:03 +01:00
Clinton
bc6628a072 ContractState now references contract by class name (#1407)
* ContractState's contract type has been moved to TransactionState and is now a string representing the class name of the contract class to allow classloading of arbitrary contracts from custom classloaders.

* Upgraded isolated JAR to new version.
2017-09-11 16:44:18 +01:00
Patrick Kuo
57412d4498 Enforce X500Name format defined in design doc (#1427)
* Standardise X500Name format - WIP

* address PR issues

* failing test fix and replace X500Name with getX500Name

* gradle plugin fix

* Added country code validation
2017-09-07 14:47:42 +01:00
Viktor Kolomeyko
d9d17be284 CORDA-540: Small changes to make "finance" tests pass in AMQP mode (#1445) 2017-09-07 13:31:41 +01:00
Matthew Nesbit
291a55d2d2 Remove some trivial syntax related warning messages.
Fix whitespace

Address PR comment
2017-09-06 17:10:01 +01:00
Ross Nicoll
6fa20e33da Remove unused myKey from TwoPartyDealFlow (#1436) 2017-09-06 15:00:34 +01:00
Andrzej Cichocki
15f741f315 Spinoff driver into own project with demorun (#1401) 2017-09-05 09:50:51 +01:00
joeldudleyr3
d1ee84044d Renames AuthenticatedObject to CommandWithParties for clarity. 2017-09-01 14:10:35 +01:00
Ross Nicoll
2a794d9523 Eliminate generated Kt classes
* Move CP_PROGRAM_ID into companion object
* Move COMMODITY_PROGRAM_ID into companion object
* Remove unused convenience function from FinanceTypes before we end up committing to maintaining it indefinitely.
* Move calculateDaysBetween into BusinessCalendar to eliminate FinanceTypesKt
2017-09-01 11:10:59 +01:00
Ross Nicoll
7e3dd4c12c Restructure net.corda.core.crypto package
* Rename KeyFactory to CompositeKeyFactory
* Move expandedCompositeKeys into TestDSL as the only place that uses it
* Move NullKeys out of their own package
* Move remaining crypto classes into superpackage
* Move utility classes out of crypto and into utilities package
2017-09-01 10:55:58 +01:00
Chris Rankin
03ddaaac11 Remove the copy of Guava from within the finance module. (#1362) 2017-08-31 14:40:32 +01:00
mkit
2b7ec0542f Refactoring MockServices class - removing Kt Java class (#1350) 2017-08-30 12:10:42 +01:00
Andrius Dagys
210cb4658a Test DSL: only "unverified" transactions get filled with dummy data to make them valid WireTransactions.
Recording is removed for a ledger with a single transaction.
2017-08-29 17:05:13 +01:00
Andrius Dagys
73664c3383 Test DSL: update tests to handle new transaction constraints 2017-08-29 17:05:13 +01:00
Ross Nicoll
bc5aceddbf Enable anonymisation in two party deal/trade flows 2017-08-29 16:07:09 +01:00
Andrzej Cichocki
cd0ab40b2e Core doesn't need a compile dep on guava (#1283) 2017-08-29 09:56:26 +01:00
Mike Hearn
e2f112c3a8 Add support for multi-spends to OnLedgerAsset and Cash. Multi-spends let you request multiple payments to different parties be calculated simultaneously. (#1342) 2017-08-28 19:13:53 +01:00
josecoll
458d2e32c0 Pluggable cash selection using H2 as default implementation. (#1300)
* Pluggable cash selection using H2 as default implementation.

* Refactor to use own CashSelection service loader and associated isCompatible() check.

* Determine Cash Selection algorithm to use based on JDBC Driver loaded.
Lazily load JDBC Driver metadata and class implementation.

* Rebased and adjusted package naming to include `finance`

* Rebased and adjusted package naming to include `finance`

* Added some documentation.
Minor fixes and changes following PR review.

* Return cashSelectionAlgo.
Throw exception rather than setting in atomically referenced object.
2017-08-22 18:09: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
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