Commit Graph

483 Commits

Author SHA1 Message Date
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
Andrius Dagys
0314e650a4 Clean up API for selecting notaries (#1573)
* Remove getAnyNotary() from network map API.
Change notaryIdentities() signature to return a Party instead of PartyAndCertificate.
Some API doc updates.

* Minor API doc formatting and typo fix

* Update changelog

* Address comments

* Address comments
2017-09-21 10:28:18 +01:00
Katarzyna Streich
002c6c4687 Remove notaryIdentityKey from ServiceHub (#1541)
* Remove notaryIdentityKey from ServiceHub

It was redundant, as we have notary field on a transaction. Notaries can
use this field to check if the transaction was meant for them and then
use that information while choosing a key to sign a transaction.

* Move notaryIdentityKey to NotaryService

* Address comments

* Fixes after rebase
2017-09-20 17:47:45 +01:00
Patrick Kuo
adb8c5ead2 Generate distributed service certificate properly in keystore (#1529)
* * generate distributed service certificate properly in keystre instead of saving key in flat file when using `generateToDisk`
* move composite key loading hack to devSSL keystore generation process.
* fix and distributed service un-ignore test

* update comment to clarify the composite key certificate creation process.

* fixup after rebase
2017-09-20 17:05:29 +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
Maksymilian Pawlak
92e22ab5f8 Test identities names cleanup (#1552) 2017-09-19 17:33:00 +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
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
3d577e5eed CORDA-499: Remove further Kt classes (#1489)
* Change how NetworkHostAndPort is parsed

Change from using a global extension function to parse
NetworkHostAndPort strings, into using a function on the companion
object. This is a lot easier for Java interop and matches the common
style used elsewhere both in Corda and in Java libraries.

* Move JAR extraction into new utils file

* Move path verification function to ArtemisUtils

Move path verification function "requireOnDefaultFileSystem()" to new
ArtemisUtils.kt file, as this makes more sense from a Java interop
perspective.

* Add JvmName to AMQPSchemaExtensions

* Add JvmName to AMQPSerializationScheme

* Revert "Move JAR extraction into new utils file"

This reverts commit 1f0f41909b68ff21cc24b5efd6a1a360393a0a14.

* Reformat code

* Run formatter on ArtemisUtils
2017-09-14 17:34:01 +01:00
Ross Nicoll
68153b5acd CORDA-499: Move DemoRunner and DemoUtils into internal (#1509)
* Move DemoRunner and DemoUtils into internal

Move DemoRunner and DemoUtils into net.corda.testing.internal as they're unfinished APIs we don't want to commit to supporting, yet.

* Move classes to demorun specific subpackage
2017-09-14 16:52:42 +01:00
Shams Asari
573987d929 Removed X509CertificateHolder from public API, using java.security.X509Certificate instead (#1510) 2017-09-14 15:48:33 +01:00
Ross Nicoll
ae2183c8a1 Reduce use of X500Name bridges (#1483)
* Change to using strings in CordformContext; X500Name is an external API dependency we're trying to avoid, X500Principal rearranges the order of the elements in a way we don't want, and trying to put CordaX500Name into Groovy in the time available is impractical. As such having pre-formatted strings used in the Cordform plugin makes most sense right now.
* Remove uses of CordaX500Name.x500
* Remove old X.500 parsing tools
* Move CordaX500Name.x500 into X500NameUtils
* Move X500NameUtils into internal
2017-09-14 11:56:14 +01:00
Shams Asari
8f0c0c784b Removed PluginServiceHub 2017-09-14 09:30:37 +01:00
Clinton
b102900c90 Automatically load contract attachments into the attachment store (#1500)
Attachments for contracts are now loaded into the attachment store by the cordapp provider.
2017-09-13 18:43:37 +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
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
Clinton
8415a01a47 Cordform common is now a part of the gradle plugin suite (#1474)
Cordform common is now a full gradle plugin and all related gradle hacks are removed.
2017-09-12 19:18:09 +01:00
Ross Nicoll
c18b0ecdc3 Clean up CordaX500Name (#1487)
* Remove unused imports
* Move X500 name generation into test code as it's no longer used in the main code
2017-09-12 13:08:43 +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
Shams Asari
763539b5f0 Moved stuff out of X500NameUtils.kt not related to X500Name 2017-09-10 20:01:18 +01:00
Ross Nicoll
df87731043 CORDA-499: Dokka 'Kt' class cleanup (#1433)
* Remove unneeded identity registrations from tests, which sometimes cause duplicated entries in the database
* Add JvmName annotations to ObservableFold and ObservableUtilities
* Move createMapChange() into ReadOnlyBackedObservableMapBase as the only place it's used, to
improve Java interop.
* Clean up Generator by moving extension functions into the class/companion class.
* Add documentation to the actual functions rather than being only on the top level class. 
* Add JvmName to Generators
* Move extension functions into the classes they're used in to try supressing generation of empty RPCClientProxyHandlerKt class.
* Add JvmName to ConcurrencyUtils
* Move Iterable<ServiceInfo>.containsType() into Simulation, as it's only useful when verifying
setup of a simulated case. Resolves ServiceInfoKt class being generated.
* Move FlowHandle.notUsed() into the one place it's actually called, so Kotlin stops creating a FlowHandleKt class.
2017-09-08 14:37:18 +01:00
Michele Sollecito
df31e52665 [CORDA-303]: Add some tests that stop and start a node and check state is persistent. (#1449)
* [CORDA-303]: Add some tests that stop and start a node and check state is persistent.

* [CORDA-303]: Updated change log and added Javadocs.

* [CORDA-303]: Cleaned up test.

* [CORDA-303]: Removed blank lines after class or function declarations.

* [CORDA-303]: Wrapped multiple invocations in `with` construct.
2017-09-08 09:24:22 +01:00
Rick Parker
79f1e1ae7f Introduce current context concept for serialization in preparation for WireTransaction changes (#1448) 2017-09-08 08:16:38 +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
Andrzej Cichocki
579abda044 Group test scope modules in testing dir (#1419) 2017-09-05 18:27:26 +01:00
josecoll
ebc9cacb53 Contract Upgrade API improvements + persistence (#1392)
* All Contract Upgrade functionality performed within a corresponding flow.
Removed RPC API calls for contract upgrade authorisation / de-authorisation.
Added persistence using AppendOnlyPersistentMap.

* Changed to using a PersistentMap to ensure entries can be removed (was causing failing de-authorisation tests).
Fixed all warnings.

* Added mandatory @Suspendable annotations to flows.

* Do not instantiate object unless overridden.

* Updated changelog and CordaDocs.

* Persistence simplification: only store upgrade contract class name (not serialized object)

* Remove nullability from contract_class_name DB column.
2017-09-05 13:23:19 +01:00
Matthew Nesbit
8ef29d4736 Persistent Identity
Fixup tests after rebase

Add unit tests of Persistent Identity. Fix bugs in PersistentMap.

Wrap identity and network map RPC calls in database transaction

Address PR comments
2017-09-05 11:19:54 +01:00
Andrzej Cichocki
15f741f315 Spinoff driver into own project with demorun (#1401) 2017-09-05 09:50:51 +01:00