Encumbrances implemented by reference to an index of an output state

This commit is contained in:
jamescarlyle
2016-08-18 19:41:17 +01:00
parent 43625308fa
commit ff1a1c4848
6 changed files with 172 additions and 3 deletions

View File

@ -120,6 +120,12 @@ public class JavaCommercialPaper implements Contract {
public List<PublicKey> getParticipants() {
return ImmutableList.of(this.owner);
}
@Nullable
@Override
public Integer getEncumbrance() {
return null;
}
}
public interface Clause {

View File

@ -74,12 +74,14 @@ class Cash : OnLedgerAsset<Currency, Cash.State>() {
class ConserveAmount : AbstractConserveAmount<State, Currency>()
}
/** A state representing a cash claim against some party */
/** A state representing a cash claim against some party. */
data class State(
override val amount: Amount<Issued<Currency>>,
/** There must be a MoveCommand signed by this key to claim the amount */
override val owner: PublicKey
/** There must be a MoveCommand signed by this key to claim the amount. */
override val owner: PublicKey,
/** Cash may be encumbered by an additional state. */
override val encumbrance: Int? = null
) : FungibleAsset<Currency> {
constructor(deposit: PartyAndReference, amount: Amount<Currency>, owner: PublicKey)
: this(Amount(amount.quantity, Issued(deposit, amount.token)), owner)