Commit Graph

16 Commits

Author SHA1 Message Date
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
d6cfa9b9ef Cash: refactor to allow multi-currency swaps by introducing a notion of grouping. 2015-11-20 18:19:24 +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
f0557e106d Minor: reorganise the test directory to match the src directory 2015-11-18 13:29:18 +01:00
Mike Hearn
fa1c6cb01b Minor: Rename args to commands for consistency 2015-11-17 13:08:18 +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
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
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
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
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
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
b8c7f949f4 Misc changes from Monday meeting. 2015-11-09 17:23:05 +00: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
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
847770ed2e Move Cash into new contracts subfolder, move base code into core 2015-11-06 14:56:00 +01:00