Commit Graph

130 Commits

Author SHA1 Message Date
Ross Nicoll
15bc48b49b Minor: Add note about refactoring TwoPartyTradeProtocol 2016-07-12 18:42:36 +01:00
Ross Nicoll
e09710e421 Update contract tutorial example to match JavaCommercialPaper 2016-07-12 14:48:50 +01:00
Ross Nicoll
52be94866a Use requireThat in JavaCommercialPaper
Replaces verification logic in JavaCommercialPaper, which previously manually
throw IllegalStateException, with calls to requireThat().
2016-07-12 14:24:50 +01:00
Ross Nicoll
79e3ce23f8 Tweak conditions on JavaCommercialPaper to match CommercialPaper 2016-07-12 14:24:50 +01:00
Ross Nicoll
0d78df33f8 Add standard clauses 2016-07-12 11:31:23 +01:00
Andras Slemmer
635da20fe2 contracts: Maybe we don't need a full stop there 2016-07-11 18:37:27 +01:00
Andras Slemmer
d7cc34c9a5 all: Full stops in comments! 2016-07-11 17:58:53 +01:00
Mike Hearn
e28ecae8c0 Address review comments 2016-07-11 18:47:24 +02:00
Mike Hearn
41d092a169 Minor: optimize imports 2016-07-11 18:15:28 +02:00
Mike Hearn
6b7580c977 Minor: fix compiler warnings. 2016-07-11 18:15:28 +02:00
Mike Hearn
cc22810b09 Testing cleanup:
- Move code out of ambiguously named TestUtils files (there were three). Sometimes it's simpler to just put these things into the contract source files directly.
- Remove JavaTestHelpers objects (there were three), in favour of just giving the top level kotlin file class better names.
- Misc other small tweaks and cleanups.
2016-07-11 16:22:02 +02:00
Ross Nicoll
6b775ebd4d Replace named timestamping authority with notary
As the timestamping authority is now always the notary service, contracts should
no longer be using name-based lookup of the timestamping authority (as this will
generally be wrong). This introduces a new "timestamp" property on a transaction,
and updates most contracts to refer to it.

