This repository was archived by the owner on Apr 28, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New fee and amount quote API #1143
New fee and amount quote API #1143
Changes from 1 commit
5147e7d
e6ca8e1
c038b00
91baeac
814b647
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 can't see the difference here between 400 and 500 errors - both are "Error quoting order".
Also, is the pattern for
#/components/schemas/FeeAndQuoteError
defined here, because it doesn't appear to be.I think we may also be missing some possibilities here. For example;
I can't really see the reason for the 429 here, unless we mean to change this to "RateLimited" too many quotes? but this could easily be worked around.
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.
Might be cute to encapsulate all these different specifics into the single FeeAndQuoteError which i imagine is the intention here. Something like
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.
#/components/schemas/FeeAndQuoteError
already exists (ans is used by thefeeAndQuote
route). Since the errors are the same, I just reused the error name for now.Additionally, we would probably reuse the error type from the existing
feeAndQuote
route.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.
That sounds reasonable, but what about all these other responses that seem out of place
as I see it, the only things we will need here are
along with some possible rate limiting...
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.
That is what the 429 is for AFIAU:
Additionally,
500
is used as a catch all "internal server error" - i.e. something unexpected went wrong.Finally:
Since the
from
is passed in, we can also check that the owner is forbidden by address (we have an "owner deny list" already).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.
Fixed 429 description and added "unexpected" to 500 description.
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.
There appears to be something missing in the description of 429 here in your comment...
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.
It was changed to: