CORDA-2388 Deprecate CommandWithParties.signingParties (#4520)

* Deprecate `CommandWithParties.signingParties` as it should not be used in contract verification code as it is non-deterministic.
* Remove the remaining usage in contract verification code - replaced by signers collection.
This commit is contained in:
szymonsztuka 2019-01-11 09:41:16 +00:00 committed by GitHub
parent 79601681da
commit 7bbe4668d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -237,6 +237,7 @@ interface MoveCommand : CommandData {
data class CommandWithParties<out T : CommandData>(
val signers: List<PublicKey>,
/** If any public keys were recognised, the looked up institutions are available here */
@Deprecated("Should not be used in contract verification code as it is non-deterministic, will be disabled for some future target platform version onwards and will take effect only for CorDapps targeting those versions.")
val signingParties: List<Party>,
val value: T
)

View File

@ -315,7 +315,7 @@ class Obligation<P : Any> : Contract {
val outputAmount = outputs.sumObligations<P>()
val issueCommands = tx.commands.select<Commands.Issue>()
requireThat {
"output states are issued by a command signer" using (issuer.party in issueCommand.signingParties)
"output states are issued by a command signer" using (issuer.party.owningKey in issueCommand.signers)
"output values sum to more than the inputs" using (outputAmount > inputAmount)
"there is only a single issue command" using (issueCommands.count() == 1)
}