Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Corda customising transaction validation - Base Flow
@InitiatingFlow
open class SendMessageFlow(private val message: MessageState) :
FlowLogic<SignedTransaction>() {
open fun extraTransactionValidation(transaction: TransactionBuilder) {
// to be implemented by subtype flows - otherwise do nothing
}
@Suspendable
final override fun call(): SignedTransaction {
// build transaction
val tx = verifyAndSign(transaction)
// collect signatures
// save transaction
}
private fun verifyAndSign(transaction: TransactionBuilder): SignedTransaction {
extraTransactionValidation(transaction)
transaction.verify(serviceHub)
return serviceHub.signInitialTransaction(transaction)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.