Commit Graph

77 Commits

Author SHA1 Message Date
Mike Hearn
f98ebce58b Update copyrights 2015-12-02 18:53:16 +00:00
Mike Hearn
a95cd056ea Implement a simple transaction graph visualiser tool. 2015-12-02 09:50:45 +00:00
Mike Hearn
1c1736ff9f Minor: SecureHash.toString + SecureHash.prefixChars methods 2015-12-01 13:36:58 +00:00
Mike Hearn
1f68727f31 Cash: add an onlyParties parameter to the spend crafting method. This allows you to restrict the wallet to only cash issued by particular parties. 2015-11-30 17:58:58 +00:00
Mike Hearn
50c3956988 Rename 'institution' to 'party'.
ADP-39 #resolve
2015-11-30 16:51:20 +00:00
Mike Hearn
52288bede1 Add copyright header (not open source for now) 2015-11-30 16:46:26 +00:00
Mike Hearn
9780f6254a Crowdfund contract: update to latest style for defining commands (singletons don't play nice with serialisation) 2015-11-30 16:39:03 +00:00
Mike Hearn
b3f7e307c7 Reformat the crowdfund contract 2015-11-30 16:36:12 +00:00
Mike Hearn
b8a50a65cf Merge branch 'finish-timestamping'
# Conflicts:
#	docs/build/html/searchindex.js
#	src/core/serialization/Kryo.kt
2015-11-30 16:35:10 +00:00
jamescarlyle
4e933f6d51 Added basic Crowdfunding contract. 2015-11-27 23:55:47 +00:00
Mike Hearn
42eed3e0a3 Flesh out timestamping logic and fix various serialisation related bugs that it exposes. Timestamps are optional, so update the CommercialPaper contract and tutorial to reflect that. 2015-11-27 18:33:17 +01:00
Mike Hearn
1628c1e17a Implement and test crafting/generate methods for CommercialPaper.
Rename test keys and use real EC keys instead of dummies.
2015-11-27 15:44:43 +01:00
Mike Hearn
d3c15ab7de Minor: tighten generic bound on StateAndRef 2015-11-27 15:44:06 +01:00
Mike Hearn
a98bc241ae Early start on support for timestamping (incomplete) and addition of a helper method on LedgerTransaction 2015-11-27 15:43:48 +01:00
Mike Hearn
60f29339ee Minor: add a convenience extension function to convert from byte arrays to SHA256 hashes. 2015-11-27 15:42:55 +01:00
Mike Hearn
19cd2069c7 Minor: clarify the distinction between sighash and txid hash. Fix Cash contract to not expect keys to be sortable. 2015-11-27 14:56:36 +01:00
Mike Hearn
de40a2082d Minor: introduce Institution.ref() to get an InstitutionReference 2015-11-27 14:49:08 +01:00
Mike Hearn
3172b0b86a Contracts: commercial paper issue command doesn't need a nonce, and fix a bug in the unit tests. 2015-11-25 18:14:33 +01:00
Mike Hearn
ff05cb4a4c Contract: rewrite and finish off tests for commercial paper, using improved test DSL 2015-11-25 17:40:27 +01:00
Mike Hearn
c026e90067 Contracts: JavaCommercialPaper should implement equals/hashCode on its version of the state class and use the same grouping logic as the Kotlin version. 2015-11-25 14:26:17 +01:00
Mike Hearn
5285d3bb47 Minor: define contracts as regular classes instead of using the kotlin singleton syntax 2015-11-24 15:22:19 +01:00
Mike Hearn
5c1e4a0e35 Minor: fix kdoc in Structures.kt, spotted by Richard 2015-11-23 11:53:31 +01:00
Richard G Brown
fa32935e77 legalContractRef changed String to SecureHash (of contract contents) 2015-11-23 10:59:28 +01:00
Mike Hearn
b0b8c74c25 Minor: move the groupBy method to TransactionForVerification where it belongs. 2015-11-20 19:36:20 +01:00
Mike Hearn
a8e34a2bb2 Contracts API: move the notion of grouping into a utility file, and modify the commercial paper contract (java+kotlin) to use it.
This resolves several open TODO list items around the composability of contracts.

The current CP tests pass, but they aren't complete, so this doesn't prove the changes are correct. That'll come soon.
2015-11-20 19:25:15 +01:00
Mike Hearn
d6cfa9b9ef Cash: refactor to allow multi-currency swaps by introducing a notion of grouping. 2015-11-20 18:19:24 +01:00
Mike Hearn
9681f97502 Minor: add a unit test to verify that duplicated inputs are forbidden (conflict) and delete the TODO for it. 2015-11-19 13:09:46 +01:00
Mike Hearn
7f13b8ab4a Minor: a few misc cleanups 2015-11-19 11:56:07 +01:00
Mike Hearn
a4aef06e41 Major: introduce TransactionGroup for verifying subgraphs. 2015-11-18 19:22:31 +01:00
Mike Hearn
03ddf454c7 Minor: make LedgerTransaction keep track of the hash of the original serialised tx 2015-11-18 13:35:24 +01:00
Mike Hearn
508ce2819f Minor: fix wording in Cash contract, suggestion from Richard. 2015-11-17 16:29:42 +01:00
Mike Hearn
fa1c6cb01b Minor: Rename args to commands for consistency 2015-11-17 13:08:18 +01:00
Mike Hearn
5e604a5b0a Minor: fix bug in JavaCommercialPaper 2015-11-16 21:01:38 +01:00
Mike Hearn
28bd2053cc Contracts: add an issue crafting function to the cash contract. 2015-11-16 20:50:31 +01:00
Mike Hearn
aecc1de0cf Contracts: make the Cash craftSpend/generate function update a mutable transaction instead of returning a unit test structure.
Tests: move TestUtils into the test package now the cash contract generate function works the right way.

Transactions: various refactorings to support partially signed transactions.
2015-11-16 20:36:27 +01:00
Mike Hearn
1f17053263 Introduce a PartialTransaction class to represent a mutable transaction that we're in the process of building/signing. 2015-11-16 20:08:45 +01:00
Mike Hearn
853b37a6e1 Cash: add a notion of state construction based on Richard's suggestion of a nonce+simply checking the output states are for deposits owned by the signer. No genesis tx is used. 2015-11-16 19:29:11 +01:00
Mike Hearn
5f30684805 Minor: add a kdoc to the select function. 2015-11-16 19:27:39 +01:00
Mike Hearn
0aa643d4c2 Minor: note to self, remember to check for duplicated inputs when converting LedgerTransaction into TransactionForVerification 2015-11-16 19:26:43 +01:00
Mike Hearn
2c27a07c8b Minor: OpaqueBytes should never be empty. May catch certain types of simple mistake. 2015-11-16 19:23:50 +01:00
Mike Hearn
6c66eee712 Kotlin Beta 2 2015-11-16 19:23:50 +01:00
Mike Hearn
e3e674658d Contracts: check in a demo of how to implement a simple contract in Java. 2015-11-16 13:30:53 +01:00
Mike Hearn
d1a605de6f Contracts: Rename ComedyPaper to CommercialPaper and rewrite the comment at the top to flag its not-realistic status. 2015-11-16 12:42:16 +01:00
Mike Hearn
dad59d116c Major: Integrate serialisation everywhere, implement basic signing/sig checking code.
Currently the serialised forms and the form fed into the contract aren't quite joined up, because on disk/network a transaction is serialised with input references i.e. (txhash, output index) pairs, but the contract wants to see all input states in fully loaded form. To do that, we need some notion of a database of transactions.
2015-11-13 23:12:39 +01:00
Mike Hearn
162b830bcd Add some serialization utilities and tests, using Kryo. 2015-11-13 20:38:29 +01:00
Mike Hearn
5b4969d366 Minor: make commands singletons when they contain no data and are purely type system markers.
This may not be really compatible with sandboxing, later on. But we can always change it back if not.
2015-11-13 14:43:59 +01:00
Mike Hearn
1b44081880 Minor: tweak the cash/amount API 2015-11-12 23:38:02 +01:00
Mike Hearn
32143160c2 Minor: reformat code a bit, introduce TimestampedWireTransaction as a wrapper, fix ContractStateRef to be the same as a Bitcoin COutPoint structure. 2015-11-12 23:18:15 +01:00
Mike Hearn
0b02f64f3d Contracts: a bit more work on the CP implementation, add a unit test for redemption at time. 2015-11-12 22:58:47 +01:00
Mike Hearn
a7bfff486a Misc comments 2015-11-11 14:20:24 +00:00