Skip to content
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

Would it be alright to store the reverse key in addition to the regular key in an exchange? #51

Open
JavedNissar opened this issue Jan 13, 2021 · 3 comments

Comments

@JavedNissar
Copy link
Contributor

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)?

@varunsrin
Copy link
Owner

varunsrin commented Jan 15, 2021

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.

@JavedNissar
Copy link
Contributor Author

That sounds good, no rush 😄 . I actually probably should add some tests anyways.

@DavidBM
Copy link

DavidBM commented Jun 3, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants