Last active
December 28, 2017 17:08
-
-
Save didil/1eb47dad048bfd0b6c88b418986eae51 to your computer and use it in GitHub Desktop.
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
$ truffle console --network=c | |
# company C votes, while making the transaction private and only visible by the regulator, "BULeR8JyUWhiuuCMU/HLA0Q5pzkYT+cHII3ZKBey3Bo=" is the Regulator Node's key in our setup | |
truffle(c)> SecretBallot.deployed().then((instance) => instance.vote(2, {privateFor: ["BULeR8JyUWhiuuCMU/HLA0Q5pzkYT+cHII3ZKBey3Bo="]})) | |
# Check vote count for option 1 | |
truffle(c)> SecretBallot.deployed().then((instance) => instance.getTotalVotes(1)).then((result) => result.toNumber()) | |
0 | |
# Check vote count for option 2 | |
truffle(c)> SecretBallot.deployed().then((instance) => instance.getTotalVotes(2)).then((result) => result.toNumber()) | |
1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment