Last active
April 3, 2020 16:54
-
-
Save lankydan/4f59817a23d0b077f1e6521d3ad7956b to your computer and use it in GitHub Desktop.
Verifying transactions with csv attachments - building a transaction
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 transaction(): TransactionBuilder = | |
TransactionBuilder(notary()).apply { | |
val attachmentId = attachment() | |
addOutputState(message) | |
addCommand(Command(Send(attachmentId), message.participants.map(Party::owningKey))) | |
addAttachment(attachmentId) | |
} | |
private fun attachment(): AttachmentId { | |
return serviceHub.attachments.queryAttachments( | |
AttachmentQueryCriteria.AttachmentsQueryCriteria( | |
filenameCondition = Builder.equal( | |
attachmentName | |
) | |
) | |
).first() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dan,
I think you forgot adding
attachmentName
as an input parameter in your function signature; it should be: