Last active
October 11, 2020 19:58
-
-
Save entzik/db2375d3fa007cdefe88716f36fc0f01 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
choice AddVoter : ContractId Doodle | |
with | |
voter: Party | |
controller organizer | |
do | |
assertMsg "this doodle has been opened for voting, cannot add voters" (not open) | |
create this with voters = voter::voters | |
choice RemoveVoter : ContractId Doodle | |
with | |
voter: Party | |
controller organizer | |
do | |
assertMsg "this doodle has been opened for voting, cannot remove voters" (not open) | |
create this with voters = DA.List.delete voter voters | |
preconsuming choice IssueInvites : ContractId Doodle | |
controller organizer | |
do | |
assertMsg "this doodle has been opened for voting, cannot issue any more invites" (not open) | |
DA.Traversable.mapA (\voter -> create DoodleInvite with doodleName = this.name, organizer = this.organizer, voter = voter) voters | |
-- archive self | |
create this with open = True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment