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

crowdfund contribs + USD estimates for them were completely jacked #4912

Merged
merged 2 commits into from
Jul 31, 2019

Conversation

owocki
Copy link
Contributor

@owocki owocki commented Jul 31, 2019

Description

https://gitcoin.co/issue/ethereum/EIPs/2221/3296
this bounty (a) shows $4.91 USD as the USD amount when there is 1.189 ETH on the main bounty and 1.12 ETH on the crowdfund. (b) not show the 1.12 ETH in crowdfund.

fix before / after:
Screen Shot 2019-07-31 at 3 50 31 AM

Refers/Fixes

https://gitcoincore.slack.com/archives/CAXQ7PT60/p1564565072006400

Testing

tested locally

@@ -1347,6 +1347,10 @@ function normalizeAmount(amount, decimals) {
return Math.round((parseInt(amount) / Math.pow(10, decimals)) * 1000) / 1000;
}

function round(amount, decimals) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gitcoinco/engineers

heres what the programmer who built the crowdfund contributions functionality didnt know (and i guess didnt test):

normalizeAmount() != round()

normalizeAmount() was originally meant to take a token (which is stored as an int which represents a float value * 10**decimals) and transfer from amount from that int into that float value.

i guess this was a case of bad documentation and bad method naming.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense - theres a lot we can communicate in terms of code readability just by picking descriptive method and variable names @thelostone-mc @octavioamu something to keep in mind :)

@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #4912 into stable will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           stable    #4912   +/-   ##
=======================================
  Coverage   30.62%   30.62%           
=======================================
  Files         216      216           
  Lines       17402    17402           
  Branches     2364     2364           
=======================================
  Hits         5329     5329           
  Misses      11858    11858           
  Partials      215      215

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 3bc7461...73804b6. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #4912 into stable will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           stable    #4912   +/-   ##
=======================================
  Coverage   30.62%   30.62%           
=======================================
  Files         216      216           
  Lines       17402    17402           
  Branches     2364     2364           
=======================================
  Hits         5329     5329           
  Misses      11858    11858           
  Partials      215      215

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 3bc7461...73804b6. Read the comment docs.

@owocki owocki merged commit 73804b6 into stable Jul 31, 2019
@thelostone-mc thelostone-mc deleted the kevin/crowdfund_contributions branch June 27, 2020 00:48
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.

2 participants