From e0a2c76f390b3c56018cb4ec6d9a7095d6f19c2a Mon Sep 17 00:00:00 2001 From: Matthew Nesbit Date: Wed, 29 Mar 2017 15:47:03 +0100 Subject: [PATCH] Remove unnecessary parameters to copy() Signed-off-by: Ross Nicoll --- .../test/kotlin/net/corda/core/flows/ContractUpgradeFlowTest.kt | 2 +- finance/src/main/kotlin/net/corda/contracts/asset/Cash.kt | 2 +- .../main/kotlin/net/corda/contracts/asset/CommodityContract.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/test/kotlin/net/corda/core/flows/ContractUpgradeFlowTest.kt b/core/src/test/kotlin/net/corda/core/flows/ContractUpgradeFlowTest.kt index 7529269fca..90b825c5c5 100644 --- a/core/src/test/kotlin/net/corda/core/flows/ContractUpgradeFlowTest.kt +++ b/core/src/test/kotlin/net/corda/core/flows/ContractUpgradeFlowTest.kt @@ -181,7 +181,7 @@ class ContractUpgradeFlowTest { override val contract = CashV2() override val participants = owners - override fun move(newAmount: Amount>, newOwner: CompositeKey) = copy(amount = amount.copy(newAmount.quantity, amount.token), owners = listOf(newOwner)) + override fun move(newAmount: Amount>, newOwner: CompositeKey) = copy(amount = amount.copy(newAmount.quantity), owners = listOf(newOwner)) override fun toString() = "${Emoji.bagOfCash}New Cash($amount at ${amount.token.issuer} owned by $owner)" override fun withNewOwner(newOwner: CompositeKey) = Pair(Cash.Commands.Move(), copy(owners = listOf(newOwner))) } diff --git a/finance/src/main/kotlin/net/corda/contracts/asset/Cash.kt b/finance/src/main/kotlin/net/corda/contracts/asset/Cash.kt index c522ce3dda..5485a7ab45 100644 --- a/finance/src/main/kotlin/net/corda/contracts/asset/Cash.kt +++ b/finance/src/main/kotlin/net/corda/contracts/asset/Cash.kt @@ -94,7 +94,7 @@ class Cash : OnLedgerAsset() { override val participants = listOf(owner) override fun move(newAmount: Amount>, newOwner: CompositeKey): FungibleAsset - = copy(amount = amount.copy(newAmount.quantity, amount.token), owner = newOwner) + = copy(amount = amount.copy(newAmount.quantity), owner = newOwner) override fun toString() = "${Emoji.bagOfCash}Cash($amount at ${amount.token.issuer} owned by $owner)" diff --git a/finance/src/main/kotlin/net/corda/contracts/asset/CommodityContract.kt b/finance/src/main/kotlin/net/corda/contracts/asset/CommodityContract.kt index 15f1273b2b..34d2e38e21 100644 --- a/finance/src/main/kotlin/net/corda/contracts/asset/CommodityContract.kt +++ b/finance/src/main/kotlin/net/corda/contracts/asset/CommodityContract.kt @@ -106,7 +106,7 @@ class CommodityContract : OnLedgerAsset>, newOwner: CompositeKey): FungibleAsset - = copy(amount = amount.copy(newAmount.quantity, amount.token), owner = newOwner) + = copy(amount = amount.copy(newAmount.quantity), owner = newOwner) override fun toString() = "Commodity($amount at ${amount.token.issuer} owned by $owner)"