-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add ETH as a currency #618
Conversation
Signed-off-by: nhartner <nhartner@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, other than some copy/paste errors.
...-impl/src/main/java/org/interledger/connector/javax/money/providers/EthCurrencyProvider.java
Show resolved
Hide resolved
...l/src/test/java/org/interledger/connector/javax/money/providers/EthCurrencyProviderTest.java
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #618 +/- ##
============================================
+ Coverage 65.76% 65.82% +0.05%
- Complexity 1149 1153 +4
============================================
Files 297 298 +1
Lines 5784 5796 +12
Branches 228 228
============================================
+ Hits 3804 3815 +11
Misses 1879 1879
- Partials 101 102 +1
Continue to review full report at Codecov.
|
Signed-off-by: nhartner <nhartner@gmail.com>
@Test | ||
public void getCurrency() { | ||
assertThat(Monetary.getCurrency("XRP").getDefaultFractionDigits()).isEqualTo(3); | ||
assertThat(Monetary.getCurrency("ETH").getDefaultFractionDigits()).isEqualTo(9); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure if/where getDefaultFractionDigits
is used in JavaMoney, if at all. I don't think we use this anywhere in our actual FX code, so maybe this is unimportant to the Connector.
That said, my sense is that this value is just for default display purposes. E.g., for USD
and EUR
, it's 2, but for JPY
it's 0. This doesn't preclude a developer from using fractional numbers, so maybe this setting is not important. E.g., in the Javadoc, it says "In the case of pseudo-currencies, such as IMF Special Drawing Rights, -1 is returned."
All that to say, the CryptoCompare API seems to use 4 for XRP and 6 for Eth for display purposes (see here and enter https://min-api.cryptocompare.com/data/price?fsym=USD&tsyms=ETH
).
So, maybe we set these to 4 and 6? Or maybe this has some other meaning that I'm missing?
No description provided.