-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
makes grant info calculation imdipident #4582
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good! Just a question and 2 leftover print()s
@@ -659,14 +661,17 @@ def get_converted_amount(self): | |||
return None | |||
|
|||
def get_converted_monthly_amount(self): | |||
converted_amount = self.get_converted_amount() | |||
if self.num_tx_approved == 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats this line for? Checking if its a one-time contribution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
app/grants/models.py
Outdated
|
||
instance.amount_received = 0 | ||
instance.monthly_amount_subscribed = 0 | ||
print(instance.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover print
app/grants/models.py
Outdated
|
||
if subscription.num_tx_processed <= subscription.num_tx_approved and value_usdt: | ||
instance.monthly_amount_subscribed += subscription.get_converted_monthly_amount() | ||
print("-", subscription.id, value_usdt, instance.monthly_amount_subscribed ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another print :) if we want these, lets use the logger 👍
Codecov Report
@@ Coverage Diff @@
## stable #4582 +/- ##
==========================================
- Coverage 17.58% 17.57% -0.01%
==========================================
Files 200 200
Lines 17070 17129 +59
Branches 2320 2345 +25
==========================================
+ Hits 3002 3011 +9
- Misses 14056 14103 +47
- Partials 12 15 +3
Continue to review full report at Codecov.
|
Description
makes grant info calculation imdipident
this makes debugging / correcting thte grant detail information much easier, since you don't have to reason about when the callback functions were calculated. you just construct the info from state everytime you calc it.
Refers/Fixes
https://gitcoincore.slack.com/archives/CAXQ7PT60/p1559671421017900
Testing
tested it locally. http://bits.owocki.com/424bf1731bfb/Image%202019-06-04%20at%208.02.04%20PM.png