Skip to content

Instantly share code, notes, and snippets.

@lankydan
Created May 23, 2019 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lankydan/10c8fde7c1dba47ce7d16605e5c7e798 to your computer and use it in GitHub Desktop.
Save lankydan/10c8fde7c1dba47ce7d16605e5c7e798 to your computer and use it in GitHub Desktop.
Corda customising transaction validation - Base responder
@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