rusty_money
rusty_money copied to clipboard
Would it be alright to store the reverse key in addition to the regular key in an exchange?
If you store a rate for USD -> GBP and then you query for the rate for GBP -> USD, you get a None value. This doesn't seem correct to me. Shouldn't the value returned be 1/(rate returned for USD -> GBP)?
yes, the exchange rate crate isn't very mature right now, thanks for pointing out these issues.
i noticed some PR's, will review them over the weekend.
i will probably drop a new release (4.0.1) on Monday with any changes that are ready.
That sounds good, no rush 😄 . I actually probably should add some tests anyways.
We found that the rate for USD -> GBP is not the same as the rate for GBP -> USD in the real world exchanges (example: currencylayer.com).
If the crate wants to align with the currency exchanges in the market, it should return None as in the majority of cases you will want to store two different rates.