De-issuerify the cash payment flow. This makes it easier to use the payment flow from the shell.

This commit is contained in:
Mike Hearn
2017-03-15 18:12:28 +01:00
parent 4f6b44ceff
commit afbc8f9b5c
15 changed files with 43 additions and 72 deletions

View File

@ -4,13 +4,11 @@ import com.google.common.util.concurrent.Futures
import com.google.common.util.concurrent.ListenableFuture
import net.corda.contracts.asset.Cash
import net.corda.core.contracts.DOLLARS
import net.corda.core.contracts.issuedBy
import net.corda.core.getOrThrow
import net.corda.core.messaging.startFlow
import net.corda.core.node.services.ServiceInfo
import net.corda.core.node.services.Vault
import net.corda.core.serialization.OpaqueBytes
import net.corda.core.toFuture
import net.corda.flows.CashIssueFlow
import net.corda.flows.CashPaymentFlow
import net.corda.node.driver.driver
@ -92,10 +90,7 @@ class IntegrationTestingTutorial {
// START 5
for (i in 1 .. 10) {
bobProxy.startFlow(::CashPaymentFlow,
i.DOLLARS.issuedBy(alice.nodeInfo.legalIdentity.ref(issueRef)),
alice.nodeInfo.legalIdentity
).returnValue.getOrThrow()
bobProxy.startFlow(::CashPaymentFlow, i.DOLLARS, alice.nodeInfo.legalIdentity).returnValue.getOrThrow()
}
aliceVaultUpdates.expectEvents {

View File

@ -122,7 +122,7 @@ fun generateTransactions(proxy: CordaRPCOps) {
ownedQuantity -= quantity
} else if (ownedQuantity > 1000 && n < 0.7) {
val quantity = Math.abs(random.nextLong() % Math.min(ownedQuantity, 2000))
proxy.startFlow(::CashPaymentFlow, Amount(quantity, Issued(meAndRef, USD)), me)
proxy.startFlow(::CashPaymentFlow, Amount(quantity, USD), me)
} else {
val quantity = Math.abs(random.nextLong() % 1000)
proxy.startFlow(::CashIssueFlow, Amount(quantity, USD), issueRef, me, notary)