This contribution is a solution to Not displaying accounts with reputation <25 via the "?info accountname" function!.
@theaustrianguy bug report directs DACH-Discord server bot by @jedigeiss.
What was the issue(s)?
According to bughunter,
?info accountname command didn't display any info for users with reputation under 25. This is not exactly true, because the issue was with accounts of reputation < 0.
?info berniesanders(-17) - no response
?info dzordyja(-1) - no response
Why is that?
Traversing through the code, it threw error at line:
rep = math.log10(rep)
rep is raw reputation stored in blockchain. It is very large (or very small) number. According to steemd.com for berniesanders it is value of
The math rule says common logarithm cannot calculate negative input numbers. That's why
ValueError: math domain error happens exiting whole call.
Steem official formula
- Take the log base 10 of the raw score
- Subtract 9
- Multiply by 9
- Add 25
- Round down to the nearest integer
What was the solution?
To keep things simple I have verified if raw reputation score is negative. Then calculated absolute value of it and logarithm of. Attached negative sign again to the result (if marked) and keep through rest of formula.
Posted on Utopian.io - Rewarding Open Source Contributors