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