-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change quote request construction for fee and quote (#234)
We recently added a regression to the "legacy" `api/v1/feeAndQuote` API endpoint. Under the hood, this request uses the same logic as for `api/v1/quote` which recently introduced a cap on the `valid_to` field. This broke the aforementioned fee and quote route which was internally converting the request into a quote with `valid_to` set to `u32::MAX`. This PR fixes this by changing the order quote construction to use a "sane" `valid_to` value: the default validity that is used in the CowSwap UI - which should be super unlikely to ever become "invalid" and break the legacy API. ### Test Plan `api/v1/feeAndQuote` should start working again! ``` % curl -s 'http://localhost:8080/api/v1/feeAndQuote/sell?sellToken=0xc778417E063141139Fce010982780140Aa0cD5Ab&buyToken=0xa7D1C04fAF998F9161fC9F800a99A809b84cfc9D&sellAmountBeforeFee=100000000000000000' | jq { "fee": { "amount": "220417002424587", "expirationDate": "2022-05-30T15:16:45.916306Z" }, "buyAmountAfterFee": "110754541550422939367" } ```
- Loading branch information
Nicholas Rodrigues Lordello
authored
May 31, 2022
1 parent
77d267f
commit 519f957
Showing
12 changed files
with
26 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters