Skip to content

Instantly share code, notes, and snippets.

@lankydan lankydan/Validate.kt
Created May 23, 2019

What would you like to do?
Corda customising transaction validation - sharing validation
private fun validate(transaction: BaseTransaction) {
requireThat {
val messages = transaction.outputsOfType<MessageState>()
"There must be only one output message" using (messages.size == 1)
val message = messages.single()
"Message must contain the secret passphrase" using (message.contents.contains("I love Corda"))
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.