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

Enforce buy_token != sell_token at Element parsing level #1422

Open
e00E opened this issue Sep 11, 2020 · 0 comments
Open

Enforce buy_token != sell_token at Element parsing level #1422

e00E opened this issue Sep 11, 2020 · 0 comments
Labels
cleanup PRs that don't add new functionality but clean or improve the codebase pricegraph

Comments

@e00E
Copy link
Contributor

e00E commented Sep 11, 2020

Hmm, good question. The exchange currently rejects buyToken == sellToken so it would also make sense for it to be an error in the Element parsing. That being said, it would require buy and sell properties on TokenPair to be private (so an invalid token pair can't be created), and for it to have a constructor that returns an Option which is significantly more work. I'm OK with the current implementation for now, but a checked TokenPair type that only accepts valid token pairs is more "correct" IMO.

Originally posted by @nlordell in #1421 (comment)

@e00E e00E added cleanup PRs that don't add new functionality but clean or improve the codebase pricegraph labels Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup PRs that don't add new functionality but clean or improve the codebase pricegraph
Projects
None yet
Development

No branches or pull requests

1 participant