interledgerjs / ilp-plugin-xrp-asym-client

Client to Asymmetric XRP Paychan
4 stars 3 forks source link

Feat: scale of 9 #12

Closed sharafian closed 6 years ago

sharafian commented 6 years ago

Support a scale greater than that of XRP ledger. Amounts are simply rounded up in drops. Because the high-scale amounts are kept alongside claim signatures, though, the error is bounded at 1 drop. Uses the info at connection time to make sure the currency scale is matched with the server.

codecov-io commented 6 years ago

Codecov Report

Merging #12 into master will increase coverage by 16.94%. The diff coverage is 73.91%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #12       +/-   ##
===========================================
+ Coverage   20.79%   37.73%   +16.94%     
===========================================
  Files           1        1               
  Lines         202      212       +10     
===========================================
+ Hits           42       80       +38     
+ Misses        160      132       -28
Impacted Files Coverage Δ
index.js 37.73% <73.91%> (+16.94%) :arrow_up:

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 c43a0fe...9524991. Read the comment docs.

sharafian commented 6 years ago

I think this makes for easy programming mistakes. If the programmer gets the denomination of a variable wrong, we have a (potentially very bad) bug.

From outside the plugin there's still only one scale.

I agree we can do some internal refactoring, though, to make the distinction more clear. The challenge is that I'm trying to do this in a non-breaking way so some JSON field names can't be changed.