Pass identity balance as string - #4697
Conversation
6fffe34 to
8fbd60e
Compare
Codecov Report
@@ Coverage Diff @@
## master #4697 +/- ##
==========================================
- Coverage 40.48% 39.46% -1.03%
==========================================
Files 340 355 +15
Lines 18538 18960 +422
==========================================
- Hits 7506 7482 -24
- Misses 10319 10758 +439
- Partials 713 720 +7
Continue to review full report at Codecov.
|
| return Tokens{ | ||
| Wei: amount.String(), | ||
| Ether: ethers.String(), | ||
| Human: ethers.Truncate(HumanPrecision).String(), |
There was a problem hiding this comment.
Imo the human value here is not something backend should be concerned about. It's not like API should ever consume it in order to specify some amount of tokens and if we want to display it nicely, apps should just convert it to some notation they think is correct. 🤷🏻
When it comes to any interaction with the API we should only really accept Wei.
There was a problem hiding this comment.
We already have this in android API and it has helped a lot to avoid cumbersome logic on client side. Because API is an interface, the most important thing is how easy it is to use it from the consumer point of view. I shouldn't need to deal with the monstrosity where 1 token is presented as a number with 18 zeroes. So thanks for opinion, but this PR solves this long lasting issue.
Signed-off-by: Mantas Domaševičius <mantas@mysterium.network>
8fbd60e to
f67cf26
Compare
Provide a generic
Tokenobject for returning ethereum currency