mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
Introducing InitiatingFlow annotation which has to be annotated by initiating flows.
This removes the need for the shareParentSessions parameter of FlowLogic.subFlow. It also has the flow's version number so FlowVersion is now no longer needed.
This commit is contained in:
@ -49,7 +49,7 @@ class BuyerFlow(val otherParty: Party,
|
||||
CommercialPaper.State::class.java)
|
||||
|
||||
// This invokes the trading flow and out pops our finished transaction.
|
||||
val tradeTX: SignedTransaction = subFlow(buyer, shareParentSessions = true)
|
||||
val tradeTX: SignedTransaction = subFlow(buyer)
|
||||
// TODO: This should be moved into the flow itself.
|
||||
serviceHub.recordTransactions(listOf(tradeTX))
|
||||
|
||||
|
@ -9,10 +9,10 @@ import net.corda.core.crypto.SecureHash
|
||||
import net.corda.core.crypto.generateKeyPair
|
||||
import net.corda.core.days
|
||||
import net.corda.core.flows.FlowLogic
|
||||
import net.corda.core.flows.InitiatingFlow
|
||||
import net.corda.core.node.NodeInfo
|
||||
import net.corda.core.seconds
|
||||
import net.corda.core.transactions.SignedTransaction
|
||||
import net.corda.core.utilities.DUMMY_BANK_C
|
||||
import net.corda.core.utilities.ProgressTracker
|
||||
import net.corda.flows.NotaryFlow
|
||||
import net.corda.flows.TwoPartyTradeFlow
|
||||
@ -21,6 +21,7 @@ import java.security.PublicKey
|
||||
import java.time.Instant
|
||||
import java.util.*
|
||||
|
||||
@InitiatingFlow
|
||||
class SellerFlow(val otherParty: Party,
|
||||
val amount: Amount<Currency>,
|
||||
override val progressTracker: ProgressTracker) : FlowLogic<SignedTransaction>() {
|
||||
@ -60,7 +61,7 @@ class SellerFlow(val otherParty: Party,
|
||||
amount,
|
||||
cpOwnerKey,
|
||||
progressTracker.getChildProgressTracker(TRADING)!!)
|
||||
return subFlow(seller, shareParentSessions = true)
|
||||
return subFlow(seller)
|
||||
}
|
||||
|
||||
@Suspendable
|
||||
|
Reference in New Issue
Block a user