Skip to content

Instantly share code, notes, and snippets.

@Tschakki
Created June 8, 2020 13:19
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 Tschakki/cff8389ac7466facc0632bb4ad26b374 to your computer and use it in GitHub Desktop.
Save Tschakki/cff8389ac7466facc0632bb4ad26b374 to your computer and use it in GitHub Desktop.
Decentralized Organization Chain - Add Poll tx snippet
if (recipient.asset.poll.votes) {
let votes = recipient.asset.poll.votes;
if (votes[vote]) {
++votes[vote];
recipient.asset.poll.votes = votes;
} else {
recipient.asset.poll.votes = { ...votes, [vote]: 1 };
}
} else {
recipient.asset.poll.votes = { [vote]: 1 };
}
store.account.set(recipient.address, recipient);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment