Created
May 23, 2019 13:12
-
-
Save lankydan/10c8fde7c1dba47ce7d16605e5c7e798 to your computer and use it in GitHub Desktop.
Corda customising transaction validation - Base responder
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) | |
open class SendMessageResponder(private val session: FlowSession) : FlowLogic<SignedTransaction>() { | |
open fun extraTransactionValidation(stx: SignedTransaction) { | |
// to be implemented by subtype flows - otherwise do nothing | |
} | |
@Suspendable | |
final override fun call(): SignedTransaction { | |
val stx = subFlow(object : SignTransactionFlow(session) { | |
override fun checkTransaction(stx: SignedTransaction) { | |
extraTransactionValidation(stx) | |
} | |
}) | |
// save transaction | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment