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

@ -144,9 +144,7 @@ class DistributedServiceTests : DriverBasedTest() {
}
private fun paySelf(amount: Amount<Currency>) {
val payHandle = aliceProxy.startFlow(
::CashPaymentFlow,
amount.issuedBy(alice.nodeInfo.legalIdentity.ref(0)), alice.nodeInfo.legalIdentity)
val payHandle = aliceProxy.startFlow(::CashPaymentFlow, amount, alice.nodeInfo.legalIdentity)
payHandle.returnValue.getOrThrow()
}
}

View File

@ -126,10 +126,7 @@ class CordaRPCOpsImplTest {
network.runNetwork()
rpc.startFlow(::CashPaymentFlow,
Amount(100, Issued(PartyAndReference(aliceNode.info.legalIdentity, OpaqueBytes(ByteArray(1, { 1 }))), USD)),
aliceNode.info.legalIdentity
)
rpc.startFlow(::CashPaymentFlow, Amount(100, USD), aliceNode.info.legalIdentity)
network.runNetwork()

View File

@ -6,7 +6,6 @@ import com.google.common.util.concurrent.ListenableFuture
import net.corda.core.*
import net.corda.core.contracts.DOLLARS
import net.corda.core.contracts.DummyState
import net.corda.core.contracts.issuedBy
import net.corda.core.crypto.Party
import net.corda.core.crypto.generateKeyPair
import net.corda.core.flows.FlowException
@ -326,9 +325,7 @@ class StateMachineManagerTests {
notary1.info.notaryIdentity))
// We pay a couple of times, the notary picking should go round robin
for (i in 1 .. 3) {
node1.services.startFlow(CashPaymentFlow(
500.DOLLARS.issuedBy(node1.info.legalIdentity.ref(0x01)),
node2.info.legalIdentity))
node1.services.startFlow(CashPaymentFlow(500.DOLLARS, node2.info.legalIdentity))
net.runNetwork()
}
val endpoint = net.messagingNetwork.endpoint(notary1.net.myAddress as InMemoryMessagingNetwork.PeerHandle)!!