Commit Graph

106 Commits

Author SHA1 Message Date
Stefano Franz
b23af5f0d2
add timeouts to all tests (#5875) 2020-02-11 10:14:05 +00:00
Ivan Schasny
7e6e172a81 CORDA-3396 removed wildcard import 2019-11-07 16:50:44 +00:00
Ivan Schasny
42f6856502 CORDA-3396 removed wildcard import 2019-11-07 16:50:44 +00:00
Ivan Schasny
34db285ac3 CORDA-3396 fixed NPE in BlobInspector. Added verbose message in the case of error. 2019-11-07 16:50:43 +00:00
Ryan Fowler
bfa460bc07 CORDA-3152: Register custom serializers for jackson as well as amqp 2019-10-15 15:52:31 +01:00
Zoltan Kiss
f171de7b69 TM-23 Fail build on compiler warnings (#5453)
* java compile respects compilation.allWarningsAsErrors

* suppress or cleanup warnings

* suppress warning

* use non-deprecated kotlin dependency

* rename property

* handle property existence check

* Deal with warnings
2019-09-11 16:34:51 +01:00
Stefano Franz
e35c0c1df7
CORDA-3009 - Migrate identity service to use to string short (#5217)
* migrate PersistentIdentityService to use key.toShortString()
update definition of PublicKeyToExternalId mapping to allow fast lookup by externalId/publicKey

* fix misspelled table name

* add test of migration script

* add design document for proposal to move IdentityService to using the correct PK.toStringShort() method for hashing a publickey

* add enterprise testing considerations to design

* address review comments

* fix compilation errors

* modify PublicKeyToOwningIdentityCache to use toStringShort() as it's lookup key

* address syzmon's code review comments
2019-08-28 14:16:18 +00:00
Shams Asari
90284a6143
CORDA-2919: JacksonSupport, for CordaSerializable classes, improved to only uses those properties that are part of Corda serialisation (#5397) 2019-08-27 13:06:28 +01:00
Shams Asari
2e02968c63
ENT-3496: dumpCheckpoints shell command (#5171)
Dumps all the node's checkpoints as JSON into a single zip file in the node's directory. The output contains:

* All the fields for the top-level flow
* The current sub-flow call stack, along with the current progress tracker step for each sub-flow
* The event that suspended the flow, which if it's a send or sendAndReceive will show the payload that was sent
* Low level information on the active sessions with other peers
2019-06-26 15:31:02 +01:00
LankyDan
e3db3a386e ENT-3496 Address pr comments 2019-06-17 16:43:05 +01:00
LankyDan
afc36615d0 ENT-3496 Address pr comments 2019-06-17 16:04:05 +01:00
Shams Asari
2152961d46
CORDA-2333: Dependency update pass for tests and demos (#5211) 2019-06-13 10:15:13 +01:00
LankyDan
31a0c077b8 ENT-3496 Move dumpCheckpoints to the new InternalCordaRPCOps interface
To prevent making `dumpCheckpoints` part of the public API a new
interface, `InternalCordaRPCOps` has been created and the function
has been moved there. `InternalCordaRPCOps` inherits from
`CordaRPCOps`.

`CordaRPCOpsImpl` now implements `InternalCordaRPCOps`.

`RunShellCommand` and `StringToMethodCallParser` required additional
changes due to issues handling inherited functions. This has only been
raised now due to `InternalCordaRPCOps` inheriting from `CordaRPCOps`.

Many classes have had references to `CordaRPCOps` changed to
`InternalCordaRPCOps`.
2019-06-10 16:15:03 +01:00
Shams Asari
5619debf18 ENT-3496: dumpCheckpoints RPC
Dumps all the node's checkpoints as JSON into a single zip file in the node's directory. The output contains:

* All the fields for the top-level flow
* The current sub-flow call stack, along with the current progress tracker step for each sub-flow
* The event that suspended the flow, which if it's a send or sendAndReceive will show the payload that was sent
* Low level information on the active sessions with other peers
2019-05-24 17:28:36 +01:00
Tudor Malene
5edd732615 Revert "CORDA-2773: Support for custom Jackson serializers (#5025)" (#5167)
This reverts commit f7bf1b41
2019-05-24 13:40:13 +01:00
Tudor Malene
f7bf1b41e0 CORDA-2773: Support for custom Jackson serializers (#5025) 2019-04-26 15:34:41 +01:00
Stefan Iliev
4f382a65a3 CORDA-2632 Handle exceptions when file does not exist. (#4967)
* corda-2632 Added catch clause to handle argument exceptions and display the proper error.

* Created specific exception for when the file is missing instead of the general catch all exception.

* Changes according to code review.
2019-04-25 16:23:11 +00:00
Adel El-Beik
374ae80ab1 ENT-3322: Improved error reporting in interactive shell when an error occurs after a ctor is matched. (#4969)
* ENT-3322: Improved error reporting when an error occurs in type construction, after the ctor has been found.

* ENT-3322: FlowA in this test violated a restriction of StringToMethodCallParser that parameters with the same name but different types cannot be overloaded.
Fixed up FlowA to not have overloaded operation.

* ENT-3322: Simplified code following review comments.

* ENT-3322: Few updates following PR review comments.
2019-04-12 11:13:53 +01:00
Chris Rankin
ea263b3e54 CORDA-2569: Add "flow kill <ID>" command to Corda's shell. (#4861)
* CORDA-2569: Add "flow kill <ID>" command to Corda's shell.

* Add testing and documentation for RPC killFlow operation.
2019-03-08 16:39:22 +00:00
Tudor Malene
3d362e066c CORDA-2595 - check that all attachments are trusted before loading (#4763)
CORDA-2595 - Fix test and api.

CORDA-2595 add test

CORDA-2595 fix tests

CORDA-2595 fix test and address code review comments

CORDA-2595 address code review comments
2019-02-15 17:33:14 +00:00
Shams Asari
2622c8fe51
CORDA-1942: Renamed NetworkParametersStorage to NetworkParametersService to match its public usage (#4487)
As a public API it's not a true storage - CorDapps can't add network parameters.
2019-01-03 08:52:39 +00:00
Tudor Malene
ee9251bd25
CORDA-2327 add attachments for missing dependencies (#4456)
* CORDA-2327 first draft - add attachments for missing dependencies

* CORDA-2327 draft - fix unit tests

* CORDA-2327 draft - some cleanup.

* CORDA-2327 fix test

* CORDA-2327 fix test

* CORDA-2327 fix test

* CORDA-2327 Address code review comments

* CORDA-2327 fix api

* Address code review comments

* CORDA-2327 Address code review comments

* CORDA-2327 Address code review comments

* Fix merge

* Address code review comments
2019-01-02 16:16:53 +00:00
Shams Asari
0c880fb7a7
Reverted incorrect deprecation of JacksonSupport.createInMemoryMapper (#4393) 2018-12-13 10:20:48 +00:00
Katarzyna Streich
5d2ad46553
CORDA-2089 - network parameters tags - part (#4228)
* CORDA-2089 - network parameters tags - part

Data structures changes, storage and notarisation.

Tag transactions with network parameters hash that was in force when tx
was created. Add component group on all core transactions and resolved
parameters on full transactions. The hash should be always visible on
the filtered versions of transactions. Add
notarisation check that the parameters are current.
Implement network parameters storage on services for resolution.

This is only part of the work, next PR will include changes to
ResolveTransactionsFlow to make sure that parameters in the transaction
graph are ordered (this is to prevent the downgrade attack, when the
malicious notary and participants sign transaction that shouldn't be
notarised otherwise).
Probably on network services side we need the default parameters
endpoint for the
transactions that were created before this change - for now it's default
to the current ones.

* Make parameters storage agnostic to cert hierarchy

Test fixes

* Address most PR comments

* Fixes after rebase

* Fixes. Add epoch column to parameters storage.

* Address part of review comments

* Some more comments

* Hopefully fixing what I broke doing rebse

* Address Kostas comments

* Further fixes

* Save all parameters from updates to storage

* Fix integration test

* Address comments

* Fixes after rebase

* Fix test

* Fixes

* Add wrapper for filtering around parameters hash

* API stability fixes

* Add NetworkParametersStorageInternal

* Rename
2018-11-27 15:48:32 +00:00
Shams Asari
51adf9b678
LedgerTransaction no longer a data class to prevent more copy methods and fixed serialisation issue (CORDA-2231) (#4287)
LedgerTransaction is not meant to be created directly from client code, but it being a data class means we will expose new copy methods as new properties are added. The existing copy methods that we've exposed since V3 are deprecated, and equals and hashCode have been updated to be based just on id.

The primary c'tor has been clearly marked as the class' wire format, and so the internal stuff has been moved out. The references property cannot be made nullable and so DeprecatedConstructorForDeserialization is used instead.
2018-11-22 22:53:24 +00:00
Tudor Malene
4c8dabc288
ENT-2506 restore the attachment party signers (#4255)
* ENT-2506 restore the attachment party signers

* ENT-2506 restore the attachment party signers

* ENT-2506 restore the attachment party signers

* ENT-2675 Address code review changes.

* ENT-2675 Address code review changes.
2018-11-22 18:35:30 +00:00
Dominic Fox
2c6bce3e5d
CORDA-2099 serialisation rewrite (#4257)
* Type model first draft

* Introduce TypeIdentifier

* Attempting to retrofit fingerprinter with type model

* Complete retrofitting typemodel to fingerprinter

* Ensure component types are resolved correctly

* Fixes and tests

* Move resolveAgainst to TypeIdentifier

* Remote type modelling and reflection

* Convert TypeIdentifiers back into types

* Translate AMQP type strings to type identifiers

* Start replacing DeserializedParameterizedType

* Start roundtripping types through AMQP serialization

* Comments on type modelling fingerprinter

* kdocs and interface reorganisation

* Lots and lots of kdocs, bugfix for cyclic references

* Separate SerializerFactory construction from concrete implementation

* Fewer build methods

* Method naming that doesn't fatally confuse determinisation

* Extract SerializerFactory interface

* Reset to master's version of compiler.xml

* Un-ignore flickering test

* Enums don't have superclasses

* Break out custom serializer registry

* Refactor to separate remote and local serializer factories

* Shrink interfaces

* Further interface narrowing

* Fingerprinting local type model

* LocalSerializerFactory uses LocalTypeInformation

* Resolve wildcards to their upper bounds

* Actually cache custom serializers

* Fix various bugs

* Remove print statements

* There are no cycles in type identifiers

* Drive class carpentry from RemoteTypeInformation

* Refactor and comment

* Comments

* Comments and pretty-printer extraction

* Format long methods with braces

* Serialise composable types using LocalTypeInformation

* Warnings if a type is non-composable

* Rename lookup -> findOrBuild

* Evolution serialisation (no enums yet)

* Eliminate old ObjectSerializer and evolver

* Enum evolution

* Opacity claims types less greedily

* Fix type notation and type erasure bug

* Clean up unused code paths

* Delete unused codepaths

* Move whitelist based type model configuration to own file

* Move opaque type list

* Make all evolution serialisers in one go when schema received

* Minor tweaks

* Commenting and tidying

* Comments

* Rebase against master

* Make flag for controlling evolution behaviour visible

* propertiesOrEmptyMap

* Restore error messages

* Test for CORDA-4107

* PR fixes

* Patch cycles in remote type information after creation

* Fix line breaks in unit test on Windows

* This time for sure

* EvolutionSerializerFactoryTests

* Fix some pretty-printing issues, and a carpenter bug

* PR fixes

* Clarify evolution constructor ordering

* Remote TODO comment, which has been moved to a JIRA story
2018-11-22 11:44:40 +00:00
Stefano Franz
8f463c46a9 Add message to uses of require(...) (#4192) 2018-11-16 17:13:55 +00:00
Mike Hearn
4d2d9b8304 Fix a regression in the shell that was preventing it from fuzzy matching against notary names. 2018-11-16 14:37:43 +00:00
tudor.malene@gmail.com
1e27f0cbe0 Merge remote-tracking branch 'private/master' into feature/tudor_constraints
# Conflicts:
#	core/src/main/kotlin/net/corda/core/transactions/LedgerTransaction.kt
#	core/src/main/kotlin/net/corda/core/transactions/TransactionBuilder.kt
#	core/src/main/kotlin/net/corda/core/utilities/KotlinUtils.kt
#	node/src/test/kotlin/net/corda/node/services/persistence/NodeAttachmentServiceTest.kt
2018-11-14 11:50:19 +00:00
Konstantinos Chalkias
71117ebdad
[CORDA-2212] Better error on empty Party name fuzzy matching (#4220)
* typo - no matching
2018-11-12 19:34:21 +00:00
Dominic Fox
f3b372d31d
CORDA-2099 make serializer factory interface (#4137)
* Separate SerializerFactory construction from concrete implementation

* Fewer build methods

* Method naming that doesn't fatally confuse determinisation

* Extract SerializerFactory interface

* Reset to master's version of compiler.xml

* Un-ignore flickering test

* Remove unnecessary build method

* Whitespace

* Unused import

* Change build method

* Formatting fixes

* Fix test
2018-11-07 13:48:45 +00:00
tudor.malene@gmail.com
29a8c153ed Merge branch 'master' into tudor_merge_os_24_10
# Conflicts:
#	core/src/main/kotlin/net/corda/core/internal/JarSignatureCollector.kt
#	core/src/main/kotlin/net/corda/core/transactions/LedgerTransaction.kt
#	core/src/main/kotlin/net/corda/core/transactions/TransactionBuilder.kt
#	core/src/main/kotlin/net/corda/core/utilities/KotlinUtils.kt
#	core/src/test/kotlin/net/corda/core/contracts/PackageOwnershipVerificationTests.kt
#	core/src/test/kotlin/net/corda/core/internal/JarSignatureCollectorTest.kt
#	node/src/main/kotlin/net/corda/node/internal/cordapp/JarScanningCordappLoader.kt
#	node/src/test/kotlin/net/corda/node/services/persistence/NodeAttachmentServiceTest.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/dsl/TestDSL.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/dsl/TransactionDSLInterpreter.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/internal/MockCordappProvider.kt
2018-10-24 17:09:30 +01:00
Dominic Fox
b6f2532ce6
Corda 1922 serialize states with calculated values (#3938)
* Introduce SerializeForCarpenter annotation

* Apply SerializableComputedProperty annotation to Cash.exitKeys, fix bugs

* info -> trace

* Remove annotation from FungibleAsset, as we do not know whether all implementing classes will provide the property as a calculated value

* Remove redundant import

* Explicit lambda params

* Restore explicit import for Enum valueOf

* Moving and rescoping

* More meaningful error message

* Add java test and documentation

* Fix accidentally broken unit test

* Ignore superclass annotation if property not calculated in implementing class

* Exclude calculated properties from Jackson serialisation

* Fix broken test
2018-10-09 14:54:31 +01:00
tudor.malene@gmail.com
40825fef99 Merge branch 'tudor_merge_os_master' into feature/ENT-2222/constraints_propagation_private
# Conflicts:
#	node/src/main/kotlin/net/corda/node/internal/cordapp/JarScanningCordappLoader.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/internal/MockCordappProvider.kt
2018-10-02 16:10:19 +01:00
Konstantinos Chalkias
6980835e8c
[CORDA-2044] Allow more signature schemes to TestUtils (#4002) 2018-10-01 10:41:03 +01:00
Tudor Malene
f96a59932c ENT-2222 Constraints propagation
ENT-2222 Fix tests

ENT-2222 Fix tests

ENT-2222 Add ledger transaction verification logic

ENT-2222 Fixed IRS test

ENT-2222 Fixed IRS test

ENT-2222 Fixed unit test

ENT-2222 Better kdocs

ENT-2222 Support for reference states

ENT-2222 Fix support for reference states

ENT-2222 Revert wrong change

ENT-2222 Fix Kdoc

ENT-2222 Fix Kdoc

ENT-2222 Better docs

ENT-2222 Address code review comments

ENT-2222 Fix test

ENT-2222 Fix rebase

ENT-2222 Add documentation around constraint propagation

ENT-2222 Add tests for contract propagation

ENT-2222 Add Signature Constraints propagation - first draft

ENT-2222 fix tests

ENT-2222 more tests

ENT-2222 unseal the TransactionVerificationException

ENT-2222 unseal the TransactionVerificationException

ENT-2222 more docs

ENT-2222 address code review comments

ENT-2222 address code review comments

ENT-2222 re-implement transition logic

ENT-2222 better comments and checks

ENT-2222 Fix tests

ENT-2222 merge fixes
2018-09-28 13:38:35 +01:00
Michal Kit
492c25fedd
CORDA-1995 removing DigitalSignatureWithCertPath (#3953)
* CORDA-1995 removing DigitalSignatureWithCertPath

* Fixing unit tests

* Addressing review comments
2018-09-19 14:30:21 +01:00
Dominic Fox
f81428eb53
Corda 1916: signature attachment constraints (#3839)
* Create constraint, extract Jar signature collection

* Extract JarSignatureCollector into its own file

* Jar signature collection throws exception if signatures are inconsistent

* Focus testing in Jar signature collection

* Extract some helper functions in test

* Patch tests with mock attachment storage

* Assert that generated constraint is satisfied by signed attachment

* Clarify constraint selection logic

* Explicit return types on extension methods

* Link to docsite Signature Contrainsts documentation

* Fix issue with shared JAR reading buffer
2018-08-24 17:21:54 +01:00
Chris Rankin
ff62df8d5a
CORDA-1907: Allow Corda's shell to deserialise using generic type information. (#3810) 2018-08-20 13:22:07 +01:00
Chris Rankin
494661cc0c
CORDA-1905: Extend JSON deserialisation to handle Amount<T> for any T. (#3790)
* Extend JSON deserialisation to handle Amount<T> for any T.
* Rewrite message for @Deprecated.
2018-08-17 17:20:26 +01:00
Maksymilian Pawlak
30d5d45c87
[CORDA-1568] Omit synthetic methods in shell (#3517) 2018-07-05 14:59:13 +01:00
Shams Asari
b8e6c47cfd
Added missing JacksonSupport unit test for Instant (#3507) 2018-07-04 15:39:22 +01:00
Shams Asari
7b09795795
CORDA-1383: Cleaned up the JSON format of WireTransaction and SignedTransaction (#3248)
In particular correctly outputs the custom state and command objects in the txs. Also fixed up deserialisation back into the transaction objects.
2018-05-30 16:37:41 +01:00
Shams Asari
d772bc8b7f
Added back support for parsing OpaqueBytes as UTF-8 strings in JacksonSupport (#3240) 2018-05-25 17:07:19 +01:00
Shams Asari
4e0378de9c
CORDA-1238: Moved the blob inspector out of experimental and wired it to JackonSupport (#3224)
The existing output format was not complete and so was deleted to avoid it becoming a tech debt. We can always resurrect it at a later point.
2018-05-24 18:26:55 +01:00
Shams Asari
824adca6c0
CORDA-1238: Updated JacksonSupport to serialise pojos annotated with @CordaSerializable with the same properties as the AMQP serialisation framework. (#3162)
This fixes an issue for pojos with getters that aren't c'tor-based properties. Jackson serialises these out but is then unable to deserialise the pojo back.
2018-05-17 18:34:12 +01:00
Shams Asari
b031e66ab9
CORDA-1238: Updated JacksonSupport to support SerializedBytes, CertPath, X509Certificate and the signature classes (#3145)
SerializedBytes are first converted to the object it represents before being serialised as a pojo.

These changes will be needed to support the the blob inspector when it will output to YAML/JSON.
2018-05-15 17:02:43 +01:00
Michele Sollecito
d027b5b8f2
[CORDA-1472]: Crackdown on warnings. (#3136) 2018-05-14 21:15:52 +07:00
Shams Asari
3bb95c3ed1
Cleanup and improvements to the serialisation format of JacksonSupport (needed for CORDA-1238) (#3102)
Also deprecated all the public members that shouldn't have leaked into the public API.
2018-05-09 21:42:55 +01:00