From b76d0368437b0a7e180b443f6243f5bdd6fd446b Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Fri, 11 Aug 2017 17:02:39 +0100 Subject: [PATCH] Change CashIssueFlow to always issue to ourselves Change CashIssueFlow to always issue to ourselves, and require the cash is then moved in a separate payment operation. This more closely models actual operation inside banks, and is a step towards making all move-like operations go through a uniform verification process. --- .../corda/client/jfx/NodeMonitorModelTest.kt | 9 +---- .../client/rpc/CordaRPCJavaClientTest.java | 2 +- .../corda/client/rpc/CordaRPCClientTest.kt | 19 +++++---- .../rpc/StandaloneCordaRPCJavaClientTest.java | 2 +- .../kotlin/rpc/StandaloneCordaRPClientTest.kt | 16 +++----- .../core/flows/ContractUpgradeFlowTest.kt | 3 +- .../corda/docs/IntegrationTestingTutorial.kt | 39 ++++++++----------- .../net/corda/docs/ClientRpcTutorial.kt | 2 +- .../kotlin/net/corda/docs/CustomVaultQuery.kt | 3 +- .../net/corda/docs/CustomVaultQueryTest.kt | 5 +-- .../docs/FxTransactionBuildTutorialTest.kt | 10 +---- .../kotlin/net/corda/flows/CashFlowCommand.kt | 7 +++- .../kotlin/net/corda/flows/CashIssueFlow.kt | 36 ++++++----------- .../net/corda/flows/CashExitFlowTests.kt | 12 ++---- .../net/corda/flows/CashIssueFlowTests.kt | 14 +------ .../net/corda/flows/CashPaymentFlowTests.kt | 7 +--- .../net/corda/node/NodePerformanceTests.kt | 2 +- .../node/services/DistributedServiceTests.kt | 8 +--- .../net/corda/node/CordaRPCOpsImplTest.kt | 17 ++------ .../statemachine/FlowFrameworkTests.kt | 5 +-- .../corda/bank/BankOfCordaRPCClientTest.kt | 13 +++++-- .../net/corda/bank/BankOfCordaDriver.kt | 4 +- .../corda/bank/api/BankOfCordaClientApi.kt | 9 +++-- .../net/corda/bank/api/BankOfCordaWebApi.kt | 6 ++- .../net/corda/traderdemo/TraderDemoTest.kt | 5 ++- .../corda/traderdemo/TraderDemoClientApi.kt | 7 ++-- .../net/corda/explorer/ExplorerSimulation.kt | 3 +- .../views/cordapps/cash/NewTransaction.kt | 12 +++--- .../net/corda/verifier/VerifierTests.kt | 2 +- 29 files changed, 111 insertions(+), 168 deletions(-) diff --git a/client/jfx/src/integration-test/kotlin/net/corda/client/jfx/NodeMonitorModelTest.kt b/client/jfx/src/integration-test/kotlin/net/corda/client/jfx/NodeMonitorModelTest.kt index 3d98864cb4..dc44744c1e 100644 --- a/client/jfx/src/integration-test/kotlin/net/corda/client/jfx/NodeMonitorModelTest.kt +++ b/client/jfx/src/integration-test/kotlin/net/corda/client/jfx/NodeMonitorModelTest.kt @@ -108,14 +108,10 @@ class NodeMonitorModelTest : DriverBasedTest() { @Test fun `cash issue works end to end`() { - val anonymous = false rpc.startFlow(::CashIssueFlow, Amount(100, USD), - aliceNode.legalIdentity, - rpc.nodeIdentity().legalIdentity, OpaqueBytes(ByteArray(1, { 1 })), - notaryNode.notaryIdentity, - anonymous + notaryNode.notaryIdentity ) vaultUpdates.expectEvents(isStrict = false) { @@ -137,8 +133,7 @@ class NodeMonitorModelTest : DriverBasedTest() { @Test fun `cash issue and move`() { val anonymous = false - rpc.startFlow(::CashIssueFlow, 100.DOLLARS, aliceNode.legalIdentity, rpc.nodeIdentity().legalIdentity, OpaqueBytes.of(1), - notaryNode.notaryIdentity, anonymous).returnValue.getOrThrow() + rpc.startFlow(::CashIssueFlow, 100.DOLLARS, OpaqueBytes.of(1), notaryNode.notaryIdentity).returnValue.getOrThrow() rpc.startFlow(::CashPaymentFlow, 100.DOLLARS, bobNode.legalIdentity, anonymous).returnValue.getOrThrow() var issueSmId: StateMachineRunId? = null diff --git a/client/rpc/src/integration-test/java/net/corda/client/rpc/CordaRPCJavaClientTest.java b/client/rpc/src/integration-test/java/net/corda/client/rpc/CordaRPCJavaClientTest.java index d849f923b1..b1592f6c29 100644 --- a/client/rpc/src/integration-test/java/net/corda/client/rpc/CordaRPCJavaClientTest.java +++ b/client/rpc/src/integration-test/java/net/corda/client/rpc/CordaRPCJavaClientTest.java @@ -71,7 +71,7 @@ public class CordaRPCJavaClientTest extends NodeBasedTest { FlowHandle flowHandle = rpcProxy.startFlowDynamic(CashIssueFlow.class, DOLLARS(123), OpaqueBytes.of("1".getBytes()), - node.info.getLegalIdentity(), node.info.getLegalIdentity()); + node.info.getLegalIdentity()); System.out.println("Started issuing cash, waiting on result"); flowHandle.getReturnValue().get(); diff --git a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/CordaRPCClientTest.kt b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/CordaRPCClientTest.kt index 92febedcd0..e3632469a1 100644 --- a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/CordaRPCClientTest.kt +++ b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/CordaRPCClientTest.kt @@ -78,8 +78,7 @@ class CordaRPCClientTest : NodeBasedTest() { println("Creating proxy") println("Starting flow") val flowHandle = connection!!.proxy.startTrackedFlow(::CashIssueFlow, - 20.DOLLARS, node.info.legalIdentity, - node.info.legalIdentity, OpaqueBytes.of(0), node.info.legalIdentity, true + 20.DOLLARS, OpaqueBytes.of(0), node.info.legalIdentity ) println("Started flow, waiting on result") flowHandle.progress.subscribe { @@ -114,8 +113,7 @@ class CordaRPCClientTest : NodeBasedTest() { assertTrue(startCash.isEmpty(), "Should not start with any cash") val flowHandle = proxy.startFlow(::CashIssueFlow, - 123.DOLLARS, node.info.legalIdentity, - node.info.legalIdentity, OpaqueBytes.of(0), node.info.legalIdentity, true + 123.DOLLARS, OpaqueBytes.of(0), node.info.legalIdentity ) println("Started issuing cash, waiting on result") flowHandle.returnValue.get() @@ -141,15 +139,16 @@ class CordaRPCClientTest : NodeBasedTest() { } } val nodeIdentity = node.info.legalIdentity - node.services.startFlow(CashIssueFlow(2000.DOLLARS, nodeIdentity, nodeIdentity, OpaqueBytes.of(0), nodeIdentity, true), FlowInitiator.Shell).resultFuture.getOrThrow() + node.services.startFlow(CashIssueFlow(2000.DOLLARS, OpaqueBytes.of(0), nodeIdentity), FlowInitiator.Shell).resultFuture.getOrThrow() proxy.startFlow(::CashIssueFlow, - 123.DOLLARS, nodeIdentity, - nodeIdentity, OpaqueBytes.of(0), nodeIdentity, - true + 123.DOLLARS, + OpaqueBytes.of(0), + nodeIdentity ).returnValue.getOrThrow() proxy.startFlowDynamic(CashIssueFlow::class.java, - 1000.DOLLARS, OpaqueBytes.of(0), - nodeIdentity, nodeIdentity).returnValue.getOrThrow() + 1000.DOLLARS, + OpaqueBytes.of(0), + nodeIdentity).returnValue.getOrThrow() assertEquals(2, countRpcFlows) assertEquals(1, countShellFlows) } diff --git a/client/rpc/src/smoke-test/java/net/corda/java/rpc/StandaloneCordaRPCJavaClientTest.java b/client/rpc/src/smoke-test/java/net/corda/java/rpc/StandaloneCordaRPCJavaClientTest.java index 6c18e31053..38abeae9c7 100644 --- a/client/rpc/src/smoke-test/java/net/corda/java/rpc/StandaloneCordaRPCJavaClientTest.java +++ b/client/rpc/src/smoke-test/java/net/corda/java/rpc/StandaloneCordaRPCJavaClientTest.java @@ -75,7 +75,7 @@ public class StandaloneCordaRPCJavaClientTest { FlowHandle flowHandle = rpcProxy.startFlowDynamic(CashIssueFlow.class, dollars123, OpaqueBytes.of("1".getBytes()), - notaryNode.getLegalIdentity(), notaryNode.getLegalIdentity()); + notaryNode.getLegalIdentity()); System.out.println("Started issuing cash, waiting on result"); flowHandle.getReturnValue().get(); diff --git a/client/rpc/src/smoke-test/kotlin/net/corda/kotlin/rpc/StandaloneCordaRPClientTest.kt b/client/rpc/src/smoke-test/kotlin/net/corda/kotlin/rpc/StandaloneCordaRPClientTest.kt index 39295148e4..4a6a9dfdf4 100644 --- a/client/rpc/src/smoke-test/kotlin/net/corda/kotlin/rpc/StandaloneCordaRPClientTest.kt +++ b/client/rpc/src/smoke-test/kotlin/net/corda/kotlin/rpc/StandaloneCordaRPClientTest.kt @@ -3,7 +3,6 @@ package net.corda.kotlin.rpc import com.google.common.hash.Hashing import com.google.common.hash.HashingInputStream import net.corda.client.rpc.CordaRPCConnection -import net.corda.client.rpc.notUsed import net.corda.contracts.asset.Cash import net.corda.contracts.getCashBalance import net.corda.contracts.getCashBalances @@ -96,7 +95,7 @@ class StandaloneCordaRPClientTest { @Test fun `test starting flow`() { - rpcProxy.startFlow(::CashIssueFlow, 127.POUNDS, OpaqueBytes.of(0), notaryNode.legalIdentity, notaryNode.notaryIdentity) + rpcProxy.startFlow(::CashIssueFlow, 127.POUNDS, OpaqueBytes.of(0), notaryNode.notaryIdentity) .returnValue.getOrThrow(timeout) } @@ -104,7 +103,7 @@ class StandaloneCordaRPClientTest { fun `test starting tracked flow`() { var trackCount = 0 val handle = rpcProxy.startTrackedFlow( - ::CashIssueFlow, 429.DOLLARS, OpaqueBytes.of(0), notaryNode.legalIdentity, notaryNode.notaryIdentity + ::CashIssueFlow, 429.DOLLARS, OpaqueBytes.of(0), notaryNode.notaryIdentity ) handle.progress.subscribe { msg -> log.info("Flow>> $msg") @@ -133,7 +132,7 @@ class StandaloneCordaRPClientTest { } // Now issue some cash - rpcProxy.startFlow(::CashIssueFlow, 513.SWISS_FRANCS, OpaqueBytes.of(0), notaryNode.legalIdentity, notaryNode.notaryIdentity) + rpcProxy.startFlow(::CashIssueFlow, 513.SWISS_FRANCS, OpaqueBytes.of(0), notaryNode.notaryIdentity) .returnValue.getOrThrow(timeout) assertEquals(1, updateCount.get()) } @@ -150,7 +149,7 @@ class StandaloneCordaRPClientTest { } // Now issue some cash - rpcProxy.startFlow(::CashIssueFlow, 629.POUNDS, OpaqueBytes.of(0), notaryNode.legalIdentity, notaryNode.notaryIdentity) + rpcProxy.startFlow(::CashIssueFlow, 629.POUNDS, OpaqueBytes.of(0), notaryNode.notaryIdentity) .returnValue.getOrThrow(timeout) assertNotEquals(0, updateCount.get()) @@ -164,7 +163,7 @@ class StandaloneCordaRPClientTest { @Test fun `test vault query by`() { // Now issue some cash - rpcProxy.startFlow(::CashIssueFlow, 629.POUNDS, OpaqueBytes.of(0), notaryNode.legalIdentity, notaryNode.notaryIdentity) + rpcProxy.startFlow(::CashIssueFlow, 629.POUNDS, OpaqueBytes.of(0), notaryNode.notaryIdentity) .returnValue.getOrThrow(timeout) val criteria = QueryCriteria.VaultQueryCriteria(status = Vault.StateStatus.ALL) @@ -192,10 +191,7 @@ class StandaloneCordaRPClientTest { val startCash = rpcProxy.getCashBalances() assertTrue(startCash.isEmpty(), "Should not start with any cash") - val flowHandle = rpcProxy.startFlow(::CashIssueFlow, - 629.DOLLARS, OpaqueBytes.of(0), - notaryNode.legalIdentity, notaryNode.legalIdentity - ) + val flowHandle = rpcProxy.startFlow(::CashIssueFlow, 629.DOLLARS, OpaqueBytes.of(0), notaryNode.legalIdentity) println("Started issuing cash, waiting on result") flowHandle.returnValue.get() 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 5925b6c35c..3d9b30e76d 100644 --- a/core/src/test/kotlin/net/corda/core/flows/ContractUpgradeFlowTest.kt +++ b/core/src/test/kotlin/net/corda/core/flows/ContractUpgradeFlowTest.kt @@ -175,8 +175,7 @@ class ContractUpgradeFlowTest { @Test fun `upgrade Cash to v2`() { // Create some cash. - val anonymous = false - val result = a.services.startFlow(CashIssueFlow(Amount(1000, USD), a.info.legalIdentity, a.info.legalIdentity, OpaqueBytes.of(1), notary, anonymous)).resultFuture + val result = a.services.startFlow(CashIssueFlow(Amount(1000, USD), OpaqueBytes.of(1), notary)).resultFuture mockNet.runNetwork() val stx = result.getOrThrow().stx val stateAndRef = stx.tx.outRef(0) diff --git a/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/IntegrationTestingTutorial.kt b/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/IntegrationTestingTutorial.kt index 6f7f39ceae..a999dcf1ff 100644 --- a/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/IntegrationTestingTutorial.kt +++ b/docs/source/example-code/src/integration-test/kotlin/net/corda/docs/IntegrationTestingTutorial.kt @@ -1,8 +1,6 @@ package net.corda.docs import net.corda.contracts.asset.Cash -import net.corda.core.concurrent.CordaFuture -import net.corda.finance.DOLLARS import net.corda.core.internal.concurrent.transpose import net.corda.core.messaging.startFlow import net.corda.core.messaging.vaultTrackBy @@ -10,6 +8,7 @@ import net.corda.core.node.services.ServiceInfo import net.corda.core.node.services.Vault import net.corda.core.utilities.OpaqueBytes import net.corda.core.utilities.getOrThrow +import net.corda.finance.DOLLARS import net.corda.flows.CashIssueFlow import net.corda.flows.CashPaymentFlow import net.corda.node.services.startFlowPermission @@ -17,13 +16,7 @@ import net.corda.node.services.transactions.ValidatingNotaryService import net.corda.nodeapi.User import net.corda.testing.* import net.corda.testing.driver.driver -import net.corda.testing.expect -import net.corda.testing.expectEvents -import net.corda.testing.parallel -import net.corda.testing.sequence import org.junit.Test -import java.util.* -import kotlin.concurrent.thread import kotlin.test.assertEquals class IntegrationTestingTutorial { @@ -32,7 +25,8 @@ class IntegrationTestingTutorial { // START 1 driver { val aliceUser = User("aliceUser", "testPassword1", permissions = setOf( - startFlowPermission() + startFlowPermission(), + startFlowPermission() )) val bobUser = User("bobUser", "testPassword2", permissions = setOf( startFlowPermission() @@ -62,20 +56,21 @@ class IntegrationTestingTutorial { // START 4 val issueRef = OpaqueBytes.of(0) - val futures = Stack>() (1..10).map { i -> - thread { - futures.push(aliceProxy.startFlow(::CashIssueFlow, - i.DOLLARS, - bob.nodeInfo.legalIdentity, - alice.nodeInfo.legalIdentity, - issueRef, - notary.nodeInfo.notaryIdentity, - true - ).returnValue) - } - }.forEach(Thread::join) // Ensure the stack of futures is populated. - futures.forEach { it.getOrThrow() } + aliceProxy.startFlow(::CashIssueFlow, + i.DOLLARS, + issueRef, + notary.nodeInfo.notaryIdentity + ).returnValue + }.transpose().getOrThrow() + // We wait for all of the issuances to run before we start making payments + (1..10).map { i -> + aliceProxy.startFlow(::CashPaymentFlow, + i.DOLLARS, + bob.nodeInfo.legalIdentity, + true + ).returnValue + }.transpose().getOrThrow() bobVaultUpdates.expectEvents { parallel( diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt index 4a795d38a3..4a1b9d7b6f 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/ClientRpcTutorial.kt @@ -128,7 +128,7 @@ fun generateTransactions(proxy: CordaRPCOps) { proxy.startFlow(::CashPaymentFlow, Amount(quantity, USD), me) } else { val quantity = Math.abs(random.nextLong() % 1000) - proxy.startFlow(::CashIssueFlow, Amount(quantity, USD), me, me, issueRef, notary, true) + proxy.startFlow(::CashIssueFlow, Amount(quantity, USD), issueRef, notary) ownedQuantity += quantity } } diff --git a/docs/source/example-code/src/main/kotlin/net/corda/docs/CustomVaultQuery.kt b/docs/source/example-code/src/main/kotlin/net/corda/docs/CustomVaultQuery.kt index 63b6e096e7..1f21300d4c 100644 --- a/docs/source/example-code/src/main/kotlin/net/corda/docs/CustomVaultQuery.kt +++ b/docs/source/example-code/src/main/kotlin/net/corda/docs/CustomVaultQuery.kt @@ -133,8 +133,7 @@ object TopupIssuerFlow { // invoke Cash subflow to issue Asset progressTracker.currentStep = ISSUING val issuer = serviceHub.myInfo.legalIdentity - val issueRecipient = serviceHub.myInfo.legalIdentity - val issueCashFlow = CashIssueFlow(amount, issueRecipient, issuer, issuerPartyRef, notaryParty, anonymous = false) + val issueCashFlow = CashIssueFlow(amount, issuerPartyRef, notaryParty) val issueTx = subFlow(issueCashFlow) // NOTE: issueCashFlow performs a Broadcast (which stores a local copy of the txn to the ledger) // short-circuit when issuing to self diff --git a/docs/source/example-code/src/test/kotlin/net/corda/docs/CustomVaultQueryTest.kt b/docs/source/example-code/src/test/kotlin/net/corda/docs/CustomVaultQueryTest.kt index 87a598eb03..e399763a1a 100644 --- a/docs/source/example-code/src/test/kotlin/net/corda/docs/CustomVaultQueryTest.kt +++ b/docs/source/example-code/src/test/kotlin/net/corda/docs/CustomVaultQueryTest.kt @@ -65,11 +65,8 @@ class CustomVaultQueryTest { private fun issueCashForCurrency(amountToIssue: Amount) { // Use NodeA as issuer and create some dollars val flowHandle1 = nodeA.services.startFlow(CashIssueFlow(amountToIssue, - nodeA.info.legalIdentity, - nodeA.info.legalIdentity, OpaqueBytes.of(0x01), - notaryNode.info.notaryIdentity, - anonymous = false)) + notaryNode.info.notaryIdentity)) // Wait for the flow to stop and print flowHandle1.resultFuture.getOrThrow() } diff --git a/docs/source/example-code/src/test/kotlin/net/corda/docs/FxTransactionBuildTutorialTest.kt b/docs/source/example-code/src/test/kotlin/net/corda/docs/FxTransactionBuildTutorialTest.kt index 7d0b631e10..0e52c47d25 100644 --- a/docs/source/example-code/src/test/kotlin/net/corda/docs/FxTransactionBuildTutorialTest.kt +++ b/docs/source/example-code/src/test/kotlin/net/corda/docs/FxTransactionBuildTutorialTest.kt @@ -45,22 +45,16 @@ class FxTransactionBuildTutorialTest { fun `Run ForeignExchangeFlow to completion`() { // Use NodeA as issuer and create some dollars val flowHandle1 = nodeA.services.startFlow(CashIssueFlow(DOLLARS(1000), - nodeA.info.legalIdentity, - nodeA.info.legalIdentity, OpaqueBytes.of(0x01), - notaryNode.info.notaryIdentity, - false)) + notaryNode.info.notaryIdentity)) // Wait for the flow to stop and print flowHandle1.resultFuture.getOrThrow() printBalances() // Using NodeB as Issuer create some pounds. val flowHandle2 = nodeB.services.startFlow(CashIssueFlow(POUNDS(1000), - nodeB.info.legalIdentity, - nodeB.info.legalIdentity, OpaqueBytes.of(0x01), - notaryNode.info.notaryIdentity, - false)) + notaryNode.info.notaryIdentity)) // Wait for flow to come to an end and print flowHandle2.resultFuture.getOrThrow() printBalances() diff --git a/finance/src/main/kotlin/net/corda/flows/CashFlowCommand.kt b/finance/src/main/kotlin/net/corda/flows/CashFlowCommand.kt index 7dec787ee6..005a232ec4 100644 --- a/finance/src/main/kotlin/net/corda/flows/CashFlowCommand.kt +++ b/finance/src/main/kotlin/net/corda/flows/CashFlowCommand.kt @@ -6,11 +6,13 @@ import net.corda.core.messaging.CordaRPCOps import net.corda.core.messaging.FlowHandle import net.corda.core.messaging.startFlow import net.corda.core.utilities.OpaqueBytes +import net.corda.core.utilities.getOrThrow import java.util.* /** * A command to initiate the cash flow with. */ +@Deprecated("Please use the flows directly, these will be removed in a later release") sealed class CashFlowCommand { abstract fun startFlow(proxy: CordaRPCOps): FlowHandle @@ -22,7 +24,10 @@ sealed class CashFlowCommand { val recipient: Party, val notary: Party, val anonymous: Boolean) : CashFlowCommand() { - override fun startFlow(proxy: CordaRPCOps) = proxy.startFlow(::CashIssueFlow, amount, recipient, proxy.nodeIdentity().legalIdentity, issueRef, notary, anonymous) + override fun startFlow(proxy: CordaRPCOps): FlowHandle { + proxy.startFlow(::CashIssueFlow, amount, issueRef, notary).returnValue.getOrThrow() + return proxy.startFlow(::CashPaymentFlow, amount, recipient, anonymous) + } } /** diff --git a/finance/src/main/kotlin/net/corda/flows/CashIssueFlow.kt b/finance/src/main/kotlin/net/corda/flows/CashIssueFlow.kt index 0fde7d8056..f8d955e7ee 100644 --- a/finance/src/main/kotlin/net/corda/flows/CashIssueFlow.kt +++ b/finance/src/main/kotlin/net/corda/flows/CashIssueFlow.kt @@ -15,51 +15,37 @@ import net.corda.core.utilities.ProgressTracker import java.util.* /** - * Initiates a flow that produces cash issuance transaction. + * Initiates a flow that self-issues cash (which should then be sent to recipient(s) using a payment transaction). + * + * We issue cash only to ourselves so that all KYC/AML checks on payments are enforced consistently, rather than risk + * checks for issuance and payments differing. Outside of test scenarios it would be extremely unusual to issue cash + * and immediately transfer it, so impact of this limitation is considered minimal. * * @param amount the amount of currency to issue. * @param issuerBankPartyRef a reference to put on the issued currency. - * @param issueTo the party who should own the currency after it is issued. * @param notary the notary to set on the output states. */ @StartableByRPC class CashIssueFlow(val amount: Amount, - val issueTo: Party, - val issuerBankParty - : Party, val issuerBankPartyRef: OpaqueBytes, val notary: Party, - val anonymous: Boolean, progressTracker: ProgressTracker) : AbstractCashFlow(progressTracker) { constructor(amount: Amount, issuerBankPartyRef: OpaqueBytes, - issuerBankParty: Party, - issueTo: Party, - notary: Party) : this(amount, issueTo, issuerBankParty, issuerBankPartyRef, notary, true, tracker()) - constructor(amount: Amount, - issueTo: Party, - issuerBankParty: Party, - issuerBankPartyRef: OpaqueBytes, - notary: Party, - anonymous: Boolean) : this(amount, issueTo, issuerBankParty, issuerBankPartyRef, notary, anonymous, tracker()) + notary: Party) : this(amount, issuerBankPartyRef, notary, tracker()) @Suspendable override fun call(): AbstractCashFlow.Result { - progressTracker.currentStep = GENERATING_ID - val txIdentities = if (anonymous) { - subFlow(TransactionKeyFlow(issueTo)) - } else { - emptyMap() - } - val anonymousRecipient = txIdentities[issueTo] ?: issueTo + val issuerCert = serviceHub.myInfo.legalIdentityAndCert + progressTracker.currentStep = GENERATING_TX val builder: TransactionBuilder = TransactionBuilder(notary) - val issuer = issuerBankParty.ref(issuerBankPartyRef) - val signers = Cash().generateIssue(builder, amount.issuedBy(issuer), anonymousRecipient, notary) + val issuer = issuerCert.party.ref(issuerBankPartyRef) + val signers = Cash().generateIssue(builder, amount.issuedBy(issuer), issuerCert.party, notary) progressTracker.currentStep = SIGNING_TX val tx = serviceHub.signInitialTransaction(builder, signers) progressTracker.currentStep = FINALISING_TX subFlow(FinalityFlow(tx)) - return Result(tx, anonymousRecipient) + return Result(tx, issuerCert.party) } } diff --git a/finance/src/test/kotlin/net/corda/flows/CashExitFlowTests.kt b/finance/src/test/kotlin/net/corda/flows/CashExitFlowTests.kt index 4a15e5a16d..e73838e14a 100644 --- a/finance/src/test/kotlin/net/corda/flows/CashExitFlowTests.kt +++ b/finance/src/test/kotlin/net/corda/flows/CashExitFlowTests.kt @@ -33,11 +33,7 @@ class CashExitFlowTests { bankOfCorda = bankOfCordaNode.info.legalIdentity mockNet.runNetwork() - val future = bankOfCordaNode.services.startFlow(CashIssueFlow(initialBalance, - bankOfCorda, - bankOfCorda, ref, - notary, - anonymous = true)).resultFuture + val future = bankOfCordaNode.services.startFlow(CashIssueFlow(initialBalance, ref, notary)).resultFuture mockNet.runNetwork() future.getOrThrow() } @@ -50,8 +46,7 @@ class CashExitFlowTests { @Test fun `exit some cash`() { val exitAmount = 500.DOLLARS - val future = bankOfCordaNode.services.startFlow(CashExitFlow(exitAmount, - ref)).resultFuture + val future = bankOfCordaNode.services.startFlow(CashExitFlow(exitAmount, ref)).resultFuture mockNet.runNetwork() val exitTx = future.getOrThrow().stx.tx val expected = (initialBalance - exitAmount).`issued by`(bankOfCorda.ref(ref)) @@ -64,8 +59,7 @@ class CashExitFlowTests { @Test fun `exit zero cash`() { val expected = 0.DOLLARS - val future = bankOfCordaNode.services.startFlow(CashExitFlow(expected, - ref)).resultFuture + val future = bankOfCordaNode.services.startFlow(CashExitFlow(expected, ref)).resultFuture mockNet.runNetwork() assertFailsWith { future.getOrThrow() diff --git a/finance/src/test/kotlin/net/corda/flows/CashIssueFlowTests.kt b/finance/src/test/kotlin/net/corda/flows/CashIssueFlowTests.kt index 8bc11139eb..268464ef93 100644 --- a/finance/src/test/kotlin/net/corda/flows/CashIssueFlowTests.kt +++ b/finance/src/test/kotlin/net/corda/flows/CashIssueFlowTests.kt @@ -42,12 +42,7 @@ class CashIssueFlowTests { fun `issue some cash`() { val expected = 500.DOLLARS val ref = OpaqueBytes.of(0x01) - val future = bankOfCordaNode.services.startFlow(CashIssueFlow(expected, - bankOfCorda, - bankOfCorda, - ref, - notary, - anonymous = true)).resultFuture + val future = bankOfCordaNode.services.startFlow(CashIssueFlow(expected, ref, notary)).resultFuture mockNet.runNetwork() val issueTx = future.getOrThrow().stx val output = issueTx.tx.outputsOfType().single() @@ -58,12 +53,7 @@ class CashIssueFlowTests { fun `issue zero cash`() { val expected = 0.DOLLARS val ref = OpaqueBytes.of(0x01) - val future = bankOfCordaNode.services.startFlow(CashIssueFlow(expected, - bankOfCorda, - bankOfCorda, - ref, - notary, - anonymous = true)).resultFuture + val future = bankOfCordaNode.services.startFlow(CashIssueFlow(expected, ref, notary)).resultFuture mockNet.runNetwork() assertFailsWith { future.getOrThrow() diff --git a/finance/src/test/kotlin/net/corda/flows/CashPaymentFlowTests.kt b/finance/src/test/kotlin/net/corda/flows/CashPaymentFlowTests.kt index 673b6940ac..35d184d766 100644 --- a/finance/src/test/kotlin/net/corda/flows/CashPaymentFlowTests.kt +++ b/finance/src/test/kotlin/net/corda/flows/CashPaymentFlowTests.kt @@ -37,12 +37,7 @@ class CashPaymentFlowTests { notary = notaryNode.info.notaryIdentity bankOfCorda = bankOfCordaNode.info.legalIdentity - val future = bankOfCordaNode.services.startFlow(CashIssueFlow(initialBalance, - bankOfCorda, - bankOfCorda, - ref, - notary, - true)).resultFuture + val future = bankOfCordaNode.services.startFlow(CashIssueFlow(initialBalance, ref, notary)).resultFuture mockNet.runNetwork() future.getOrThrow() } diff --git a/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt b/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt index c4b0d7473c..7ef947df42 100644 --- a/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt @@ -111,7 +111,7 @@ class NodePerformanceTests { a.rpcClientToNode().use("A", "A") { connection -> println("ISSUING") val doneFutures = (1..100).toList().parallelStream().map { - connection.proxy.startFlow(::CashIssueFlow, 1.DOLLARS, OpaqueBytes.of(0), a.nodeInfo.legalIdentity, a.nodeInfo.notaryIdentity).returnValue + connection.proxy.startFlow(::CashIssueFlow, 1.DOLLARS, OpaqueBytes.of(0), a.nodeInfo.notaryIdentity).returnValue }.toList() doneFutures.transpose().get() println("STARTING PAYMENT") diff --git a/node/src/integration-test/kotlin/net/corda/node/services/DistributedServiceTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/DistributedServiceTests.kt index 7c94d3b2ca..966c535dd6 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/DistributedServiceTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/DistributedServiceTests.kt @@ -134,14 +134,10 @@ class DistributedServiceTests : DriverBasedTest() { } private fun issueCash(amount: Amount) { - val issueHandle = aliceProxy.startFlow( - ::CashIssueFlow, - amount, OpaqueBytes.of(0), alice.nodeInfo.legalIdentity, raftNotaryIdentity) - issueHandle.returnValue.getOrThrow() + aliceProxy.startFlow(::CashIssueFlow, amount, OpaqueBytes.of(0), raftNotaryIdentity).returnValue.getOrThrow() } private fun paySelf(amount: Amount) { - val payHandle = aliceProxy.startFlow(::CashPaymentFlow, amount, alice.nodeInfo.legalIdentity) - payHandle.returnValue.getOrThrow() + aliceProxy.startFlow(::CashPaymentFlow, amount, alice.nodeInfo.legalIdentity).returnValue.getOrThrow() } } diff --git a/node/src/test/kotlin/net/corda/node/CordaRPCOpsImplTest.kt b/node/src/test/kotlin/net/corda/node/CordaRPCOpsImplTest.kt index 431365f7e2..3ac57f57b4 100644 --- a/node/src/test/kotlin/net/corda/node/CordaRPCOpsImplTest.kt +++ b/node/src/test/kotlin/net/corda/node/CordaRPCOpsImplTest.kt @@ -93,9 +93,8 @@ class CordaRPCOpsImplTest { } // Tell the monitoring service node to issue some cash - val anonymous = false val recipient = aliceNode.info.legalIdentity - val result = rpc.startFlow(::CashIssueFlow, Amount(quantity, GBP), recipient, rpc.nodeIdentity().legalIdentity, ref, notaryNode.info.notaryIdentity, anonymous) + val result = rpc.startFlow(::CashIssueFlow, Amount(quantity, GBP), ref, notaryNode.info.notaryIdentity) mockNet.runNetwork() var issueSmId: StateMachineRunId? = null @@ -133,11 +132,8 @@ class CordaRPCOpsImplTest { val anonymous = false val result = rpc.startFlow(::CashIssueFlow, 100.DOLLARS, - aliceNode.info.legalIdentity, - rpc.nodeIdentity().legalIdentity, OpaqueBytes(ByteArray(1, { 1 })), - notaryNode.info.notaryIdentity, - false + notaryNode.info.notaryIdentity ) mockNet.runNetwork() @@ -212,14 +208,7 @@ class CordaRPCOpsImplTest { fun `cash command by user not permissioned for cash`() { CURRENT_RPC_CONTEXT.set(RpcContext(User("user", "pwd", permissions = emptySet()))) assertThatExceptionOfType(PermissionException::class.java).isThrownBy { - rpc.startFlow(::CashIssueFlow, - Amount(100, USD), - aliceNode.info.legalIdentity, - rpc.nodeIdentity().legalIdentity, - OpaqueBytes(ByteArray(1, { 1 })), - notaryNode.info.notaryIdentity, - false - ) + rpc.startFlow(::CashIssueFlow, Amount(100, USD), OpaqueBytes(ByteArray(1, { 1 })), notaryNode.info.notaryIdentity) } } diff --git a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt index d905a603f7..2ebb201c7d 100644 --- a/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/statemachine/FlowFrameworkTests.kt @@ -330,11 +330,8 @@ class FlowFrameworkTests { assertEquals(notary1.info.notaryIdentity, notary2.info.notaryIdentity) node1.services.startFlow(CashIssueFlow( 2000.DOLLARS, - node1.info.legalIdentity, - node1.info.legalIdentity, OpaqueBytes.of(0x01), - notary1.info.notaryIdentity, - anonymous = false)) + notary1.info.notaryIdentity)) // We pay a couple of times, the notary picking should go round robin for (i in 1..3) { val flow = node1.services.startFlow(CashPaymentFlow(500.DOLLARS, node2.info.legalIdentity, anonymous = false)) diff --git a/samples/bank-of-corda-demo/src/integration-test/kotlin/net/corda/bank/BankOfCordaRPCClientTest.kt b/samples/bank-of-corda-demo/src/integration-test/kotlin/net/corda/bank/BankOfCordaRPCClientTest.kt index e804a51777..f5c9da331e 100644 --- a/samples/bank-of-corda-demo/src/integration-test/kotlin/net/corda/bank/BankOfCordaRPCClientTest.kt +++ b/samples/bank-of-corda-demo/src/integration-test/kotlin/net/corda/bank/BankOfCordaRPCClientTest.kt @@ -9,6 +9,7 @@ import net.corda.core.node.services.vault.QueryCriteria import net.corda.core.utilities.getOrThrow import net.corda.finance.DOLLARS import net.corda.flows.CashIssueFlow +import net.corda.flows.CashPaymentFlow import net.corda.node.services.startFlowPermission import net.corda.node.services.transactions.SimpleNotaryService import net.corda.nodeapi.User @@ -20,7 +21,9 @@ class BankOfCordaRPCClientTest { @Test fun `issuer flow via RPC`() { driver(dsl = { - val bocManager = User("bocManager", "password1", permissions = setOf(startFlowPermission())) + val bocManager = User("bocManager", "password1", permissions = setOf( + startFlowPermission(), + startFlowPermission())) val bigCorpCFO = User("bigCorpCFO", "password2", permissions = emptySet()) val (nodeBankOfCorda, nodeBigCorporation) = listOf( startNode(BOC.name, setOf(ServiceInfo(SimpleNotaryService.type)), listOf(bocManager)), @@ -47,10 +50,12 @@ class BankOfCordaRPCClientTest { bocProxy.startFlow( ::CashIssueFlow, 1000.DOLLARS, - nodeBigCorporation.nodeInfo.legalIdentity, - nodeBankOfCorda.nodeInfo.legalIdentity, BIG_CORP_PARTY_REF, - nodeBankOfCorda.nodeInfo.notaryIdentity, + nodeBankOfCorda.nodeInfo.notaryIdentity).returnValue.getOrThrow() + bocProxy.startFlow( + ::CashPaymentFlow, + 1000.DOLLARS, + nodeBigCorporation.nodeInfo.legalIdentity, anonymous).returnValue.getOrThrow() // Check Bank of Corda Vault Updates diff --git a/samples/bank-of-corda-demo/src/main/kotlin/net/corda/bank/BankOfCordaDriver.kt b/samples/bank-of-corda-demo/src/main/kotlin/net/corda/bank/BankOfCordaDriver.kt index 4390b85298..894e3dc954 100644 --- a/samples/bank-of-corda-demo/src/main/kotlin/net/corda/bank/BankOfCordaDriver.kt +++ b/samples/bank-of-corda-demo/src/main/kotlin/net/corda/bank/BankOfCordaDriver.kt @@ -70,7 +70,9 @@ private class BankOfCordaDriver { startFlowPermission(), startFlowPermission(), startFlowPermission())) - val bigCorpUser = User(BIGCORP_USERNAME, "test", permissions = setOf(startFlowPermission())) + val bigCorpUser = User(BIGCORP_USERNAME, "test", + permissions = setOf( + startFlowPermission())) startNode(DUMMY_NOTARY.name, setOf(ServiceInfo(SimpleNotaryService.type))) val bankOfCorda = startNode( BOC.name, diff --git a/samples/bank-of-corda-demo/src/main/kotlin/net/corda/bank/api/BankOfCordaClientApi.kt b/samples/bank-of-corda-demo/src/main/kotlin/net/corda/bank/api/BankOfCordaClientApi.kt index 944585d1bf..77e9d61cbd 100644 --- a/samples/bank-of-corda-demo/src/main/kotlin/net/corda/bank/api/BankOfCordaClientApi.kt +++ b/samples/bank-of-corda-demo/src/main/kotlin/net/corda/bank/api/BankOfCordaClientApi.kt @@ -9,6 +9,7 @@ import net.corda.core.utilities.NetworkHostAndPort import net.corda.core.utilities.OpaqueBytes import net.corda.core.utilities.getOrThrow import net.corda.flows.CashIssueFlow +import net.corda.flows.CashPaymentFlow import net.corda.testing.http.HttpApi import java.util.* @@ -28,6 +29,8 @@ class BankOfCordaClientApi(val hostAndPort: NetworkHostAndPort) { /** * RPC API + * + * @return a pair of the issuing and payment transactions. */ fun requestRPCIssue(params: IssueRequestParams): SignedTransaction { val client = CordaRPCClient(hostAndPort) @@ -38,8 +41,6 @@ class BankOfCordaClientApi(val hostAndPort: NetworkHostAndPort) { // Resolve parties via RPC val issueToParty = rpc.partyFromX500Name(params.issueToPartyName) ?: throw Exception("Unable to locate ${params.issueToPartyName} in Network Map Service") - val issuerBankParty = rpc.partyFromX500Name(params.issuerBankName) - ?: throw Exception("Unable to locate ${params.issuerBankName} in Network Map Service") val notaryLegalIdentity = rpc.partyFromX500Name(params.notaryName) ?: throw IllegalStateException("Unable to locate ${params.notaryName} in Network Map Service") val notaryNode = rpc.nodeIdentityFromParty(notaryLegalIdentity) @@ -48,7 +49,9 @@ class BankOfCordaClientApi(val hostAndPort: NetworkHostAndPort) { val amount = Amount(params.amount, Currency.getInstance(params.currency)) val issuerBankPartyRef = OpaqueBytes.of(params.issuerBankPartyRef.toByte()) - return rpc.startFlow(::CashIssueFlow, amount, issueToParty, issuerBankParty, issuerBankPartyRef, notaryNode.notaryIdentity, params.anonymous) + rpc.startFlow(::CashIssueFlow, amount, issuerBankPartyRef, notaryNode.notaryIdentity) + .returnValue.getOrThrow().stx + return rpc.startFlow(::CashPaymentFlow, amount, issueToParty, params.anonymous) .returnValue.getOrThrow().stx } } diff --git a/samples/bank-of-corda-demo/src/main/kotlin/net/corda/bank/api/BankOfCordaWebApi.kt b/samples/bank-of-corda-demo/src/main/kotlin/net/corda/bank/api/BankOfCordaWebApi.kt index b275d7717d..8ce2a36de9 100644 --- a/samples/bank-of-corda-demo/src/main/kotlin/net/corda/bank/api/BankOfCordaWebApi.kt +++ b/samples/bank-of-corda-demo/src/main/kotlin/net/corda/bank/api/BankOfCordaWebApi.kt @@ -7,6 +7,7 @@ import net.corda.core.utilities.OpaqueBytes import net.corda.core.utilities.getOrThrow import net.corda.core.utilities.loggerFor import net.corda.flows.CashIssueFlow +import net.corda.flows.CashPaymentFlow import org.bouncycastle.asn1.x500.X500Name import java.time.LocalDateTime import java.util.* @@ -53,12 +54,13 @@ class BankOfCordaWebApi(val rpc: CordaRPCOps) { val amount = Amount(params.amount, Currency.getInstance(params.currency)) val issuerBankPartyRef = OpaqueBytes.of(params.issuerBankPartyRef.toByte()) - val anonymous = params.anonymous // invoke client side of Issuer Flow: IssuanceRequester // The line below blocks and waits for the future to resolve. return try { - rpc.startFlow(::CashIssueFlow, amount, issueToParty, issuerBankParty, issuerBankPartyRef, notaryNode.notaryIdentity, anonymous).returnValue.getOrThrow() + rpc.startFlow(::CashIssueFlow, amount, issuerBankPartyRef, notaryNode.notaryIdentity).returnValue.getOrThrow() + rpc.startFlow(::CashPaymentFlow, amount, issueToParty, params.anonymous) + .returnValue.getOrThrow().stx logger.info("Issue request completed successfully: $params") Response.status(Response.Status.CREATED).build() } catch (e: Exception) { diff --git a/samples/trader-demo/src/integration-test/kotlin/net/corda/traderdemo/TraderDemoTest.kt b/samples/trader-demo/src/integration-test/kotlin/net/corda/traderdemo/TraderDemoTest.kt index af2a0b034c..03f5f65ac1 100644 --- a/samples/trader-demo/src/integration-test/kotlin/net/corda/traderdemo/TraderDemoTest.kt +++ b/samples/trader-demo/src/integration-test/kotlin/net/corda/traderdemo/TraderDemoTest.kt @@ -7,6 +7,7 @@ import net.corda.core.utilities.getOrThrow import net.corda.core.utilities.millis import net.corda.finance.DOLLARS import net.corda.flows.CashIssueFlow +import net.corda.flows.CashPaymentFlow import net.corda.node.services.startFlowPermission import net.corda.node.services.transactions.SimpleNotaryService import net.corda.nodeapi.User @@ -27,7 +28,9 @@ class TraderDemoTest : NodeBasedTest() { @Test fun `runs trader demo`() { val demoUser = User("demo", "demo", setOf(startFlowPermission())) - val bankUser = User("user1", "test", permissions = setOf(startFlowPermission(), + val bankUser = User("user1", "test", permissions = setOf( + startFlowPermission(), + startFlowPermission(), startFlowPermission())) val (nodeA, nodeB, bankNode) = listOf( startNode(DUMMY_BANK_A.name, rpcUsers = listOf(demoUser)), diff --git a/samples/trader-demo/src/main/kotlin/net/corda/traderdemo/TraderDemoClientApi.kt b/samples/trader-demo/src/main/kotlin/net/corda/traderdemo/TraderDemoClientApi.kt index 942832f930..ccc1c6188a 100644 --- a/samples/trader-demo/src/main/kotlin/net/corda/traderdemo/TraderDemoClientApi.kt +++ b/samples/trader-demo/src/main/kotlin/net/corda/traderdemo/TraderDemoClientApi.kt @@ -16,6 +16,7 @@ import net.corda.core.utilities.getOrThrow import net.corda.finance.DOLLARS import net.corda.finance.USD import net.corda.flows.CashIssueFlow +import net.corda.flows.CashPaymentFlow import net.corda.node.services.vault.VaultSchemaV1 import net.corda.testing.DUMMY_NOTARY import net.corda.testing.contracts.calculateRandomlySizedAmounts @@ -52,10 +53,10 @@ class TraderDemoClientApi(val rpc: CordaRPCOps) { ?: throw IllegalStateException("Unable to locate notary node in network map cache") val amounts = calculateRandomlySizedAmounts(amount, 3, 10, Random()) val anonymous = false - // issue random amounts of currency up to the requested amount, in parallel + rpc.startFlow(::CashIssueFlow, amount, OpaqueBytes.of(1), notaryNode.notaryIdentity).returnValue.getOrThrow() + // pay random amounts of currency up to the requested amount, in parallel val resultFutures = amounts.map { pennies -> - rpc.startFlow(::CashIssueFlow, amount.copy(quantity = pennies), buyer, rpc.nodeIdentity().legalIdentity, - OpaqueBytes.of(1), notaryNode.notaryIdentity, anonymous).returnValue + rpc.startFlow(::CashPaymentFlow, amount.copy(quantity = pennies), buyer, anonymous).returnValue } resultFutures.transpose().getOrThrow() diff --git a/tools/explorer/src/main/kotlin/net/corda/explorer/ExplorerSimulation.kt b/tools/explorer/src/main/kotlin/net/corda/explorer/ExplorerSimulation.kt index 54f19f966a..2d3644d636 100644 --- a/tools/explorer/src/main/kotlin/net/corda/explorer/ExplorerSimulation.kt +++ b/tools/explorer/src/main/kotlin/net/corda/explorer/ExplorerSimulation.kt @@ -38,8 +38,7 @@ class ExplorerSimulation(val options: OptionSet) { val manager = User("manager", "test", permissions = setOf( startFlowPermission(), startFlowPermission(), - startFlowPermission(), - startFlowPermission()) + startFlowPermission()) ) lateinit var notaryNode: NodeHandle diff --git a/tools/explorer/src/main/kotlin/net/corda/explorer/views/cordapps/cash/NewTransaction.kt b/tools/explorer/src/main/kotlin/net/corda/explorer/views/cordapps/cash/NewTransaction.kt index 4d16f3ad80..bb5a9fa07a 100644 --- a/tools/explorer/src/main/kotlin/net/corda/explorer/views/cordapps/cash/NewTransaction.kt +++ b/tools/explorer/src/main/kotlin/net/corda/explorer/views/cordapps/cash/NewTransaction.kt @@ -36,8 +36,9 @@ import net.corda.explorer.views.bigDecimalFormatter import net.corda.explorer.views.byteFormatter import net.corda.explorer.views.stringConverter import net.corda.flows.AbstractCashFlow +import net.corda.flows.CashIssueFlow +import net.corda.flows.CashPaymentFlow import net.corda.flows.CashFlowCommand -import net.corda.flows.IssuerFlow.IssuanceRequester import org.controlsfx.dialog.ExceptionDialog import tornadofx.* import java.math.BigDecimal @@ -94,12 +95,13 @@ class NewTransaction : Fragment() { show() } val handle: FlowHandle = if (command is CashFlowCommand.IssueCash) { - rpcProxy.value!!.startFlow(::IssuanceRequester, + rpcProxy.value!!.startFlow(::CashIssueFlow, + command.amount, + command.issueRef, + command.notary) + rpcProxy.value!!.startFlow(::CashPaymentFlow, command.amount, command.recipient, - command.issueRef, - myIdentity.value!!.legalIdentity, - command.notary, command.anonymous) } else { command.startFlow(rpcProxy.value!!) diff --git a/verifier/src/integration-test/kotlin/net/corda/verifier/VerifierTests.kt b/verifier/src/integration-test/kotlin/net/corda/verifier/VerifierTests.kt index 69e3f42738..b127d5bda1 100644 --- a/verifier/src/integration-test/kotlin/net/corda/verifier/VerifierTests.kt +++ b/verifier/src/integration-test/kotlin/net/corda/verifier/VerifierTests.kt @@ -118,7 +118,7 @@ class VerifierTests { val alice = aliceFuture.get() val notary = notaryFuture.get() startVerifier(notary) - alice.rpc.startFlow(::CashIssueFlow, 10.DOLLARS, OpaqueBytes.of(0), alice.nodeInfo.legalIdentity, notaryFuture.get().nodeInfo.notaryIdentity).returnValue.get() + alice.rpc.startFlow(::CashIssueFlow, 10.DOLLARS, OpaqueBytes.of(0), notaryFuture.get().nodeInfo.notaryIdentity).returnValue.get() notary.waitUntilNumberOfVerifiers(1) for (i in 1..10) { alice.rpc.startFlow(::CashPaymentFlow, 10.DOLLARS, alice.nodeInfo.legalIdentity).returnValue.get()