public class AbstractConserveAmount<S extends FungibleAsset<T>,C extends CommandData,T>
extends Clause
Standardised clause for checking input/output balances of fungible assets. Requires that a Move command is provided, and errors if absent. Must be the last clause under a grouping clause; errors on no-match, ends on match.
Clause.Companion
Modifier and Type | Field and Description |
---|---|
static net.corda.contracts.clause.AbstractConserveAmount.Companion |
Companion |
Constructor and Description |
---|
AbstractConserveAmount()
Standardised clause for checking input/output balances of fungible assets. Requires that a
Move command is provided, and errors if absent. Must be the last clause under a grouping clause;
errors on no-match, ends on match.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.security.PublicKey> |
generateExit(TransactionBuilder tx,
Amount<net.corda.core.contracts.Issued> amountIssued,
java.util.List<? extends net.corda.core.contracts.StateAndRef<? extends S>> assetStates,
kotlin.jvm.functions.Function3<? super net.corda.core.contracts.TransactionState<? extends S>,? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? super net.corda.core.identity.AbstractParty,? extends net.corda.core.contracts.TransactionState<? extends S>> deriveState,
kotlin.jvm.functions.Function0<? extends net.corda.core.contracts.CommandData> generateMoveCommand,
kotlin.jvm.functions.Function1<? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? extends net.corda.core.contracts.CommandData> generateExitCommand)
Deprecated.
|
java.lang.String |
toString() |
java.util.Set<C> |
verify(LedgerTransaction tx,
java.util.List<? extends S> inputs,
java.util.List<? extends S> outputs,
java.util.List<? extends net.corda.core.contracts.AuthenticatedObject<? extends C>> commands,
Issued<? extends T> groupingKey)
Verify the transaction matches the conditions from this clause. For example, a "no zero amount output" clause
would check each of the output states that it applies to, looking for a zero amount, and throw IllegalStateException
if any matched.
|
getExecutionPath, getRequiredCommands, verify
public static net.corda.contracts.clause.AbstractConserveAmount.Companion Companion
public AbstractConserveAmount()
Standardised clause for checking input/output balances of fungible assets. Requires that a Move command is provided, and errors if absent. Must be the last clause under a grouping clause; errors on no-match, ends on match.
public java.util.Set<java.security.PublicKey> generateExit(TransactionBuilder tx, Amount<net.corda.core.contracts.Issued> amountIssued, java.util.List<? extends net.corda.core.contracts.StateAndRef<? extends S>> assetStates, kotlin.jvm.functions.Function3<? super net.corda.core.contracts.TransactionState<? extends S>,? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? super net.corda.core.identity.AbstractParty,? extends net.corda.core.contracts.TransactionState<? extends S>> deriveState, kotlin.jvm.functions.Function0<? extends net.corda.core.contracts.CommandData> generateMoveCommand, kotlin.jvm.functions.Function1<? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? extends net.corda.core.contracts.CommandData> generateExitCommand)
Generate an transaction exiting fungible assets from the ledger.
tx
- transaction builder to add states and commands to.amountIssued
- the amount to be exited, represented as a quantity of issued currency.assetStates
- the asset states to take funds from. No checks are done about ownership of these states, it is
the responsibility of the caller to check that they do not attempt to exit funds held by others.public java.util.Set<C> verify(LedgerTransaction tx, java.util.List<? extends S> inputs, java.util.List<? extends S> outputs, java.util.List<? extends net.corda.core.contracts.AuthenticatedObject<? extends C>> commands, Issued<? extends T> groupingKey)
Verify the transaction matches the conditions from this clause. For example, a "no zero amount output" clause would check each of the output states that it applies to, looking for a zero amount, and throw IllegalStateException if any matched.
tx
- the full transaction being verified. This is provided for cases where clauses need to access
states or commands outside of their normal scope.inputs
- input states which are relevant to this clause. By default this is the set passed into verifyClause,
but may be further reduced by clauses such as GroupClauseVerifier.outputs
- output states which are relevant to this clause. By default this is the set passed into verifyClause,
but may be further reduced by clauses such as GroupClauseVerifier.commands
- commands which are relevant to this clause. By default this is the set passed into verifyClause,
but may be further reduced by clauses such as GroupClauseVerifier.groupingKey
- a grouping key applied to states and commands, where applicable. Taken from
class LedgerTransaction.InOutGroup
.public java.lang.String toString()