corda / net.corda.core.contracts / AutomaticHashConstraint


object AutomaticHashConstraint : AttachmentConstraint

This AttachmentConstraint is a convenience class that will be automatically resolved to a HashAttachmentConstraint. The resolution occurs in TransactionBuilder.toWireTransaction and uses the TransactionState.contract value to find a corresponding loaded Cordapp that contains such a contract, and then uses that Cordapp as the Attachment.

If, for any reason, this class is not automatically resolved the default implementation is to fail, because the intent of this class is that it should be replaced by a correct HashAttachmentConstraint and verify against an actual Attachment.



fun isSatisfiedBy(attachment: Attachment): Boolean

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

Extension Functions


fun Any.contextLogger(): Logger

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