Skip to content

Instantly share code, notes, and snippets.

@lankydan
Created May 23, 2019 13:14
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/ad9f66a6198742dea9c73669b3cd2ff6 to your computer and use it in GitHub Desktop.
Save lankydan/ad9f66a6198742dea9c73669b3cd2ff6 to your computer and use it in GitHub Desktop.
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