This pull request fixes two problems in get_exchange_value:
value.currency was always USD. To fix this, coin2 is returned as the value of value.currency.
An extra API request was made, because Coin.value was called twice. Now coin2's value is stored in a variable to avoid this.
Testing performed:
Called /btc/1/to/xmr/ and ensured currency.value was xmr.
Possible problems:
The CoinMarketCap API seems to be case insensitive. If I call this from curl and write XMR instead of xmr, I'll get XMR back.
If this is something to worry about normalizing, the API returns a symbol for coins. I can modify Coin.get_value to take a Coin and use the provided symbol if that would work better.
This pull request fixes two problems in get_exchange_value:
Testing performed:
Possible problems: The CoinMarketCap API seems to be case insensitive. If I call this from curl and write XMR instead of xmr, I'll get XMR back. If this is something to worry about normalizing, the API returns a symbol for coins. I can modify Coin.get_value to take a Coin and use the provided symbol if that would work better.