CORDA-540: Correctly mark AttachmentConstraint to be CordaSerializable (#1496)

Or else many core/contract unit tests failing in AMQP mode
This commit is contained in:
Viktor Kolomeyko 2017-09-14 09:28:17 +01:00 committed by Rick Parker
parent 988e3e5007
commit abac314b31

View File

@ -3,13 +3,13 @@ package net.corda.core.contracts
import net.corda.core.serialization.CordaSerializable
/** Constrain which contract-code-containing attachments can be used with a [ContractState]. */
@CordaSerializable
interface AttachmentConstraint {
/** Returns whether the given contract attachments can be used with the [ContractState] associated with this constraint object. */
fun isSatisfiedBy(attachments: List<Attachment>): Boolean
}
/** An [AttachmentConstraint] where [isSatisfiedBy] always returns true. */
@CordaSerializable
object AlwaysAcceptAttachmentConstraint : AttachmentConstraint {
override fun isSatisfiedBy(attachments: List<Attachment>) = true
}