Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
correct polling contract abi
Browse files Browse the repository at this point in the history
  • Loading branch information
jparklev committed Sep 11, 2020
1 parent 8ea3c76 commit fc6a82e
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,80 @@
[{"constant":false,"inputs":[{"name":"pollId","type":"uint256"}],"name":"withdrawPoll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pollIds","type":"uint256[]"}],"name":"withdrawPoll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pollIds","type":"uint256[]"},{"name":"optionIds","type":"uint256[]"}],"name":"vote","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pollId","type":"uint256"},{"name":"optionId","type":"uint256"}],"name":"vote","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"npoll","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"startDate","type":"uint256"},{"name":"endDate","type":"uint256"},{"name":"multiHash","type":"string"},{"name":"url","type":"string"}],"name":"createPoll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"creator","type":"address"},{"indexed":false,"name":"blockCreated","type":"uint256"},{"indexed":true,"name":"pollId","type":"uint256"},{"indexed":false,"name":"startDate","type":"uint256"},{"indexed":false,"name":"endDate","type":"uint256"},{"indexed":false,"name":"multiHash","type":"string"},{"indexed":false,"name":"url","type":"string"}],"name":"PollCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"creator","type":"address"},{"indexed":false,"name":"blockWithdrawn","type":"uint256"},{"indexed":false,"name":"pollId","type":"uint256"}],"name":"PollWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"voter","type":"address"},{"indexed":true,"name":"pollId","type":"uint256"},{"indexed":true,"name":"optionId","type":"uint256"}],"name":"Voted","type":"event"}]
[
{
"constant": false,
"inputs": [{ "name": "pollId", "type": "uint256" }],
"name": "withdrawPoll",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "name": "pollId", "type": "uint256" },
{ "name": "optionId", "type": "uint256" }
],
"name": "vote",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "npoll",
"outputs": [{ "name": "", "type": "uint256" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "name": "startDate", "type": "uint256" },
{ "name": "endDate", "type": "uint256" },
{ "name": "multiHash", "type": "string" },
{ "name": "url", "type": "string" }
],
"name": "createPoll",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{ "indexed": true, "name": "creator", "type": "address" },
{ "indexed": false, "name": "blockCreated", "type": "uint256" },
{ "indexed": true, "name": "pollId", "type": "uint256" },
{ "indexed": false, "name": "startDate", "type": "uint256" },
{ "indexed": false, "name": "endDate", "type": "uint256" },
{ "indexed": false, "name": "multiHash", "type": "string" },
{ "indexed": false, "name": "url", "type": "string" }
],
"name": "PollCreated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": true, "name": "creator", "type": "address" },
{ "indexed": false, "name": "blockWithdrawn", "type": "uint256" },
{ "indexed": false, "name": "pollId", "type": "uint256" }
],
"name": "PollWithdrawn",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": true, "name": "voter", "type": "address" },
{ "indexed": true, "name": "pollId", "type": "uint256" },
{ "indexed": true, "name": "optionId", "type": "uint256" }
],
"name": "Voted",
"type": "event"
}
]
8 changes: 4 additions & 4 deletions packages/dai-plugin-governance/src/GovPollingService.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ export default class GovPollingService extends PrivateService {
}
}

voteLegacy(pollId, optionId) {
return this._pollingContract().vote(pollId, optionId);
}

voteRankedChoice(pollId, rankings) {
const byteArray = new Uint8Array(32);
rankings.forEach((optionIndex, i) => {
Expand All @@ -72,6 +68,10 @@ export default class GovPollingService extends PrivateService {
return this._batchPollingContract().vote(pollId, optionId);
}

voteLegacy(pollId, optionId) {
return this._pollingContract().vote(pollId, optionId);
}

voteRankedChoiceLegacy(pollId, rankings) {
const byteArray = new Uint8Array(32);
rankings.forEach((optionIndex, i) => {
Expand Down

0 comments on commit fc6a82e

Please sign in to comment.