In some cases (IRS, CommercialPaper) there are transactions with no input states
to derive notary from, that use timestamps. In these cases a notary is specified
in the command.
2016-07-11 14:54:36 +01:00
Andras Slemmer
4324e33fea testdsl: Removed R type parameter, unify verifies() interface 2016-07-11 14:25:27 +01:00
Andras Slemmer
fb55ceeb79 contracts: Remove Tmp* files 2016-07-11 14:25:27 +01:00
Andras Slemmer
9bb8439dc3 testdsl: Add failsWith to Ledger 2016-07-11 14:25:27 +01:00
Andras Slemmer
cd0299f650 testdsl: Javadoc comments 2016-07-11 14:25:27 +01:00
Andras Slemmer
3d885eb928 testdsl: Clean up TestUtils.kt 2016-07-11 14:25:27 +01:00
Ross Nicoll
0404ef4f62 Standardise error messages regarding state issuance
This makes the error messages when verifying state issuance consistent between
Cash, CommercialPaper and Obligation contracts, in preparation for introducing
a common issue clause between the contracts.
2016-07-11 11:32:36 +01:00
Ross Nicoll
7655356ec2 Minor: Remove unneeded backquotes 2016-07-11 11:32:34 +01:00
Ross Nicoll
ae1d3e96b1 Extend obligation tests to cover input lifecycle checks 2016-07-11 11:30:36 +01:00
Mike Hearn
bbc5c2e981 Merged in mike-july-dependency-upgrades (pull request #200)
Upgrade dependencies, July edition.
2016-07-06 16:25:52 +01:00
Mike Hearn
9e849378cf Minor: add some assertions in the WalletFiller code after a test was observed to fail due to a negative amount. 2016-07-06 14:02:40 +01:00
Mike Hearn
6fb7e59b91 Upgrade dependencies, July edition. 2016-07-06 13:56:22 +01:00
Andras Slemmer
0cf54d1c1f test dsl: Comment full stops 2016-07-06 13:25:08 +01:00
Andras Slemmer
f177b1ffaa test dsl: LastLineShouldTestForVerifiesOrFails->EnforceVerifyOrFail 2016-07-06 13:25:08 +01:00
Andras Slemmer
e31b769fef test dsl: Dsl->DSL, add top-level transaction primitive, add ledger-embedded signAll, other cosmetics 2016-07-06 13:25:08 +01:00
Andras Slemmer
e3d6f51049 contracts, core, node: Port TransactionForTest tests to new DSL 2016-07-06 13:25:08 +01:00
Andras Slemmer
bdda3d239a contracts: Port Java CashTests to new DSL 2016-07-06 13:25:08 +01:00
Andras Slemmer
7634331f68 contracts: Port CashTests to new dsl 2016-07-06 13:25:08 +01:00
Andras Slemmer
f4a6a43aa6 contracts, core: Port CommercialPaperTests, IRSTests, ObligationTests, TransactioGroupTests 2016-07-06 13:25:08 +01:00
Andras Slemmer
cde315aca9 contracts, node: Port CommercialPaperTests, TwoPartyTradeProtocolTests and GroupToGraphConversion to use new dsl 2016-07-06 13:25:08 +01:00
Shams Asari
5c0e7fbbf2 Moved topic parameter from send/receive methods to a ProtocolLogic property 2016-07-05 15:12:25 +01:00
Ross Nicoll
2121824662 Rename com.r3cord.contracts.cash package to ...asset 2016-06-30 13:31:59 +01:00
Ross Nicoll
6dad7efa22 Replace references to cash, with (fungible) asset 2016-06-30 12:47:18 +01:00
Shams Asari
a02263937c send and sendAndReceive use Party for the destination 2016-06-30 12:04:39 +01:00
rick.parker
5271882dcd Event scheduling and docs for event scheduling 2016-06-30 08:51:52 +01:00
Ross Nicoll
c767638127 Move DummyContract.State into its own file
DummyContract.State isn't actually used by the DummyContract any more, so shouldn't
be part of that contract class.
2016-06-29 17:16:46 +01:00
Ross Nicoll
dc304199c8 Remove warnings from Obligation contract 2016-06-29 13:27:00 +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
Andras Slemmer
bc326660a3 contracts, core: Fix static init cycle issue of JavaTestHelpers 2016-06-24 16:37:43 +01:00
Andras Slemmer
341adafd3a contracts, core: Rename Java to JavaTestHelpers 2016-06-24 16:37:43 +01: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
Andras Slemmer
28e85923a3 core: Add CashTestsJava.java, containing some of CashTests.kt in Java 2016-06-24 16:37:43 +01:00
Mike Hearn
2dfcff1f31 Testing: Fix the wallet filler code. 2016-06-24 17:13:27 +02:00
Andrius Dagys
aaeb99ac25 Validating notary: check for missing signatures. The notary can only sign if all other signatures are present
Please enter the commit message for your changes. Lines starting
2016-06-23 16:15:14 +01:00
Ross Nicoll
d24ec06b40 Add netting support structures
Add NetType enum for use in contracts which deal with netting
Add BilateralNettingState interface
Add support for more complex issued things
2016-06-22 14:30:06 +01:00
Mike Hearn
7ee6bd05ce Refactor the wallet code:
- Rename NodeWalletService to InMemoryWalletService and move into the core module where it's available for unit testing.
- Make a new NodeWalletService that just inherits from InMemoryWalletService and doesn't customise it at all, for now.
- Take the cash specific functionality out of Wallet and into an extension property in the Cash contract (this compiles as CashKt.getCashBalance(wallet) for java users).
- Return the generated states in the fillWalletWithTestCash function.
2016-06-22 14:49:52 +02:00
Mike Hearn
f3d4639059 Testing: make the WalletFiller code a file-level singleton and fillTestWithCash an extension method. For Java users not much changes, the class is still called WalletFiller and the signature remains the same. Re-order some arguments to make it easier to use when accepting the defaults. 2016-06-22 14:49:52 +02:00
Mike Hearn
cdb3e2f126 Minor: move WalletFiller from node.testing to contracts.testing 2016-06-22 14:49:52 +02:00