Last active
December 28, 2017 17:08
-
-
Save didil/b42133379f1fa5030a8c9813f85452f3 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=b | |
# company B 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(b)> SecretBallot.deployed().then((instance) => instance.vote(1, {privateFor: ["BULeR8JyUWhiuuCMU/HLA0Q5pzkYT+cHII3ZKBey3Bo="]})) | |
# Check vote count for option 1 | |
truffle(b)> SecretBallot.deployed().then((instance) => instance.getTotalVotes(1)).then((result) => result.toNumber()) | |
1 | |
# Check vote count for option 2 | |
truffle(b)> SecretBallot.deployed().then((instance) => instance.getTotalVotes(2)).then((result) => result.toNumber()) | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment