Last active
October 31, 2020 22:04
-
-
Save entzik/9dc27260ffda26b0146a53bdb96932b6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
template DoodleInvite | |
with | |
doodleName: Text | |
organizer: Party | |
voter: Party | |
where | |
signatory organizer | |
observer voter | |
key (organizer, voter, doodleName) : (Party, Party, Text) | |
maintainer key._1 | |
nonconsuming choice Vote : ContractId Doodle | |
with | |
option: Text | |
controller voter | |
do | |
doodleContractId <- lookupByKey @Doodle (organizer, doodleName) | |
doodleContract <- fetch (fromSome doodleContractId) | |
assertMsg "this party does not own the doodle " (organizer == doodleContract.organizer) | |
exercise (fromSome doodleContractId) CastVote with voter = this.voter, option = option, inviteId = self |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment