Commit Graph

150 Commits

Author SHA1 Message Date
Patrick Kuo
21e1c86155 Corda intellij Plugin (#3)
* First cut for corda intellij Plugin
2017-06-19 16:41:28 +01:00
Matthew Nesbit
6933c8fda3 Move all advanced finance types into finance module.
Fixup after rebase

Also pull in the interpolator code, which is used for financial calculations.

Fix up rebase
2017-06-16 11:19:24 +01:00
Matthew Nesbit
0fc38d71dc Ignore the flaky sandbox test, which keeps throwing stackoverflow exceptions. 2017-05-26 09:39:42 +01:00
Konstantinos Chalkias
9f2b44f8f7 Rename Timestamp to TimeWindow (#706)
Rename Timestamp to TimeWindow + refactoring
2017-05-25 13:18:49 +01:00
Ross Nicoll
c13a99a2f9 Replaces keys and parties in states with AbstractParty
Switch to using AbstractParty as the standard identifier for parties in
states, so that full parties can be used during construction of
transactions and anonymised parties when the transaction is being added
to the ledger.
2017-05-16 12:07:14 +01:00
Andras Slemmer
1ecce79913 Merge pull request #669 from corda/aslemmer-quasar-hook
Add quasar-hook agent for inspecting quasar instrumentation
2017-05-11 15:34:46 +01:00
Ross Nicoll
e4a0bc6e11 Move party classes into identity package
Move AbstractParty, AnonymousParty and Party into a new net.corda.core.identity package,
as they're not really cryptography tools, and in preparation for further code coming in
for identity.

Optimize imports on many files to clean up the resulting refactor.
2017-05-11 11:25:59 +01:00
Andras Slemmer
a7fbb860e7 Fix hook into InstrumentMethod 2017-05-11 11:22:41 +01:00
Andras Slemmer
5e103ac91a Address comments #669 2017-05-11 11:13:18 +01:00
Konstantinos Chalkias
5188e672eb Generic PublicKey.toStringShort() (#641)
Generic PublicKey.toStringShort() using the hash of the serialised form.
2017-05-09 14:47:58 +01:00
Ross Nicoll
25dbac0f07 Change party to hold an X.500 name
Change the legal name of parties to be an X500 name. This ensures that we aren't converting between
common names and X500 names in various places, eliminating substantial scope for error in the conversion
process. As a result, all node names must now be full X500 names, which has impact on most configurations.
2017-05-05 16:13:29 +01:00
Chris Rankin
e22ad19fcd Use assert methods from test framework. Don't use Java assert. (#625) 2017-05-03 17:32:30 +01:00
Chris Rankin
f715ab39a2 Integrate sandbox properly with top-level build, create fat jar and remove unused imports. (#575) 2017-04-24 20:30:21 +01:00
Ross Nicoll
684d1089f0 Introduce full legal names for test parties
Use full names for test parties, ahead of complete X.500 name support.
2017-04-24 15:18:21 +01:00
gary-rowe
108f171e03 Replace 'by' with 'using' to avoid overloading Kotlin keyword in contracts DSL. Deprecates 'by' with offered replacement. 2017-04-12 12:27:02 +02:00
kasiastreich
36d5d0d7b2 Refactor of CompositeKeys to implement PublicKey interface. (#433)
* Make CompositeKey implement PublicKey

The initial implementation of composite keys as their own distinct class separate from PublicKey
means that the keys cannot be used on standard classes such as Certificate. This work is a beginning
to modifying CompositeKey to being a PublicKey implementation, although significant further work
is required to integrate this properly with the standard Java APIs, especially around verifying
signatures using the new key type.

* First stage of making CompositeKey implement PublicKey interface. Revert to using PublicKey everywhere we expect a key.

* Move algorithm and format into companion object (#432)

Move algorithm and format into companion object so that they can be referenced from other
classes (i.e. the upcoming signature class).

* Add simple invariants to construction of CompositeKey.
Builder emits CompositeKeys in simplified normalised form. Forbid keys with single child node, force ordering on children and forbid duplicates on the same level. It's not full semantical normalisation.

* Make constructor of CompositeKey private, move NodeWeight inside the class.
Add utility function for Kryo deserialization to read list with length constraints.
2017-04-12 11:13:20 +01:00
Mike Hearn
4853e41a58 Minor: inspector fixes 2017-04-11 15:53:05 +02:00
Mike Hearn
c097229935 Minor: run code cleanup inspections 2017-04-11 15:53:05 +02:00
Rick Parker
8ef1d767c9 Consolidate maven repositories (#445)
* Consolidate repositories into root build.gradle
2017-03-28 17:17:40 +01:00
Mike Hearn
a394adbb44 Work around JaCoCo injecting fields/methods into classes when the tests are run from gradle 2017-03-14 14:41:50 +01:00
Mike Hearn
8e1a48d935 Add experimental class building class (the 'carpenter').
This is intended for use in the serialisation framework.
2017-03-14 14:41:50 +01:00
Rick Parker
c4c4c51d7d Kryo serialisation whitelisting and misc enhancements. (#267)
Kryo serialisation whitelisting and misc enhancements
2017-02-28 08:12:18 +00:00
Ross Nicoll
2f9af7d7dc Revert Party.Full in preference for a less invasive change 2017-02-02 13:47:32 +00:00
Ross Nicoll
1b86ddfd6e Replace Party with Party.Full
Replace Party with Party.Full as an interim step to introducing the Party.Anonymised class.

Signed-off-by: Ross Nicoll <ross.nicoll@r3.com>
2017-02-01 15:18:12 +00:00
Sofus Mortensen
8ac7d7c189 universal: pretty print, more JVM<3 type erasure fun 2017-01-11 23:44:11 +01:00
Sofus Mortensen
abb361f207 universal: pretty print, type erasure workaround 2017-01-11 22:51:00 +01:00
Sofus Mortensen
336ce362e8 universal: swaption 2017-01-11 21:26:32 +01:00
Sofus Mortensen
bfd7aa4fc2 universal: pretty print 2017-01-11 21:26:32 +01:00
Sofus Mortensen
306a3cdff7 universal: prettyPrint 2017-01-11 21:26:32 +01:00
Sofus Mortensen
4fdeee5bf8 universal: pretty print 2017-01-11 21:26:32 +01:00
Sofus Mortensen
02e0b2218c universal: wrong exception type 2017-01-11 21:26:32 +01:00
sofusmortensen
607fd67519 universal: added split command 2017-01-11 21:26:32 +01:00
sofusmortensen
66692542bd universal: completed example FX Fwd Time Option 2017-01-11 21:26:32 +01:00
sofusmortensen
f19df50351 universal: simplied Actions squashing condition and actors together (suggested by Simon Peyton-Jones) 2017-01-11 21:26:32 +01:00
sofusmortensen
edc30717bb universal: new example/unit test FX Fwd with Time Option
syntax enhancement with re-use of contracts.
2017-01-11 21:26:32 +01:00
Mike Hearn
119d00c384 Upgrade dependencies and centralise some more version numbers in the root gradle file 2017-01-04 15:44:56 +01:00
Mike Hearn
eec16a41cf Minor: fix some compiler warnings and update some universal contract DSL code to use may as an infix function 2016-12-20 15:18:25 +01:00
Matthew Nesbit
a976045675 Merge pull request #9 from corda/mnesbit-gradle-no-install-builds
Change gradle to not need an install step before build
2016-11-30 17:12:19 +00:00
Matthew Nesbit
e54a304e2e Depend upon an internal artifact, rather than a maven local published artifact when building the corda fatjar. 2016-11-30 16:16:51 +00:00
Matthew Nesbit
8f47d393ca Fix file cleanup of sandbox unit tests on Windows machines.
Use try with resources to close stream after file copy.
2016-11-30 16:13:40 +00:00
Mike Hearn
7aa20dfbe4 Move sandbox code into the experimental module to reflect its status 2016-11-29 10:59:13 +00:00
Mike Hearn
fe5df11b23 Tweak experimental README 2016-11-29 10:30:49 +00:00
Mike Hearn
6c8996fb5e Tech white paper: update example from Sofus 2016-11-28 14:22:11 +00:00
sofusmortensen
68d1f8868d rename transfer/give to obligation/owes 2016-11-26 18:08:01 +01:00
Andrius Dagys
64299591c3 Rename PublicKeyTree -> CompositeKey and unify terminology across documentation. 2016-11-21 14:47:19 +00:00
Mike Hearn
8a680b3726 Minor style tweaks to the universal contract. 2016-11-15 19:17:30 +01:00
Mike Hearn
d1b279c2b2 Remove experimental trade finance code: it's not maintained, hasn't been code reviewed and we don't wish to release it as open source. 2016-11-15 19:08:14 +01:00
Andrius Dagys
c33c55eb20 Replace PublicKey with PublicKeyTree in Party. A single entity can now be identified by more than one key. 2016-11-14 14:57:16 +00:00
Mike Hearn
d7defd3157 Minor tweaks to the experimental universal contract DSL 2016-11-14 12:47:49 +01:00
Andras Slemmer
ea6b1b8435 experimental: tests com.r3corda -> net.corda 2016-11-11 11:27:30 +00:00
Mike Hearn
ce99f354cb Rename com.r3corda -> net.corda 2016-11-10 17:14:24 +01:00
Clinton Alexander
7e198e7cf3 Renamed contracts project to finance to better reflect the purpose of the project. 2016-11-04 13:35:25 +00:00
sofusmortensen
c328655f68 Universal: completed Cap unit test, full life cycle 2016-09-19 00:06:42 +02:00
sofusmortensen
2299b3beae Universal: fixed syntax issue that should have resulted in compile error 2016-09-18 18:09:00 +02:00
sofusmortensen
9c5ef6cdfe Universal: more refactor + cap rollout unit test 2016-09-17 16:16:18 +02:00
sofusmortensen
789bb2bb9d Universal: removed some debug code 2016-09-12 16:51:39 +01:00
sofusmortensen
143c6d2d90 Universal: started IRS contract/test, added min/max 2016-09-12 16:41:19 +01:00
Andras Slemmer
836933d223 experimental: Fix compile errors 2016-09-12 14:34:11 +01:00
sofusmortensen
9f6415efab Universal: Post refactor, rollout unit test passing 2016-09-12 13:49:50 +01:00
sofusmortensen
b93aa71afa Universal: checkpoint before refactor 2016-09-12 13:49:50 +01:00
sofusmortensen
c7b164897b Universal: example parties renamed 2016-09-07 14:40:56 +02:00
sofusmortensen
1ceee48696 Universal: refactoring 2016-09-07 14:40:56 +02:00
Mike Hearn
99f8477bf1 Minor: move code from TransactionTools.kt into the respective classes, and add some @Throws annotations that were missing (matters for java users) 2016-09-06 15:06:28 +02:00
Mike Hearn
9d83a9b6d2 Minor: move transaction types out of the contracts package and into a new transactions package 2016-09-06 14:20:32 +02:00
sofusmortensen
fffc049e12 Universal: refactoring, reduction/evaluation with unit test first steps 2016-09-04 22:50:32 +02:00
Ross Nicoll
868b23a923 Move simulations to top level 2016-09-01 11:15:05 +01:00
Ross Nicoll
232db9a1fd Move test utilities into their own package
This moves a lot of the test support code into its own package which is only imported for tests,
so it's not shipped as a part of core Corda. The node currently depends on this support code to
compile, although future work could try to separate this out. This change highlights that parts
of production code is dependent on test elements (i.e. dummy keys), and makes it harder for
such accidental crosses to occur later.

An integration test category is also added as part of this work, to contribute towards COR-345.
2016-08-31 15:40:54 +01:00
sofusmortensen
2680687dcb Universal: Fixing and reduction 2016-08-29 22:29:24 +02:00
sofusmortensen
5daad3580c verify of conditions, timestamp working 2016-08-21 23:40:32 +02:00
sofusmortensen
d5172ea2d0 added timestamp check 2016-08-21 10:39:20 +02:00
Matthew Nesbit
696b9741dd Remove ClashingThreads exception by tightening up unique id on LinearState to be a secure random value, with constraints that it cannot be duplicated. Also, rename to linearId rather than the confusing thread.
Try providing a helper interface to encourage enforcing LinearState rules

Fixup after rebase

Change to using Clauses for verifying LinearState standard properties

Fix whitespace change

Tidy up ClauseVerifier after PR comments

Change from SecureHash to a TradeIdentifier class

Change TradeIdentifier to UniqueIdentifier
2016-08-19 11:52:16 +01:00
Ross Nicoll
8cfc88ed3a Remove unused timestamp from LCApplication 2016-08-12 15:51:04 +01:00
Ross Nicoll
a3d37a4d00 Require notary to be explicitely stated on each transaction 2016-08-12 15:51:04 +01:00
Ross Nicoll
17ae349f4d Remove support for timestamp commands 2016-08-12 13:51:34 +01:00
sofusmortensen
2f7e05ee00 simpler syntax for rollout recursion parameters 2016-08-09 22:46:20 +02:00
Mike Hearn
da63ad57a4 Minor: run intellij "code cleanup" on all but javascript files. 2016-08-08 18:05:02 +02:00
Mike Hearn
701fc853ad Refactor the core transaction types to improve clarity, simplify verification and prepare for sandboxing.
Changes include:
- LedgerTransaction is now much more central: it represents a fully resolved and looked-up tx, with the inputs available.
- TransactionGroup and TransactionForVerification are gone. There is a temporary TransactionForContract class for backwards
  compatibility but it will also be gone soon.
- ResolveTransactionsProtocol is simplified, and now commits a tx to the database as soon as it's determined to be valid.
- ServiceHub is now passed in more consistently to verification code, so we can use more services in future more easily e.g. a sandboxing service.
- A variety of APIs have been tweaked or documented better.
2016-08-04 13:05:50 +02:00
Mike Hearn
c2aee2d4e8 Minor: Replace MockServices with a new class that's in core instead of node, old class becomes MockServiceHubInternal. 2016-08-04 12:53:09 +02:00
Mike Hearn
301d787e45 Fix bugs in the trade finance contracts and tests, where txns weren't being properly verified and thus the lack of timestamping wasn't detected. 2016-08-04 12:52:37 +02:00
sofusmortensen
1e36691b55 experimental syntax for recursion 2016-08-04 12:40:27 +02:00
Clinton Alexander
7d39a101d4 Merged in COR-276 (pull request #239)
Added Jacoco code coverage to gradle.
2016-07-29 13:29:47 +01:00
Richard Green
87bc02d2a8 all tests now pass - but some are commented out 2016-07-28 16:00:19 +01:00
Richard Green
e3f36a4942 Modified tests for new DSL 2016-07-28 15:57:09 +01:00
Richard Green
92e05f07aa Initial checkin for Trade Finance work into experimental module 2016-07-28 15:48:40 +01:00
Richard Green
ac0d0ec0ec Initial checkin for Trade Finance work into experimental branch 2016-07-28 15:47:55 +01:00
Clinton Alexander
188fc29436 Cleaned up build.gradle files. 2016-07-28 09:17:49 +01:00
Ross Nicoll
ea051d57be Move clauses into main 2016-07-13 11:48:51 +01:00
Ross Nicoll
0d78df33f8 Add standard clauses 2016-07-12 11:31:23 +01:00
sofusmortensen
7284896375 RollOut/Continuation 2016-07-12 07:46:40 +02:00
sofusmortensen
84700ce1b9 Notes 2016-07-12 07:46:17 +02:00
sofusmortensen
07c1f8b86a Merge branch 'master' into sofus-generic-contract 2016-07-10 15:28:21 +02:00
sofusmortensen
f0fc8f414f cleanup, testing rollout syntax 2016-07-10 12:12:33 +02:00
Ross Nicoll
23c3112660 Merged in rnicoll-obligation-main (pull request #185)
Move Obligation contract into contracts module
2016-06-27 17:57:31 +01:00
Ross Nicoll
228513671d Move Obligation contract into contracts module 2016-06-27 17:54:04 +01:00
Ross Nicoll
9994d129f2 General cleanup based on first round of feedback
* Rename AggregateCommands to IssuanceCommands
 * Reorder comparisons to be consistent
 * Rename verifyDefaultCommand to verifySetLifecycleCommand
 * Rename currency to issued/product
 * Add note about needing to rethink timestamping
 * Rename issuer to obligor, and owner to beneficiary
 * Move lifecycle inversion code into SetLifecycle command
 * Correct comments regarding cash states
 * Rework description of contractHash parameter
 * Fixes 'netting equal balances due between parties', and add further netting tests
 * Separate calculations involving issued products and the underlying product
 * Use signed transactions in obligation tests
 * Add verification tests for changing lifecycle
2016-06-27 17:49:52 +01:00
Mike Hearn
848b998d26 Suppress compiler warnings in experimental. They are still expected to be fixed in the other modules. 2016-06-27 15:35:27 +02:00
sofusmortensen
f93b5c6502 moved contracts.universal to experimental 2016-06-27 00:30:45 +02:00
Andras Slemmer
040e51ec12 contracts, core: Expose top-level DSL values/functions to Java by wrapping them in an object
core: Add overloads for convenient Java interop

contracts, core: Uniform Java interop for tests, use camelCase
2016-06-24 16:37:43 +01:00
Ross Nicoll
388c26dd35 Add obligation contract
Add a new Obligation contract, modelling an obligation to send an amount
of something (currently limited to cash) by some future point. Obligation
contracts introduce the concept of one contract being aware of other
contracts, and common interfaces for state objects so other contracts can
interpret them meaningfully.
2016-06-23 14:45:45 +01:00
Mike Hearn
809d1c5dcd Add an experimental module. 2016-06-22 18:00:36 +02:00