S
- the type of contract state which is being issued.T
- the token underlying the issued state.public class AbstractIssue<S extends ContractState,C extends CommandData,T>
extends Clause
Standard issue clause for contracts that issue fungible assets.
Clause.Companion
Constructor and Description |
---|
AbstractIssue(kotlin.jvm.functions.Function1<? super java.util.List<? extends S>,net.corda.core.contracts.Amount> sum,
kotlin.jvm.functions.Function2<? super java.util.List<? extends S>,? super net.corda.core.contracts.Issued<? extends T>,net.corda.core.contracts.Amount> sumOrZero)
Standard issue clause for contracts that issue fungible assets.
|
Modifier and Type | Method and Description |
---|---|
kotlin.jvm.functions.Function1<java.util.List,net.corda.core.contracts.Amount> |
getSum() |
kotlin.jvm.functions.Function2<java.util.List,net.corda.core.contracts.Issued,net.corda.core.contracts.Amount> |
getSumOrZero() |
java.util.Set<C> |
verify(TransactionForContract 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 AbstractIssue(kotlin.jvm.functions.Function1<? super java.util.List<? extends S>,net.corda.core.contracts.Amount> sum, kotlin.jvm.functions.Function2<? super java.util.List<? extends S>,? super net.corda.core.contracts.Issued<? extends T>,net.corda.core.contracts.Amount> sumOrZero)
Standard issue clause for contracts that issue fungible assets.
sum
- function to convert a list of states into an amount of the token. Must error if there are no states in
the list.sumOrZero
- function to convert a list of states into an amount of the token, and returns zero if there are
no states in the list. Takes in an instance of the token definition for constructing the zero amount if needed.public java.util.Set<C> verify(TransactionForContract 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 TransactionForContract.InOutGroup
.public kotlin.jvm.functions.Function1<java.util.List,net.corda.core.contracts.Amount> getSum()
public kotlin.jvm.functions.Function2<java.util.List,net.corda.core.contracts.Issued,net.corda.core.contracts.Amount> getSumOrZero()