Mark ChildrensPaper as really incomplete more visibly.

This commit is contained in:
Mike Hearn 2015-11-06 19:00:44 +01:00
parent 0131c2cc1d
commit fa626fc5d7
2 changed files with 4 additions and 1 deletions

View File

@ -17,6 +17,8 @@ import java.time.Instant
* issue: need to find a cleaner way to allow this. Does the single-execution-per-transaction model make sense?
*/
// TODO: This is very incomplete! Do not attempt to find mistakes in it just yet.
val CP_PROGRAM_ID = SecureHash.sha256("childrens-paper")
data class ChildrensPaperState(
@ -53,6 +55,7 @@ object ChildrensPaper : Contract {
}
is CPCommands.RedeemCommand -> {
// TODO: Lots more needed here: the CP state must be destroyed by this transaction, command.signer is not really right etc
val received = outStates.sumCashBy(command.signer)
requireThat {
"the paper must have matured" by (input.maturityDate < time)

View File

@ -51,7 +51,7 @@ object Requirements {
if (!expr) throw IllegalArgumentException("Failed requirement: $this")
}
}
fun requireThat(body: Requirements.() -> Unit) {
inline fun requireThat(body: Requirements.() -> Unit) {
Requirements.body()
}