effectai / effect-dao

Dashboard to interact with Effect Network and EffectDAO

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

First proposal doesn't show votes

djstrikanova opened this issue · comments

The first proposal doesn't show the vote, I believe it was unanimous.
https://dao.effect.network/proposals/1
It would be good to fix this bug for historical records.

Good find. It looks like this is a bug caused by this old bug were empty RAM wasn't allocated for votes.

This proposal did not get any NO votes, only YES (164) and ABSTAIN (58):

cleos -u http://eos.greymass.com get table daoproposals daoproposals proposal -l 2 | jq '.rows[1].vote_counts'
[
  {
    "key": 0,
    "value": 58
  },
  {
    "key": 1,
    "value": 164
  }
]

After this bug got fixed proposals got filled with empty votes, e.g.:

cleos -u http://eos.greymass.com get table daoproposals daoproposals proposal -l 2 | jq '.rows[0].vote_counts'
[
  {
    "key": 0,
    "value": 10000
  },
  {
    "key": 1,
    "value": 4455439
  },
  {
    "key": 2,
    "value": 0
  }
]

Our frontend vote percentage code expects all 3 votes types to be present.

image

This line is the cause of the error:

https://github.com/effectai/effect-dao/blob/main/pages/proposals/_id/index.vue#L378

This should be a quick one to fix; a good opportunity for new comers.

I'm labeling this ticket as bounty & good first issue.