Remove the ability to exit cash not held by the cash issuer; this solves a number of problems:
* Ensuring owner of the cash is aware of the funds being destroyed
* Determining where to send any change resulting from partial exiting of funds
* Auditing the destruction of funds
Try providing a helper interface to encourage enforcing LinearState rules
Fixup after rebase
Change to using Clauses for verifying LinearState standard properties
Fix whitespace change
Tidy up ClauseVerifier after PR comments
Change from SecureHash to a TradeIdentifier class
Change TradeIdentifier to UniqueIdentifier
Change away from extending ClauseVerifier for contracts which support clauses, and explicitely call
clause verification code in the verify() function. This should make the flow of control easier to understand.
Changes include:
- LedgerTransaction is now much more central: it represents a fully resolved and looked-up tx, with the inputs available.
- TransactionGroup and TransactionForVerification are gone. There is a temporary TransactionForContract class for backwards
compatibility but it will also be gone soon.
- ResolveTransactionsProtocol is simplified, and now commits a tx to the database as soon as it's determined to be valid.
- ServiceHub is now passed in more consistently to verification code, so we can use more services in future more easily e.g. a sandboxing service.
- A variety of APIs have been tweaked or documented better.
This change reduces the testing confusion that can occur when cash is issued by one of the parties in a transaction rather than e.g. a neutral third party like a central bank.
* Merge common code between Cash and CommodityContract into OnLedgerAsset
* Move spend/exit tx generation logic into the clauses
* Add generateExit() function for Obligation
1. Function for converting raw entropy into an EDDSA key pair. This is useful for unit tests when you don't want a random key but would rather be able to identify it from the logs by eyesight, and will be useful later also when implementing deterministic key derivation.
2. Function that can format any collection of public keys using the bitcoin-style base58 form.
3. A dummy NullSignature object, again, useful for tests when you don't want to provide a real signature.
Then set a handful of dummy unit testing keys to predictable/fixed values.
The obligation `Settle` command takes in an amount to be settled, but only uses the underlying token from it.
This enforces that the settled amount matches the value seen moving.