Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: account for single contribution for grant in clr #5277

Merged
merged 1 commit into from
Oct 2, 2019

Conversation

thelostone-mc
Copy link
Member

@thelostone-mc thelostone-mc commented Sep 27, 2019

Description

Pairs the contributor with itself and ensures grants get matching clr even if it has one contributor

If grant has only 1 contributor.
Assume with contributor_profile : 1 who contributed 5 DAI :

  • while generating pair we assume another pseudo contribution who makes 1 DAI
    (I'm assuming this is the lowest possible contribution )
  • pair generated would : 1 & _1 with contributions 5 DAI and 1 DAI

If a new profile contributes,
the pesudo contributor_profile's (_1) contibution (1 DAI) is ignored and algorithm works as usual

Refers/Fixes

Fixes: #5223

Testing

https://share.vidyard.com/watch/rTqnXvuiRuswAnbvK91GbR?

@codecov
Copy link

codecov bot commented Sep 27, 2019

Codecov Report

Merging #5277 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5277      +/-   ##
==========================================
- Coverage   29.89%   29.89%   -0.01%     
==========================================
  Files         230      230              
  Lines       18997    19000       +3     
  Branches     2709     2710       +1     
==========================================
  Hits         5680     5680              
- Misses      13080    13083       +3     
  Partials      237      237
Impacted Files Coverage Δ
app/grants/clr.py 0% <0%> (ø) ⬆️

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 18a0352...9cf4e28. Read the comment docs.

@@ -64,6 +64,10 @@ def generate_grant_pair(grant):
else:
unique_contributions[profile] = amount

if len(unique_contributions) == 1:
profile = next(iter(unique_contributions))
Copy link
Contributor

Choose a reason for hiding this comment

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

nice! some mystical python here :)

@thelostone-mc thelostone-mc merged commit 32ca089 into gitcoinco:master Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gitcoin Grants CLR Round 3 v2 Improvements
3 participants