-
-
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
CLR cart updates #6978
CLR cart updates #6978
Conversation
26e87ad solves the USDC issue
…On Wed, Jun 24, 2020 at 5:10 PM Matt ***@***.***> wrote:
Builds on the changes from #6966
<#6966>. Closes #6959
<#6959>
NOTE: This branch has not been thoroughly tested. Pending issues:
- It looks like the get_amount endpoint throws if USDC is an input?
- Similarly, for an input of DAI it returns a token name of USDT
Both of the above cases are currently not handled.
[image: image]
<https://user-images.githubusercontent.com/17163988/85636199-bb96d380-b634-11ea-9d08-11148886eb48.png>
cc @thelostone-mc <https://github.com/thelostone-mc> @owocki
<https://github.com/owocki>
------------------------------
You can view, comment on, or merge this pull request online at:
#6978
Commit Summary
- api: add grants/v1/api/clr
- chore: update syc/get_amount to support multiple tokens
- Get latest CLR curves when cart is loaded
- Reduce number of requests for price data
File Changes
- *M* app/assets/v2/js/amounts.js
<https://github.com/gitcoinco/web/pull/6978/files#diff-0356d0e2d57a5dbc9be1709b1ba1698f>
(8)
- *M* app/assets/v2/js/cart.js
<https://github.com/gitcoinco/web/pull/6978/files#diff-ebd56e657002d50efb25041944ee2d6e>
(45)
- *M* app/assets/v2/js/shared.js
<https://github.com/gitcoinco/web/pull/6978/files#diff-8d7b20d795398cf2b0e792ee8c1a165c>
(3)
- *M* app/dashboard/admin.py
<https://github.com/gitcoinco/web/pull/6978/files#diff-52995791615d3056db363f3a20eebb99>
(4)
- *M* app/dashboard/helpers.py
<https://github.com/gitcoinco/web/pull/6978/files#diff-4805da8d907cc7a606621667d13e1744>
(38)
- *M* app/dashboard/tests/test_dashboard_helpers.py
<https://github.com/gitcoinco/web/pull/6978/files#diff-d85c6388b98b019083f431c6234c8370>
(2)
- *M* app/grants/urls.py
<https://github.com/gitcoinco/web/pull/6978/files#diff-f821398ceeaa8b31a0d99c3bb285efe6>
(6)
- *M* app/grants/views.py
<https://github.com/gitcoinco/web/pull/6978/files#diff-9c83a1892e5b433bc22483a941276b94>
(44)
- *M* app/marketing/mails.py
<https://github.com/gitcoinco/web/pull/6978/files#diff-1283796aa382d8b7e68c6986d287bd46>
(20)
Patch Links:
- https://github.com/gitcoinco/web/pull/6978.patch
- https://github.com/gitcoinco/web/pull/6978.diff
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6978>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAD5PCO7TGHFVPHONZ3QMJDRYKBWJANCNFSM4OHOU3OA>
.
_________________________________________
gitcoin is live and has generated over $5mm for Open Source Software - see
our results <https://gitcoin.co/results>
|
Codecov Report
@@ Coverage Diff @@
## stable #6978 +/- ##
=======================================
Coverage 26.46% 26.46%
=======================================
Files 299 299
Lines 28829 28845 +16
Branches 4226 4228 +2
=======================================
+ Hits 7630 7635 +5
- Misses 20928 20939 +11
Partials 271 271
Continue to review full report at Codecov.
|
Thanks @owocki, just cherry-picked it to this branch and added a fix for handling stablecoins. Haven't tested the end-to-end flow since it seems the CLR curves return empty arrays for the default Rinkeby grants. But I did test by temporarily replacing line 774 from const clr_prediction_curve_2d = grant.grant_clr_prediction_curve; to const clr_prediction_curve_2d = [
[ 0.0, 1577.1156943411, 0.0 ],
[ 1.0, 1629.4037561848, 52.2880618436975 ],
[ 10.0, 1706.22286476493, 129.107170423827 ],
[ 100.0, 1842.66035063668, 265.544656295572 ],
[ 1000.0, 2020.7280581732, 443.612363832099 ],
[ 10000.0, 2183.80886558997, 606.693171248862 ]
]; and it did work as expected |
this is still a WIP branch right? |
@danlipert This should be good to merge, though I'd like to get someone else to give it a brief test to confirm it works as expected. Reason why is just because I wasn't able to test the full e2e flow:
I think @thelostone-mc may have tested this before approving but I'm not 100% sure To summarize the changes in this branch:
|
@mds1 Ah I think I understand - to get the prediction curves calculated in your local you have to run the management command to compute them after setting up a couple of example donations. Set up some grants, at least 2 users, and have the 2 users donate to at least 2 different grants. Then run the management command like so: |
Got it, that makes sense. Thanks. I'll be able to test that out in a few hours and will update you here afterwards |
Reason why we have to do that
|
This PR now also includes the changes from #6996 One final issue to resolve before merging: In the side cart, if I add all 3 rinkeby grants and use "Apply to all", the grant_donation_amount field of "Go Fund My Test Grant" gets deleted somehow.... |
Tested it with 6 mainnet grants and it seems all chill |
This isn't the first time that specific grant has given me issues, so there might just be something wrong with it or my config on rinkeby. So I think should be good to merge |
Builds on the changes from #6966. Closes #6959
NOTE: This branch has not been thoroughly tested. Pending issues:
get_amount
endpoint throws ifUSDC
is an input?cc @thelostone-mc @owocki