Created
March 2, 2019 11:13
-
-
Save lankydan/e84bbb807801ff7cbf39ac085e0d61d7 to your computer and use it in GitHub Desktop.
Extending and overriding Flows - Overriding a base Responder Flow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@InitiatedBy(SendMessageFlow::class) | |
class OverridingResponder(private val session: FlowSession) : | |
FlowLogic<Unit>() { | |
@Suspendable | |
override fun call() { | |
val stx = subFlow(object : SignTransactionFlow(session) { | |
override fun checkTransaction(stx: SignedTransaction) {} | |
}) | |
logger.info("Screw the original responder. I'll build my own responder... with blackjack and hookers!") | |
subFlow( | |
ReceiveFinalityFlow( | |
otherSideSession = session, | |
expectedTxId = stx.id | |
) | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment