diff --git a/finance/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt b/finance/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt index 9a8150ef0f..a1a296eb05 100644 --- a/finance/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt +++ b/finance/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt @@ -12,7 +12,6 @@ import net.corda.core.utilities.seconds import net.corda.finance.DOLLARS import net.corda.finance.`issued by` import net.corda.finance.contracts.asset.* -import net.corda.finance.contracts.asset.Cash.Companion.generateSpend import net.corda.testing.* import net.corda.testing.contracts.fillWithSomeTestCash import net.corda.testing.node.MockServices @@ -270,7 +269,7 @@ class CommercialPaperTestsGeneric { // Alice pays $9000 to BigCorp to own some of their debt. moveTX = run { val builder = TransactionBuilder(DUMMY_NOTARY) - generateSpend(aliceServices, builder, 9000.DOLLARS, AnonymousParty(bigCorpServices.key.public), ourIdentity, emptySet()) + Cash.generateSpend(aliceServices, builder, 9000.DOLLARS, AnonymousParty(bigCorpServices.key.public)) CommercialPaper().generateMove(builder, issueTx.tx.outRef(0), AnonymousParty(aliceServices.key.public)) val ptx = aliceServices.signInitialTransaction(builder) val ptx2 = bigCorpServices.addSignature(ptx) diff --git a/finance/src/test/kotlin/net/corda/finance/contracts/asset/CashTests.kt b/finance/src/test/kotlin/net/corda/finance/contracts/asset/CashTests.kt index e888d0705b..952aa3d9df 100644 --- a/finance/src/test/kotlin/net/corda/finance/contracts/asset/CashTests.kt +++ b/finance/src/test/kotlin/net/corda/finance/contracts/asset/CashTests.kt @@ -12,7 +12,6 @@ import net.corda.core.transactions.TransactionBuilder import net.corda.core.transactions.WireTransaction import net.corda.core.utilities.OpaqueBytes import net.corda.finance.* -import net.corda.finance.contracts.asset.Cash.Companion.generateSpend import net.corda.finance.utils.sumCash import net.corda.finance.utils.sumCashBy import net.corda.finance.utils.sumCashOrNull @@ -506,7 +505,7 @@ class CashTests : TestDependencyInjectionBase() { private fun makeSpend(amount: Amount, dest: AbstractParty): WireTransaction { val tx = TransactionBuilder(DUMMY_NOTARY) database.transaction { - generateSpend(miniCorpServices, tx, amount, dest, ourIdentity, emptySet()) + Cash.generateSpend(miniCorpServices, tx, amount, dest) } return tx.toWireTransaction(miniCorpServices) } @@ -608,7 +607,7 @@ class CashTests : TestDependencyInjectionBase() { database.transaction { val tx = TransactionBuilder(DUMMY_NOTARY) - generateSpend(miniCorpServices, tx, 80.DOLLARS, ALICE, ourIdentity, setOf(MINI_CORP)) + Cash.generateSpend(miniCorpServices, tx, 80.DOLLARS, ALICE, setOf(MINI_CORP)) assertEquals(vaultStatesUnconsumed.elementAt(2).ref, tx.inputStates()[0]) } @@ -827,7 +826,7 @@ class CashTests : TestDependencyInjectionBase() { PartyAndAmount(THEIR_IDENTITY_1, 400.DOLLARS), PartyAndAmount(THEIR_IDENTITY_2, 150.DOLLARS) ) - generateSpend(miniCorpServices, tx, amount, to, ourIdentity, emptySet()) + Cash.generateSpend(miniCorpServices, tx, payments) } val wtx = tx.toWireTransaction(miniCorpServices) fun out(i: Int) = wtx.getOutput(i) as Cash.State diff --git a/node/src/test/kotlin/net/corda/node/services/vault/NodeVaultServiceTest.kt b/node/src/test/kotlin/net/corda/node/services/vault/NodeVaultServiceTest.kt index 9d385d9663..5250e7f500 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/NodeVaultServiceTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/NodeVaultServiceTest.kt @@ -20,7 +20,6 @@ import net.corda.core.utilities.OpaqueBytes import net.corda.core.utilities.toNonEmptySet import net.corda.finance.* import net.corda.finance.contracts.asset.Cash -import net.corda.finance.contracts.asset.Cash.Companion.generateSpend import net.corda.finance.contracts.asset.DUMMY_CASH_ISSUER import net.corda.finance.contracts.asset.DUMMY_CASH_ISSUER_KEY import net.corda.finance.contracts.getCashBalance @@ -516,7 +515,7 @@ class NodeVaultServiceTest : TestDependencyInjectionBase() { database.transaction { val moveTx = TransactionBuilder(services.myInfo.chooseIdentity()).apply { - generateSpend(services, this, Amount(1000, GBP), thirdPartyIdentity, ourIdentity, emptySet()) + Cash.generateSpend(services, this, Amount(1000, GBP), thirdPartyIdentity) }.toWireTransaction(services) service.notify(moveTx) } @@ -561,7 +560,7 @@ class NodeVaultServiceTest : TestDependencyInjectionBase() { // Move cash val moveTx = database.transaction { TransactionBuilder(newNotary).apply { - generateSpend(services, this, Amount(1000, GBP), thirdPartyIdentity, ourIdentity, emptySet()) + Cash.generateSpend(services, this, Amount(1000, GBP), thirdPartyIdentity) }.toWireTransaction(services) } diff --git a/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt b/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt index aacc46ce2b..60e853d023 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt @@ -12,7 +12,6 @@ import net.corda.core.node.services.vault.QueryCriteria.VaultQueryCriteria import net.corda.core.transactions.TransactionBuilder import net.corda.finance.* import net.corda.finance.contracts.asset.Cash -import net.corda.finance.contracts.asset.Cash.Companion.generateSpend import net.corda.finance.contracts.asset.DUMMY_CASH_ISSUER import net.corda.finance.contracts.asset.DUMMY_CASH_ISSUER_KEY import net.corda.finance.contracts.getCashBalance @@ -100,7 +99,7 @@ class VaultWithCashTest : TestDependencyInjectionBase() { database.transaction { // A tx that spends our money. val spendTXBuilder = TransactionBuilder(DUMMY_NOTARY) - generateSpend(services, spendTXBuilder, 80.DOLLARS, BOB, ourIdentity, emptySet()) + Cash.generateSpend(services, spendTXBuilder, 80.DOLLARS, BOB) val spendPTX = services.signInitialTransaction(spendTXBuilder, freshKey) notaryServices.addSignature(spendPTX) } @@ -152,7 +151,7 @@ class VaultWithCashTest : TestDependencyInjectionBase() { database.transaction { try { val txn1Builder = TransactionBuilder(DUMMY_NOTARY) - generateSpend(services, txn1Builder, 60.DOLLARS, BOB, ourIdentity, emptySet()) + Cash.generateSpend(services, txn1Builder, 60.DOLLARS, BOB) val ptxn1 = notaryServices.signInitialTransaction(txn1Builder) val txn1 = services.addSignature(ptxn1, freshKey) println("txn1: ${txn1.id} spent ${((txn1.tx.outputs[0].data) as Cash.State).amount}") @@ -188,7 +187,7 @@ class VaultWithCashTest : TestDependencyInjectionBase() { database.transaction { try { val txn2Builder = TransactionBuilder(DUMMY_NOTARY) - generateSpend(services, txn2Builder, 80.DOLLARS, BOB, ourIdentity, emptySet()) + Cash.generateSpend(services, txn2Builder, 80.DOLLARS, BOB) val ptxn2 = notaryServices.signInitialTransaction(txn2Builder) val txn2 = services.addSignature(ptxn2, freshKey) println("txn2: ${txn2.id} spent ${((txn2.tx.outputs[0].data) as Cash.State).amount}") @@ -312,7 +311,7 @@ class VaultWithCashTest : TestDependencyInjectionBase() { database.transaction { // A tx that spends our money. val spendTXBuilder = TransactionBuilder(DUMMY_NOTARY) - generateSpend(services, spendTXBuilder, 80.DOLLARS, BOB, ourIdentity, emptySet()) + Cash.generateSpend(services, spendTXBuilder, 80.DOLLARS, BOB) val spendPTX = notaryServices.signInitialTransaction(spendTXBuilder) val spendTX = services.addSignature(spendPTX, freshKey) services.recordTransactions(spendTX)