diff --git a/contracts/src/main/java/com/r3corda/contracts/JavaCommercialPaper.java b/contracts/src/main/java/com/r3corda/contracts/JavaCommercialPaper.java index 5b37c86887..856fac0635 100644 --- a/contracts/src/main/java/com/r3corda/contracts/JavaCommercialPaper.java +++ b/contracts/src/main/java/com/r3corda/contracts/JavaCommercialPaper.java @@ -165,10 +165,10 @@ public class JavaCommercialPaper implements Contract { if (cmd.getValue() instanceof JavaCommercialPaper.Commands.Issue) { State output = single(outputs); if (!inputs.isEmpty()) { - throw new IllegalStateException("Failed Requirement: there is no input state"); + throw new IllegalStateException("Failed Requirement: output values sum to more than the inputs"); } if (output.faceValue.getQuantity() == 0) { - throw new IllegalStateException("Failed Requirement: the face value is not zero"); + throw new IllegalStateException("Failed Requirement: output values sum to more than the inputs"); } TimestampCommand timestampCommand = tx.getTimestampByName("Notary Service"); @@ -182,7 +182,7 @@ public class JavaCommercialPaper implements Contract { } if (!cmd.getSigners().contains(output.issuance.getParty().getOwningKey())) { - throw new IllegalStateException("Failed Requirement: the issuance is signed by the claimed issuer of the paper"); + throw new IllegalStateException("Failed Requirement: output states are issued by a command signer"); } } else { // Everything else (Move, Redeem) requires inputs (they are not first to be actioned) diff --git a/contracts/src/main/kotlin/com/r3corda/contracts/CommercialPaper.kt b/contracts/src/main/kotlin/com/r3corda/contracts/CommercialPaper.kt index 27d41a59df..0299d65075 100644 --- a/contracts/src/main/kotlin/com/r3corda/contracts/CommercialPaper.kt +++ b/contracts/src/main/kotlin/com/r3corda/contracts/CommercialPaper.kt @@ -115,13 +115,13 @@ class CommercialPaper : Contract { val time = timestamp?.before ?: throw IllegalArgumentException("Issuances must be timestamped") requireThat { // Don't allow people to issue commercial paper under other entities identities. - "the issuance is signed by the claimed issuer of the paper" by + "output states are issued by a command signer" by (output.issuance.party.owningKey in command.signers) - "the face value is not zero" by (output.faceValue.quantity > 0) + "output values sum to more than the inputs" by (output.faceValue.quantity > 0) "the maturity date is not in the past" by (time < output.maturityDate) // Don't allow an existing CP state to be replaced by this issuance. // TODO: Consider how to handle the case of mistaken issuances, or other need to patch. - "there is no input state" by inputs.isEmpty() + "output values sum to more than the inputs" by inputs.isEmpty() } } diff --git a/contracts/src/main/kotlin/com/r3corda/contracts/asset/FungibleAsset.kt b/contracts/src/main/kotlin/com/r3corda/contracts/asset/FungibleAsset.kt index 59ae41fdbc..60a2638789 100644 --- a/contracts/src/main/kotlin/com/r3corda/contracts/asset/FungibleAsset.kt +++ b/contracts/src/main/kotlin/com/r3corda/contracts/asset/FungibleAsset.kt @@ -116,7 +116,7 @@ abstract class FungibleAsset : Contract { val assetCommands = tx.commands.select() requireThat { "the issue command has a nonce" by (issueCommand.value.nonce != 0L) - "output deposits are owned by a command signer" by (issuer in issueCommand.signingParties) + "output states are issued by a command signer" by (issuer in issueCommand.signingParties) "output values sum to more than the inputs" by (outputAmount > inputAmount) "there is only a single issue command" by (assetCommands.count() == 1) } diff --git a/contracts/src/main/kotlin/com/r3corda/contracts/asset/Obligation.kt b/contracts/src/main/kotlin/com/r3corda/contracts/asset/Obligation.kt index 1aa3538461..6021c10e1f 100644 --- a/contracts/src/main/kotlin/com/r3corda/contracts/asset/Obligation.kt +++ b/contracts/src/main/kotlin/com/r3corda/contracts/asset/Obligation.kt @@ -422,7 +422,7 @@ class Obligation

: Contract { val outputAmount: Amount

= outputs.sumObligations

() requireThat { "the issue command has a nonce" by (issueCommand.value.nonce != 0L) - "output deposits are owned by a command signer" by (obligor in issueCommand.signingParties) + "output states are issued by a command signer" by (obligor in issueCommand.signingParties) "output values sum to more than the inputs" by (outputAmount > inputAmount) "valid settlement issuance definition is not this issuance definition" by inputs.none { it.issuanceDef in it.acceptableIssuanceDefinitions } } diff --git a/contracts/src/test/kotlin/com/r3corda/contracts/CommercialPaperTests.kt b/contracts/src/test/kotlin/com/r3corda/contracts/CommercialPaperTests.kt index 0f56e5f8d2..df4cb63a3f 100644 --- a/contracts/src/test/kotlin/com/r3corda/contracts/CommercialPaperTests.kt +++ b/contracts/src/test/kotlin/com/r3corda/contracts/CommercialPaperTests.kt @@ -135,7 +135,7 @@ class CommercialPaperTestsGeneric { output { thisTest.getPaper() } command(DUMMY_PUBKEY_1) { thisTest.getIssueCommand() } timestamp(TEST_TX_TIME) - this `fails with` "signed by the claimed issuer" + this `fails with` "output states are issued by a command signer" } } @@ -145,7 +145,7 @@ class CommercialPaperTestsGeneric { output { thisTest.getPaper().withFaceValue(0.DOLLARS `issued by` issuer) } command(MEGA_CORP_PUBKEY) { thisTest.getIssueCommand() } timestamp(TEST_TX_TIME) - this `fails with` "face value is not zero" + this `fails with` "output values sum to more than the inputs" } } @@ -166,7 +166,7 @@ class CommercialPaperTestsGeneric { output { thisTest.getPaper() } command(MEGA_CORP_PUBKEY) { thisTest.getIssueCommand() } timestamp(TEST_TX_TIME) - this `fails with` "there is no input state" + this `fails with` "output values sum to more than the inputs" } } diff --git a/contracts/src/test/kotlin/com/r3corda/contracts/asset/CashTests.kt b/contracts/src/test/kotlin/com/r3corda/contracts/asset/CashTests.kt index a4adf2afbb..07922b937a 100644 --- a/contracts/src/test/kotlin/com/r3corda/contracts/asset/CashTests.kt +++ b/contracts/src/test/kotlin/com/r3corda/contracts/asset/CashTests.kt @@ -78,7 +78,7 @@ class CashTests { transaction { output { outState } command(DUMMY_PUBKEY_1) { Cash.Commands.Issue() } - this `fails with` "output deposits are owned by a command signer" + this `fails with` "output states are issued by a command signer" } transaction { output { diff --git a/contracts/src/test/kotlin/com/r3corda/contracts/asset/ObligationTests.kt b/contracts/src/test/kotlin/com/r3corda/contracts/asset/ObligationTests.kt index 87c27ba13c..023f28c34b 100644 --- a/contracts/src/test/kotlin/com/r3corda/contracts/asset/ObligationTests.kt +++ b/contracts/src/test/kotlin/com/r3corda/contracts/asset/ObligationTests.kt @@ -96,7 +96,7 @@ class ObligationTests { transaction { output { outState } command(DUMMY_PUBKEY_1) { Obligation.Commands.Issue(outState.issuanceDef) } - this `fails with` "output deposits are owned by a command signer" + this `fails with` "output states are issued by a command signer" } transaction { output {