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

return a default options obj with tally when no MKR support #313

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

b-pmcg
Copy link
Contributor

@b-pmcg b-pmcg commented Nov 30, 2021

No description provided.

@b-pmcg
Copy link
Contributor Author

b-pmcg commented Nov 30, 2021

On the fence about this, if there's not MKR support on the options, do we really want to return a default, or should it just be handled on the front end? This PR makes an assumption that there are always 3 options in a plurality poll. Yes, its a fair assumption, but I'm conflicted about enforcing that in the code. @rafinskipg @tyler17 thoughts?

Copy link
Collaborator

@tyler17 tyler17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a fair assumption, and looks like it shouldn't break if there does happen to be a plurality vote with more than the 0,1, and 2 options, right?

edit: actually, long ago, before rank choice was added, we had plurality polls with more than those 3 options, so we could test this update on those polls

@rafinskipg
Copy link

Do you think we should add a default state for ranked polls too? Returning the current options as all "0"?

@b-pmcg
Copy link
Contributor Author

b-pmcg commented Nov 30, 2021

I think it's a fair assumption, and looks like it shouldn't break if there does happen to be a plurality vote with more than the 0,1, and 2 options, right?

edit: actually, long ago, before rank choice was added, we had plurality polls with more than those 3 options, so we could test this update on those polls

maybe the best thing to do would be to somehow get the # of options a poll has and return that many default options. I don't think we have that data available in the current function though.

Do you think we should add a default state for ranked polls too? Returning the current options as all "0"?

Yeah we probably should do that, but like above, we'd probably want to retrieve the # of options a poll has and return that many defaults. I'll try to see what the most painless way to get a polls # options is, I don't think we want to do another fetch in this call just to get that info.

@codecov
Copy link

codecov bot commented Dec 3, 2021

Codecov Report

Merging #313 (9b3964c) into dev (b821dc8) will decrease coverage by 0.07%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #313      +/-   ##
==========================================
- Coverage   86.20%   86.13%   -0.08%     
==========================================
  Files         139      139              
  Lines        6337     6339       +2     
  Branches     1257     1257              
==========================================
- Hits         5463     5460       -3     
- Misses        869      874       +5     
  Partials        5        5              
Impacted Files Coverage Δ
...ges/dai-plugin-governance/src/GovPollingService.ts 84.82% <85.71%> (-0.32%) ⬇️
packages/dai/src/eth/Web3Service.ts 83.21% <0.00%> (-2.19%) ⬇️
packages/dai/src/eth/accounts/setup.js 74.07% <0.00%> (-1.24%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b821dc8...9b3964c. Read the comment docs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants