Commit Graph

3284 Commits

Author SHA1 Message Date
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
Mike Hearn
aeca56df72 Add a README 2015-11-05 16:32:55 +01:00
Mike Hearn
7e7d3ba3bf Move contracts DSL related stuff into a dedicated ContractsDSL.kt file, to emphasise that there is one :) 2015-11-04 15:47:42 +01:00
Mike Hearn
2455776b43 Cash contract: Implement example of spend crafting. 2015-11-04 15:14:56 +01:00
Mike Hearn
a09120d445 Cash contract: Introduce a DepositPointer abstraction for easier grouping
In this current model, you cannot mix up money from different deposits: they must always be kept separate.
2015-11-03 18:05:21 +01:00
Mike Hearn
fd67a85c29 TDD: Cash contract: Some basic tests of spend crafting. 2015-11-03 17:54:18 +01:00
Mike Hearn
e012d2c2f5 TestUtils: add some formatting toString methods to make test failures easier to read. 2015-11-03 17:54:18 +01:00
Mike Hearn
0c6c2df483 Cash contract: don't allow merging of two different origin deposits together. 2015-11-03 17:54:18 +01:00
Mike Hearn
8f46fb4406 Introduce OpaqueBytes, a simple wrapper around the JVM level byte[] which fixes hashCode and equals to use value-type identity rather than instance identity. Allows for more natural code. 2015-11-03 17:54:18 +01:00
Mike Hearn
12f5ddb0aa Cash contract: multi-issuer support
You can now take deposits from multiple different institutions and move/combine/split them appropriately. The issuers are kept separate, you cannot merge 3 different input states from 3 different institutions down to one, but you can merge/split within that specific issuer. Deposit refs are not currently being kept separate, but they should be also (this is coming next).
2015-11-03 17:54:18 +01:00
Mike Hearn
ce3d339c62 Give nicer backtraces in tests by just throwing AssertionError directly, document the test DSL 2015-11-03 17:54:18 +01:00
Mike Hearn
983003a562 Amount: split out of Structures.kt and into a separate file, add operator overloads. 2015-11-03 17:54:18 +01:00
Mike Hearn
c60db5544b Initial import 2015-11-03 17:54:17 +01:00