vocdoni / census3

Golang library and a HTTP/API service that can be used to fetch an updated list of token holders for a Ethereum ERC20, ERC721, ERC777, or other external providers (ex. POAPs or GitcoinPassport).
GNU Affero General Public License v3.0
9 stars 2 forks source link

truncate scores instead of round it to the nearest integer #180

Closed lucasmenendez closed 8 months ago

lucasmenendez commented 8 months ago

Summary by CodeRabbit

github-actions[bot] commented 8 months ago

Image description CodeRabbit

Walkthrough

The changes primarily focus on modifying the score calculation logic in the Gitcoin provider. The scores are now truncated instead of being rounded to the nearest integer. This adjustment affects the processing of scores and consequently, the expected original holder's scores have been updated.

Changes

Files Summary
scanner/providers/gitcoin/gitcoin_score.go, scanner/providers/gitcoin/gitcoin_provider_test.go The score calculation logic has been altered to truncate scores using math.Trunc instead of rounding them with math.Round. The scores for two holders in the expectedOriginalHolders map have been updated to reflect this change.

🐇💻

In the land of code, where logic is king,

A rabbit hopped forth, a new song to sing.

"No more round and round," he cheerfully said,

"We'll truncate the scores, and surge ahead!"

So, he tweaked and he tested, till it was just right,

Then pushed his changes into the night.

Now the scores are precise, no rounding in sight,

Thanks to the rabbit, who coded with all his might! 🌙✨


Uplevel your code reviews with CodeRabbit Pro ### CodeRabbit Pro If you like this project, please support us by purchasing the [Pro version](https://coderabbit.ai). The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.