Closed parodime closed 2 weeks ago
The changes in this pull request focus on enhancing the quoter.go
file, specifically the generateActiveRFQ
and generateQuotes
methods within the Manager
struct. A new field, OriginAmountExact
, is added to the QuoteInput
struct to accommodate exact deposit amounts during quote generation. The logic for handling these amounts is integrated into the quote generation process, including error handling improvements and adjustments to the getOriginAmount
method to ensure quotes meet the specified deposit requirements. Additionally, several related files and test cases have been updated to reflect these changes.
File Path | Change Summary |
---|---|
services/rfq/relayer/quoter/quoter.go | - Added OriginAmountExact *big.Int field to QuoteInput struct.- Enhanced generateActiveRFQ method to parse and include deposit amounts in quotes.- Updated getOriginAmount method to check and adjust quote amounts based on deposit requirements.- Modified generateQuotes method to initialize OriginAmountExact to nil in QuoteInput instances.- Improved error handling during deposit parsing and quote generation. |
services/rfq/relayer/quoter/quoter_test.go | - Added TestGetOriginAmountActiveQuotes method to test GetOriginAmount functionality with various quote parameter scenarios. |
services/rfq/api/db/api_db.go | - Renamed OriginAmount field to OriginAmountExact in ActiveQuoteRequest struct.- Updated FromUserRequest function to reflect the new field name. |
services/rfq/api/model/request.go | - Renamed OriginAmount field to OriginAmountExact in QuoteData struct. |
services/rfq/api/model/response.go | - Renamed OriginAmount field to OriginAmountExact in GetOpenQuoteRequestsResponse struct. |
services/rfq/api/rest/handler.go | - Updated dbActiveQuoteRequestToModel function to replace OriginAmount with OriginAmountExact . |
services/rfq/api/rest/rfq.go | - Updated methods to use OriginAmountExact instead of OriginAmount , affecting both active and passive RFQ handling. |
services/rfq/api/rest/rfq_test.go | - Updated test cases to replace OriginAmount with OriginAmountExact in PutRFQRequest data model. |
services/rfq/api/rest/server_test.go | - Updated TestGetOpenQuoteRequests function to replace OriginAmount with OriginAmountExact in test requests. |
services/rfq/api/docs/docs.go | - Updated API documentation to reflect the renaming of origin_amount to origin_amount_exact in relevant schemas. |
quoter.go
file, particularly in the Manager
struct and its methods, which are also addressed in the active quoting API introduced in this PR.size/l
π In the meadow, where quotes do play,
A deposit's dance brightens the day.
With amounts now checked, and errors refined,
Our quoting's robust, perfectly aligned.
Hop, hop, hooray, for changes so bright,
In the world of RFQs, all feels just right! π
[!WARNING] There were issues while running some tools. Please review the errors and either fix the toolβs configuration or disable the tool if itβs a critical failure.
π§ golangci-lint
level=warning msg="[config_reader] The configuration option `run.skip-files` is deprecated, please use `issues.exclude-files`." level=warning msg="[config_reader] The configuration option `run.skip-dirs` is deprecated, please use `issues.exclude-dirs`." level=warning msg="[config_reader] The configuration option `run.skip-dirs-use-default` is deprecated, please use `issues.exclude-dirs-use-default`." level=warning msg="[lintersdb] The linter \"maligned\" is deprecated (step 2) and deactivated. It should be removed from the list of disabled linters. https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle" level=warning msg="[lintersdb] The linter \"exhaustivestruct\" is deprecated (step 2) and deactivated. It should be removed from the list of disabled linters. https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle" level=warning msg="[lintersdb] The linter \"ifshort\" is deprecated (step 2) and deactivated. It should be removed from the list of disabled linters. https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle" level=warning msg="[lintersdb] The linter \"interfacer\" is deprecated (step 2) and deactivated. It should be removed from the list of disabled linters. https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle" level=warning msg="[lintersdb] The linter \"nosnakecase\" is deprecated (step 2) and deactivated. It should be removed from the list of disabled linters. https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle" level=warning msg="[lintersdb] The name \"goerr113\" is deprecated. The linter has been renamed to: err113." level=warning msg="The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar." level=warning msg="The linter 'execinquery' is deprecated (since v1.58.0) due to: The repository of the linter has been archived by the owner. "
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Latest commit: |
1a32365
|
Status: | β Deploy successful! |
Preview URL: | https://11d4aec1.sanguine-fe.pages.dev |
Branch Preview URL: | https://feat-activequotedepositamoun.sanguine-fe.pages.dev |
Attention: Patch coverage is 64.70588%
with 24 lines
in your changes missing coverage. Please review.
Project coverage is 25.00380%. Comparing base (
f2f1139
) to head (1a32365
). Report is 17 commits behind head on master.
Files with missing lines | Patch % | Lines |
---|---|---|
services/rfq/api/db/api_db.go | 0.00000% | 12 Missing :warning: |
services/rfq/relayer/quoter/quoter.go | 65.62500% | 11 Missing :warning: |
services/rfq/api/rest/rfq.go | 93.75000% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
ActiveQuoting needs to consider the deposit amount when preparing an Active RFQ response and utilize it to calculate a corresponding dest amount.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
origin_amount
toorigin_amount_exact
for clarity and precision in data representation.