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
636279ced9
Minor: test dsl, rename recursive transaction method to 'tweak' to better describe what it does.
2015-11-18 13:45:04 +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
f0557e106d
Minor: reorganise the test directory to match the src directory
2015-11-18 13:29:18 +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
379d531cf0
Minor: fix failing test
2015-11-16 12:29:36 +01:00
Mike Hearn
2d58453225
Minor: add Dokka as an api doc generator tool. It's still kind of rough and needs a stylesheet to be supplied manually.
2015-11-16 12:16:37 +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
Mike Hearn
3041ca73f2
Simply TransactionForLedger.verify
2015-11-10 11:51:26 +00:00
Mike Hearn
ac9a371179
Platform: commands can now have multiple signatures per command (i.e. you only have one command of any type per transaction even if there are multiple authorisations).
2015-11-09 19:27:53 +00:00
Mike Hearn
0dc92822b5
Remove the todo list in Main.kt, it just changes too fast to be worth keeping it up to date. TODOs in the code itself remain.
2015-11-09 18:27:10 +00:00
Mike Hearn
12b7c7c184
Platform: fix the ability to summon cash in uncontrolled ways.
...
Introduce three ways to represent transactions: wire, ledger and for-verification.
TransactionForVerification contains the arguments formally passed to verify(). Making Contract.verify() take only a single object as the argument makes it easier to evolve the Contract binary interface without breaking backwards compatibility with existing contracts that are uploaded to the ledger. The Kotlin "with" construct can be used to bring the members into scope, thus acting syntactically like function arguments.
Make the contracts to be run depend on both input AND output states: this approach seems simpler than trying to have some notion of marking outputs that are checked. The TransactionForVerification class implements this simple logic (it's all moved into Transactions.kt).
2015-11-09 18:18:03 +00:00
Mike Hearn
4b9536af04
Add some TODOs
2015-11-09 17:32:16 +00:00
Mike Hearn
b8c7f949f4
Misc changes from Monday meeting.
2015-11-09 17:23:05 +00:00
Mike Hearn
8a2b8072e6
Contracts: include a string reference to the legal contract that the code is supposed to implement. Suggestion from Richard.
2015-11-08 13:38:51 +01:00
Mike Hearn
03aaf07f70
Cash: alter description of the state to talk about cash claims. Suggestion from Richard.
2015-11-08 13:34:52 +01:00
Mike Hearn
5022f11d9e
More moving around and renaming, to have a consistent style between contracts.
2015-11-08 13:34:24 +01:00
Mike Hearn
0856894047
README: Add a brief into to Kotlin syntax used so far.
2015-11-08 13:20:19 +01:00
Mike Hearn
83eb45732f
Some renaming and moving around (Children's Paper becomes Comedy Paper to make it clearer that it's sort of a joke implementation)
2015-11-08 12:30:02 +01:00
Mike Hearn
fa626fc5d7
Mark ChildrensPaper as really incomplete more visibly.
2015-11-06 19:00:44 +01:00
Mike Hearn
0131c2cc1d
CP: check in a "childrens paper" contract that is sort of like commercial paper, but not really. Tests are incomplete.
2015-11-06 17:55:20 +01:00
Mike Hearn
1298c4b8ed
Add a time parameter to the contract verify function.
2015-11-06 16:39:33 +01:00
Mike Hearn
163175860d
Improve the contracts DSL, make the Cash contract extend the DSL in a small way to make working with arrays of cash outputs easier.
2015-11-06 16:35:51 +01:00
Mike Hearn
f09c624c0f
Move DepositPointer into Structures
2015-11-06 14:57:16 +01:00
Mike Hearn
847770ed2e
Move Cash into new contracts subfolder, move base code into core
2015-11-06 14:56:00 +01:00
Mike Hearn
d7a5289c3d
Build/git stuff: minor tweaks
2015-11-06 13:56:04 +01:00
Mike Hearn
c0238b1f21
Cash: add a TODO comment
2015-11-06 13:01:22 +01:00