corda / net.corda.core.contracts / AttachmentConstraint

AttachmentConstraint

@DoNotImplement interface AttachmentConstraint

Constrain which contract-code-containing attachment can be used with a Contract.

Functions

isSatisfiedBy

abstract fun isSatisfiedBy(attachment: Attachment): Boolean

Returns whether the given contract attachment can be used with the ContractState associated with this constraint object.

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.

Inheritors

AlwaysAcceptAttachmentConstraint

object AlwaysAcceptAttachmentConstraint : AttachmentConstraint

An AttachmentConstraint where isSatisfiedBy always returns true.

AutomaticHashConstraint

object AutomaticHashConstraint : AttachmentConstraint

AutomaticPlaceholderConstraint

object AutomaticPlaceholderConstraint : AttachmentConstraint

This AttachmentConstraint is a convenience class that acts as a placeholder and will be automatically resolved by the platform when set on an output state. It is the default constraint of all output states.

HashAttachmentConstraint

data class HashAttachmentConstraint : AttachmentConstraint

An AttachmentConstraint that verifies by hash. The state protected by this constraint can only be used in a transaction created with that version of the jar. And a receiving node will only accept it if a cordapp with that hash has (is) been deployed on the node.

SignatureAttachmentConstraint

data class SignatureAttachmentConstraint : AttachmentConstraint

An AttachmentConstraint that verifies that the attachment has signers that fulfil the provided PublicKey. See: Signature Constraints

WhitelistedByZoneAttachmentConstraint

object WhitelistedByZoneAttachmentConstraint : AttachmentConstraint

An AttachmentConstraint that verifies that the hash of the attachment is in the network parameters whitelist. See: net.corda.core.node.NetworkParameters.whitelistedContractImplementations It allows for centralized control over the cordapps that can be used.