mirror of
https://github.com/corda/corda.git
synced 2025-01-29 15:43:55 +00:00
Mark ChildrensPaper as really incomplete more visibly.
This commit is contained in:
parent
0131c2cc1d
commit
fa626fc5d7
@ -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)
|
||||
|
@ -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()
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user