Conversation
Changed Files
|
Summary of ChangesHello @0xh3rman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly expands the cross-chain swap capabilities by integrating the Relay provider, allowing for more diverse asset and chain combinations. Concurrently, it improves the robustness of data handling within the serialization library by introducing more versatile deserialization functions for common data types. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new swapper provider, Relay, which involves adding new modules for the provider itself and for serde serialization helpers. The changes are well-structured and include integration tests.
My review focuses on improving the robustness and performance of the new code. I've pointed out a few areas where error handling can be improved to prevent silent failures, particularly in JSON serialization. I've also identified a potential correctness issue with unsafe type casting in a new deserializer and a fragile logic for extracting a router address. Addressing these points will make the new provider more reliable.
51d48ac to
212b6b8
Compare
Restructure and update the relay integration to support Relay v2 responses and richer swap metadata. Key changes: - Fix API wallet address comparison in referral handler. - Rename quote_data_mapper -> mapper and move mapping logic; add relay_currency_to_asset_id and map_swap_result to produce SwapResult with TransactionSwapMetadata. - Update RelayChain API: add to_chain() conversion and rename chain_from_id -> from_chain_id returning RelayChain. - Change client endpoints/types: use /requests/v2?hash= and return RelayRequestsResponse; update imports accordingly. - Update models to represent relay requests and metadata (RelayRequestsResponse, RelayRequest, RelayRequestMetadata, RelayCurrencyDetail), and adjust status mapping (Refunded treated as Failed). - Update provider to use new mapper and client methods; adapt get_swap_result to map first request from response. - Adjust and add integration tests to match new types, endpoints and mapping behavior. These changes align the codebase with the updated relay API and improve mapping of currency/chain data into internal AssetId/SwapResult representations.
No description provided.