Closed coderofstuff closed 11 months ago
Seems good. I think you should fix the regex to raise parsing error earlier with a clearer description.
The other two comments are not material, just for cleaner code
Patch coverage: 57.57%
and project coverage change: -0.02%
:warning:
Comparison is base (
c417c8b
) 58.86% compared to head (98366b7
) 58.84%.:exclamation: Current head 98366b7 differs from pull request most recent head b724d7c. Consider uploading reports for the commit b724d7c to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Problem: Floating point math causes inconsistencies when converting kas to sompi.
Solution: Use a method that parses the amount as a string, the converts it to sompi string then parse to uint64
Motivation: Someone (some 3rd party integrating with kaspa) sent 33184.1489732 via kaspawallet and the other party got 33184.14897319 because the kaspawallet send command loses some precision when converting kas to sompi (floating point math kinda stuff), which is off by 0.00000001. Small difference but irreconcilable to accounting.