From fec2134555a70557b3a1366ce1be14b7b87a1f40 Mon Sep 17 00:00:00 2001 From: jamescarlyle Date: Fri, 19 Aug 2016 12:42:09 +0100 Subject: [PATCH] Updated comment on why the encumbrance is an index (Integer). --- .../com/r3corda/core/contracts/Structures.kt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/src/main/kotlin/com/r3corda/core/contracts/Structures.kt b/core/src/main/kotlin/com/r3corda/core/contracts/Structures.kt index fcbc5ebac1..0a5e079fe5 100644 --- a/core/src/main/kotlin/com/r3corda/core/contracts/Structures.kt +++ b/core/src/main/kotlin/com/r3corda/core/contracts/Structures.kt @@ -112,8 +112,18 @@ interface ContractState { */ val participants: List - /** The encumbrance state, if present, forces additional controls over this state, since the encumbrance state contract - * will also be verified. + /** + * All contract states may be _encumbered_ by up to one other state. + * + * The encumbrance state, if present, forces additional controls over this state, since the encumbrance state contract + * will also be verified during the execution of the transaction. For example, a contract state could be encumbered + * with a time-lock contract state; the state is then only processable in a transaction that verifies that the time + * specified in the encumbrance time-lock has passed. + * + * The encumbered state refers to another by index, and the referred encumbrance state + * is an output state in a particular position on the same transaction that created the encumbered state. An alternative + * would be encumber by reference to a StateRef., which would allow the specification of encumbrance by a state created + * in a prior transaction. */ val encumbrance: Int? get() = null }