Skip to content

feat(gui): Redeem to internal Monero wallet#448

Merged
binarybaron merged 3 commits intomasterfrom
feat/redeem-to-internal-xmr-walelt
Jul 4, 2025
Merged

feat(gui): Redeem to internal Monero wallet#448
binarybaron merged 3 commits intomasterfrom
feat/redeem-to-internal-xmr-walelt

Conversation

@binarybaron
Copy link
Copy Markdown

@binarybaron binarybaron commented Jul 4, 2025

  • feat: optional address
  • progress

Summary by CodeRabbit

  • New Features

    • Added option to receive Monero swap payouts directly to an internal wallet address, with a new tabbed interface for selecting between internal and external addresses.
    • Improved handling of optional Monero addresses throughout the application, allowing swaps without specifying a receive address.
    • Enhanced sweep functionality to accept optional Monero addresses, defaulting to the wallet’s primary address when none is provided.
  • Bug Fixes

    • Enhanced robustness in address parsing and validation, reducing errors when handling optional or missing Monero addresses.
  • Refactor

    • Updated address-related methods and data structures to support optional Monero addresses.
    • Improved UI logic for swap initialization and payout address selection.
  • Chores

    • Reformatted several internal JSON and SQL metadata files for consistency.
    • Adjusted build script to use a fixed number of parallel jobs for local builds.
    • Updated logging verbosity for seller status messages.
  • Revert

    • Removed the SwapDialog modal and related UI components for swap progress and cancellation.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 4, 2025

Walkthrough

This set of changes introduces support for optional Monero receive addresses throughout the codebase. Database schemas, Rust backend logic, and TypeScript/React frontend components are updated to allow swaps to specify either an explicit Monero address or use an internal wallet address. Related constructors, methods, and validation logic are refactored to handle this optionality, and the sweep_multi method is updated to resolve missing addresses automatically.

Changes

File(s) Change Summary
monero-sys/src/lib.rs sweep_multi method now accepts a slice of Option<monero::Address>, filling None values with the main address asynchronously.
monero-harness/src/lib.rs sweep_multi method signature updated to accept generic elements convertible to Option<Address>.
monero-sys/build.rs Parallel build jobs for CMake limited to 4 (-j4) by default; GitHub Actions and Docker builds remain single-threaded.
src-gui/src/renderer/components/other/TruncatedText.tsx Null/undefined children are now safely handled in truncation logic.
src-gui/src/renderer/components/pages/swap/swap/init/InitPage.tsx Added tabbed interface for internal/external Monero redeem address; validation and state updated for optional address.
src-gui/src/renderer/components/pages/swap/swap/in_progress/XmrLockInMempoolPage.tsx Removed CancelButton import and usage.
src-gui/src/renderer/components/modal/swap/SwapDialog.tsx Deleted SwapDialog component.
swap/migrations/20250704115958_receive_xmr_to_internal_wallet.sql Migration: monero_addresses.address column made nullable; table recreated and indexed accordingly.
swap/src/database/sqlite.rs Monero address handling updated to use Option<monero::Address>; insert, fetch, and test logic refactored for optional addresses.
swap/src/monero.rs LabeledMoneroAddress.address changed to Option<monero::Address>; new constructors added; related methods and tests updated.
swap/src/cli/api/request.rs Seller status logs downgraded from debug to trace level.
swap/.sqlx/query-*.json SQL query metadata updated: nullable fields marked, formatting changed to multi-line arrays; queries updated to handle optional addresses.
swap/.sqlx/query-1f332be08a5426f3fbcadea4e755d82ff1cdc2690eb464ccc607d3a613fa76a1.json Query now filters out NULL addresses; metadata updated for nullable column.
swap/.sqlx/query-dff8b986c3dde27b8121775e48a58564fa346b038866699210a63f8a33b03f0b.json Query result metadata: address column marked as nullable.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Frontend
    participant Backend
    participant Database
    participant Wallet

    User->>Frontend: Start swap, choose redeem address (internal/external)
    Frontend->>Backend: Submit swap request (redeemAddress: Option<monero::Address>)
    Backend->>Database: Store address (nullable)
    Backend->>Wallet: sweep_multi([Option<monero::Address>])
    Wallet->>Wallet: Replace None with main address
    Wallet->>Backend: Return TxReceipts
    Backend->>Frontend: Respond with swap status
    Frontend->>User: Show swap progress/outcome
Loading

Possibly related PRs

Suggested labels

P1

Suggested reviewers

  • Einliterflasche

Poem

In fields of code where Monero hops,
Addresses now can come or not,
Internal, external, the choice is free,
The wallet fills in what used to be.
With nullable fields and logic anew,
This rabbit’s proud of what you do! 🐇✨

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.

🔧 Clippy (1.86.0)
Updating git repository `https://github.com/Einliterflasche/bdk`

error: failed to load source for dependency bdk_chain

Caused by:
Unable to update https://github.com/Einliterflasche/bdk?branch=bump%2Frusqlite-0.32#2e57dc74

Caused by:
failed to create directory /usr/local/git/db/bdk-e8932ca4a5d98dbe

Caused by:
Permission denied (os error 13)


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 46695b1 and 0146d49.

📒 Files selected for processing (2)
  • monero-harness/src/lib.rs (1 hunks)
  • monero-sys/src/lib.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • monero-sys/src/lib.rs
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: UnstoppableSwap/core#0
File: AGENT.md:0-0
Timestamp: 2025-06-30T08:53:49.168Z
Learning: Pull request titles must use the format `<type>(<scope>): <description>`, for example: `feat(gui): New feature`, `fix(swap): Issue fixed`, or `refactor(ci): Ci changes`.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : In src/lib.rs, provide idiomatic Rust interfaces to the C++ code, using wrapper types (WalletManager, Wallet) with safer interfaces, and handle memory management and safety concerns.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Implement `Send` and `Sync` for wrapper types in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/**/*.rs : Use Rust 2021 edition.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Implement proper deref for wrapper types in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/{src/bridge.rs,src/lib.rs} : When adding a new function to the bridge, copy its definition from monero/src/wallet/api/wallet2_api.h into bridge.rs, then add wrapping logic in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/bridge.rs : In src/bridge.rs, mirror functions from monero/src/wallet/api/wallet2_api.h by copying their definitions and letting CXX generate the bindings.
monero-harness/src/lib.rs (10)
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : In src/lib.rs, provide idiomatic Rust interfaces to the C++ code, using wrapper types (WalletManager, Wallet) with safer interfaces, and handle memory management and safety concerns.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Implement `Send` and `Sync` for wrapper types in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Implement proper deref for wrapper types in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/bridge.rs : In src/bridge.rs, mirror functions from monero/src/wallet/api/wallet2_api.h by copying their definitions and letting CXX generate the bindings.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/{src/bridge.rs,src/lib.rs} : When adding a new function to the bridge, copy its definition from monero/src/wallet/api/wallet2_api.h into bridge.rs, then add wrapping logic in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/**/*.rs : Use Rust 2021 edition.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Use `Pin` for C++ objects that require stable memory addresses in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/{src/bridge.rs,src/lib.rs} : Raw pointers must be wrapped in safe Rust types, and `unsafe` is only used at the FFI boundary.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: When implementing new wrapper functions: 1. Locate the function in wallet2_api.h, 2. Copy the exact method signature to bridge.rs, 3. Implement the Rust wrapper in lib.rs, 4. Run the build to ensure everything compiles.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/bridge.rs : In src/bridge.rs, define the FFI interface using the `cxx::bridge` macro, declaring C++ types and functions to be accessed from Rust.
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Cursor BugBot
  • GitHub Check: build (x86_64-apple-darwin, macos-13)
  • GitHub Check: build (x86_64-pc-windows-msvc, windows-latest-l)
  • GitHub Check: build (aarch64-apple-darwin, macos-latest)
  • GitHub Check: test (macos-latest)
  • GitHub Check: Cursor BugBot
🔇 Additional comments (4)
monero-harness/src/lib.rs (4)

503-506: Documentation clearly explains the new behavior.

The added documentation effectively communicates that None addresses will default to the primary address of the main wallet, which helps users understand the new optional address functionality.


506-506: Method signature change enables flexible address handling.

The new signature &[impl Into<Option<Address>> + Clone] allows callers to pass various types that can be converted to Option<Address>, providing backward compatibility while enabling the new optional address feature.


510-510: Proper conversion implementation.

The mapping correctly converts each input element to Option<Address> using the Into trait, ensuring type safety and proper handling of the generic input.


513-513: Correct parameter passing to underlying method.

The call to self.wallet.sweep_multi(&addresses, ratios) properly passes the converted vector by reference, maintaining the expected interface with the underlying wallet system.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🔭 Outside diff range comments (2)
swap/src/monero.rs (2)

376-384: Fix compilation error in From implementation.

The From<::monero::Address> implementation still calls the now-private new constructor, which will cause a compilation error.

Apply this fix:

impl From<::monero::Address> for MoneroAddressPool {
    fn from(address: ::monero::Address) -> Self {
-        Self(vec![LabeledMoneroAddress::new(
+        Self(vec![LabeledMoneroAddress::with_address(
            address,
            Decimal::from(1),
            "user address".to_string(),
        )
        .expect("Percentage 1 is always valid")])
    }
}

935-937: Fix compilation error in test.

The test still calls the now-private new constructor, which will cause a compilation error.

Apply this fix:

-        assert!(LabeledMoneroAddress::new(address, Decimal::ZERO, "test".to_string()).is_ok());
-        assert!(LabeledMoneroAddress::new(address, Decimal::ONE, "test".to_string()).is_ok());
-        assert!(LabeledMoneroAddress::new(address, Decimal::new(5, 1), "test".to_string()).is_ok()); // 0.5
+        assert!(LabeledMoneroAddress::with_address(address, Decimal::ZERO, "test".to_string()).is_ok());
+        assert!(LabeledMoneroAddress::with_address(address, Decimal::ONE, "test".to_string()).is_ok());
+        assert!(LabeledMoneroAddress::with_address(address, Decimal::new(5, 1), "test".to_string()).is_ok()); // 0.5
        assert!(
-            LabeledMoneroAddress::new(address, Decimal::new(9925, 4), "test".to_string()).is_ok()
+            LabeledMoneroAddress::with_address(address, Decimal::new(9925, 4), "test".to_string()).is_ok()
        ); // 0.9925

        // Invalid percentages should fail
        assert!(
-            LabeledMoneroAddress::new(address, Decimal::new(-1, 0), "test".to_string()).is_err()
+            LabeledMoneroAddress::with_address(address, Decimal::new(-1, 0), "test".to_string()).is_err()
        );
        assert!(
-            LabeledMoneroAddress::new(address, Decimal::new(11, 1), "test".to_string()).is_err()
+            LabeledMoneroAddress::with_address(address, Decimal::new(11, 1), "test".to_string()).is_err()
        ); // 1.1
        assert!(
-            LabeledMoneroAddress::new(address, Decimal::new(2, 0), "test".to_string()).is_err()
+            LabeledMoneroAddress::with_address(address, Decimal::new(2, 0), "test".to_string()).is_err()
        ); // 2.0
🧹 Nitpick comments (3)
monero-rpc-pool/.sqlx/query-7bc8d637e7cf020bff58d05109ae88e56672e95e0e638af99e82df5b00595e77.json (1)

25-29: Nit: commit only semantic‐relevant metadata to reduce noisy diffs
This hunk merely reflows the nullable array onto multiple lines without any real semantic change. If these JSON artefacts are auto-generated by sqlx prepare, consider adding an .editorconfig/CI step to normalise their formatting or excluding them entirely from the review scope to avoid PR noise.

monero-rpc-pool/.sqlx/query-d32d91ca2debc4212841282533482b2ff081234c7f9f848a7223ae04234995d9.json (1)

20-23: Same formatting-only reflow as other .sqlx files
Again, no behavioural impact—just array pretty-printing. Consider tooling/ignore rules to keep the repo history clean if this churn is unintended.

src-gui/src/renderer/components/other/TruncatedText.tsx (1)

7-7: Type inconsistency: Interface vs implementation

The interface declares children: string (non-nullable), but the implementation now handles null/undefined values with children ?? "". Consider updating the interface to reflect the actual expected types:

-  children: string;
+  children?: string | null;

This would make the type definition consistent with the defensive null handling in the implementation.

Also applies to: 12-12

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 293ff2c and 43f5614.

📒 Files selected for processing (25)
  • monero-rpc-pool/.sqlx/query-44ddff5bdf5b56e9c1a9848641181de4441c8974b2d1304804874cf620420ad4.json (1 hunks)
  • monero-rpc-pool/.sqlx/query-7bc8d637e7cf020bff58d05109ae88e56672e95e0e638af99e82df5b00595e77.json (1 hunks)
  • monero-rpc-pool/.sqlx/query-d32d91ca2debc4212841282533482b2ff081234c7f9f848a7223ae04234995d9.json (1 hunks)
  • monero-sys/src/lib.rs (1 hunks)
  • src-gui/src/renderer/components/other/TruncatedText.tsx (1 hunks)
  • src-gui/src/renderer/components/pages/swap/swap/init/InitPage.tsx (4 hunks)
  • swap/.sqlx/query-081c729a0f1ad6e4ff3e13d6702c946bc4d37d50f40670b4f51d2efcce595aa6.json (0 hunks)
  • swap/.sqlx/query-0d465a17ebbb5761421def759c73cad023c30705d5b41a1399ef79d8d2571d7c.json (0 hunks)
  • swap/.sqlx/query-2a356078a41b321234adf2aa385b501749f907f7c422945a8bdda2b6274f5225.json (0 hunks)
  • swap/.sqlx/query-50ef34b4efabe650d40096a390d9240b9a7cd62878dfaa6805563cfc21284cd5.json (0 hunks)
  • swap/.sqlx/query-5cc61dd0315571bc198401a354cd9431ee68360941f341386cbacf44ea598de8.json (0 hunks)
  • swap/.sqlx/query-6130b6cdd184181f890964eb460741f5cf23b5237fb676faed009106627a4ca6.json (0 hunks)
  • swap/.sqlx/query-7c37de52b3bb2ccd0868ccb861127416848d85eaebe8245c58d5beac7d537087.json (0 hunks)
  • swap/.sqlx/query-88f761a4f7a0429cad1df0b1bebb1c0a27b2a45656549b23076d7542cfa21ecf.json (0 hunks)
  • swap/.sqlx/query-98a8b7f4971e0eb4ab8f5aa688aa22e7fdc6b925de211f7784782f051c2dcd8c.json (0 hunks)
  • swap/.sqlx/query-b703032b4ddc627a1124817477e7a8e5014bdc694c36a14053ef3bb2fc0c69b0.json (0 hunks)
  • swap/.sqlx/query-d78acba5eb8563826dd190e0886aa665aae3c6f1e312ee444e65df1c95afe8b2.json (0 hunks)
  • swap/.sqlx/query-dff8b986c3dde27b8121775e48a58564fa346b038866699210a63f8a33b03f0b.json (0 hunks)
  • swap/.sqlx/query-e05620f420f8c1022971eeb66a803323a8cf258cbebb2834e3f7cf8f812fa646.json (0 hunks)
  • swap/.sqlx/query-e36c287aa98ae80ad4b6bb6f7e4b59cced041406a9db71da827b09f0d3bacfd6.json (0 hunks)
  • swap/.sqlx/query-e9d422daf774d099fcbde6c4cda35821da948bd86cc57798b4d8375baf0b51ae.json (0 hunks)
  • swap/migrations/20250704115958_receive_xmr_to_internal_wallet.sql (1 hunks)
  • swap/src/cli/api/request.rs (2 hunks)
  • swap/src/database/sqlite.rs (3 hunks)
  • swap/src/monero.rs (5 hunks)
💤 Files with no reviewable changes (15)
  • swap/.sqlx/query-2a356078a41b321234adf2aa385b501749f907f7c422945a8bdda2b6274f5225.json
  • swap/.sqlx/query-081c729a0f1ad6e4ff3e13d6702c946bc4d37d50f40670b4f51d2efcce595aa6.json
  • swap/.sqlx/query-e36c287aa98ae80ad4b6bb6f7e4b59cced041406a9db71da827b09f0d3bacfd6.json
  • swap/.sqlx/query-98a8b7f4971e0eb4ab8f5aa688aa22e7fdc6b925de211f7784782f051c2dcd8c.json
  • swap/.sqlx/query-d78acba5eb8563826dd190e0886aa665aae3c6f1e312ee444e65df1c95afe8b2.json
  • swap/.sqlx/query-b703032b4ddc627a1124817477e7a8e5014bdc694c36a14053ef3bb2fc0c69b0.json
  • swap/.sqlx/query-5cc61dd0315571bc198401a354cd9431ee68360941f341386cbacf44ea598de8.json
  • swap/.sqlx/query-6130b6cdd184181f890964eb460741f5cf23b5237fb676faed009106627a4ca6.json
  • swap/.sqlx/query-e9d422daf774d099fcbde6c4cda35821da948bd86cc57798b4d8375baf0b51ae.json
  • swap/.sqlx/query-50ef34b4efabe650d40096a390d9240b9a7cd62878dfaa6805563cfc21284cd5.json
  • swap/.sqlx/query-e05620f420f8c1022971eeb66a803323a8cf258cbebb2834e3f7cf8f812fa646.json
  • swap/.sqlx/query-0d465a17ebbb5761421def759c73cad023c30705d5b41a1399ef79d8d2571d7c.json
  • swap/.sqlx/query-88f761a4f7a0429cad1df0b1bebb1c0a27b2a45656549b23076d7542cfa21ecf.json
  • swap/.sqlx/query-dff8b986c3dde27b8121775e48a58564fa346b038866699210a63f8a33b03f0b.json
  • swap/.sqlx/query-7c37de52b3bb2ccd0868ccb861127416848d85eaebe8245c58d5beac7d537087.json
🧰 Additional context used
📓 Path-based instructions (3)
`monero-sys/{src/bridge.rs,src/lib.rs}`: When adding a new function to the bridg...

monero-sys/{src/bridge.rs,src/lib.rs}: When adding a new function to the bridge, copy its definition from monero/src/wallet/api/wallet2_api.h into bridge.rs, then add wrapping logic in src/lib.rs.
Raw pointers must be wrapped in safe Rust types, and unsafe is only used at the FFI boundary.

📄 Source: CodeRabbit Inference Engine (monero-sys/CLAUDE.md)

List of files the instruction was applied to:

  • monero-sys/src/lib.rs
`monero-sys/**/*.rs`: Use Rust 2021 edition. Use `unsafe` only for FFI interacti...

monero-sys/**/*.rs: Use Rust 2021 edition.
Use unsafe only for FFI interactions with Monero C++ code.
When using .expect(), the message should be a short description of the assumed invariant in the format of .expect("the invariant to be upheld").

📄 Source: CodeRabbit Inference Engine (monero-sys/CLAUDE.md)

List of files the instruction was applied to:

  • monero-sys/src/lib.rs
`monero-sys/src/lib.rs`: In src/lib.rs, provide idiomatic Rust interfaces to the...

monero-sys/src/lib.rs: In src/lib.rs, provide idiomatic Rust interfaces to the C++ code, using wrapper types (WalletManager, Wallet) with safer interfaces, and handle memory management and safety concerns.
Raw pointers must never be exposed to users of the library in src/lib.rs.
Implement Send and Sync for wrapper types in src/lib.rs.
Use Pin for C++ objects that require stable memory addresses in src/lib.rs.
Implement proper deref for wrapper types in src/lib.rs.
Use the OnceLock pattern to ensure WalletManager is a singleton in src/lib.rs.

📄 Source: CodeRabbit Inference Engine (monero-sys/CLAUDE.md)

List of files the instruction was applied to:

  • monero-sys/src/lib.rs
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
PR: UnstoppableSwap/core#0
File: AGENT.md:0-0
Timestamp: 2025-06-30T08:53:49.168Z
Learning: Pull request titles must use the format `<type>(<scope>): <description>`, for example: `feat(gui): New feature`, `fix(swap): Issue fixed`, or `refactor(ci): Ci changes`.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : In src/lib.rs, provide idiomatic Rust interfaces to the C++ code, using wrapper types (WalletManager, Wallet) with safer interfaces, and handle memory management and safety concerns.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/**/*.rs : Use Rust 2021 edition.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Implement proper deref for wrapper types in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Implement `Send` and `Sync` for wrapper types in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Use `Pin` for C++ objects that require stable memory addresses in src/lib.rs.
swap/src/database/sqlite.rs (10)
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : In src/lib.rs, provide idiomatic Rust interfaces to the C++ code, using wrapper types (WalletManager, Wallet) with safer interfaces, and handle memory management and safety concerns.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Implement proper deref for wrapper types in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Use `Pin` for C++ objects that require stable memory addresses in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/**/*.rs : Use Rust 2021 edition.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Implement `Send` and `Sync` for wrapper types in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/**/*.rs : Use `unsafe` only for FFI interactions with Monero C++ code.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/bridge.rs : In src/bridge.rs, mirror functions from monero/src/wallet/api/wallet2_api.h by copying their definitions and letting CXX generate the bindings.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/{src/bridge.rs,src/lib.rs} : Raw pointers must be wrapped in safe Rust types, and `unsafe` is only used at the FFI boundary.
Learnt from: nabijaczleweli
PR: UnstoppableSwap/core#391
File: swap/src/asb/network.rs:61-77
Timestamp: 2025-06-15T15:55:03.118Z
Learning: In swap/src/asb/network.rs, write errors for the onion private key file are intentionally non-fatal and should be ignored using `let _ =` pattern.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/{src/bridge.rs,src/lib.rs} : When adding a new function to the bridge, copy its definition from monero/src/wallet/api/wallet2_api.h into bridge.rs, then add wrapping logic in src/lib.rs.
src-gui/src/renderer/components/pages/swap/swap/init/InitPage.tsx (1)
Learnt from: nabijaczleweli
PR: UnstoppableSwap/core#391
File: src-gui/src/renderer/components/pages/help/SettingsBox.tsx:54-57
Timestamp: 2025-06-15T15:52:41.735Z
Learning: In the UnstoppableSwap GUI codebase, top-level await is used as a convention for infallible RPC calls like getTorForced() and getMatches(), as seen in files like SettingsBox.tsx and config.ts. This is an intentional architectural decision by the team.
monero-sys/src/lib.rs (10)
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : In src/lib.rs, provide idiomatic Rust interfaces to the C++ code, using wrapper types (WalletManager, Wallet) with safer interfaces, and handle memory management and safety concerns.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Implement `Send` and `Sync` for wrapper types in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Implement proper deref for wrapper types in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/bridge.rs : In src/bridge.rs, mirror functions from monero/src/wallet/api/wallet2_api.h by copying their definitions and letting CXX generate the bindings.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/**/*.rs : Use Rust 2021 edition.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/{src/bridge.rs,src/lib.rs} : When adding a new function to the bridge, copy its definition from monero/src/wallet/api/wallet2_api.h into bridge.rs, then add wrapping logic in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Use `Pin` for C++ objects that require stable memory addresses in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Use the `OnceLock` pattern to ensure WalletManager is a singleton in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/{src/bridge.rs,src/lib.rs} : Raw pointers must be wrapped in safe Rust types, and `unsafe` is only used at the FFI boundary.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/**/*.rs : Use `unsafe` only for FFI interactions with Monero C++ code.
swap/src/monero.rs (10)
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : In src/lib.rs, provide idiomatic Rust interfaces to the C++ code, using wrapper types (WalletManager, Wallet) with safer interfaces, and handle memory management and safety concerns.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/**/*.rs : Use Rust 2021 edition.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Implement proper deref for wrapper types in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Implement `Send` and `Sync` for wrapper types in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Use `Pin` for C++ objects that require stable memory addresses in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/{src/bridge.rs,src/lib.rs} : Raw pointers must be wrapped in safe Rust types, and `unsafe` is only used at the FFI boundary.
Learnt from: nabijaczleweli
PR: UnstoppableSwap/core#391
File: swap/src/asb/network.rs:61-77
Timestamp: 2025-06-15T15:55:03.118Z
Learning: In swap/src/asb/network.rs, write errors for the onion private key file are intentionally non-fatal and should be ignored using `let _ =` pattern.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/bridge.rs : In src/bridge.rs, mirror functions from monero/src/wallet/api/wallet2_api.h by copying their definitions and letting CXX generate the bindings.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/{src/bridge.rs,src/lib.rs} : When adding a new function to the bridge, copy its definition from monero/src/wallet/api/wallet2_api.h into bridge.rs, then add wrapping logic in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/**/*.rs : Use `unsafe` only for FFI interactions with Monero C++ code.
🧬 Code Graph Analysis (4)
swap/src/database/sqlite.rs (1)
swap/src/monero.rs (8)
  • address (278-280)
  • percentage (283-285)
  • label (288-290)
  • with_address (269-271)
  • with_internal_address (273-275)
  • new (250-267)
  • new (310-312)
  • new (447-449)
src-gui/src/renderer/components/pages/swap/swap/init/InitPage.tsx (1)
src-gui/src/renderer/components/inputs/MoneroAddressTextField.tsx (1)
  • MoneroAddressTextField (29-97)
monero-sys/src/lib.rs (2)
swap/src/monero.rs (2)
  • addresses (315-317)
  • address (278-280)
monero-harness/src/lib.rs (1)
  • address (437-439)
swap/src/monero.rs (2)
monero-sys/src/lib.rs (1)
  • address (1087-1093)
monero-harness/src/lib.rs (1)
  • address (437-439)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Cursor BugBot
  • GitHub Check: test (macos-latest)
  • GitHub Check: build (x86_64-pc-windows-msvc, windows-latest-l)
  • GitHub Check: build (x86_64-apple-darwin, macos-13)
  • GitHub Check: build (aarch64-apple-darwin, macos-latest)
🔇 Additional comments (19)
monero-rpc-pool/.sqlx/query-44ddff5bdf5b56e9c1a9848641181de4441c8974b2d1304804874cf620420ad4.json (1)

25-29: Trivial formatting change
Pure whitespace/line-split on the nullable field. No action required, but worth checking if your formatter is stable across environments to avoid future diff clutter.

swap/src/cli/api/request.rs (1)

165-165: Question: Relevance of logging level change to PR objectives

The change from tracing::debug! to tracing::trace! for seller status logging doesn't seem directly related to the core PR objective of "redeem to internal Monero wallet" functionality. While reducing log verbosity can be beneficial, this change appears unrelated to the optional address feature being implemented.

Consider whether this logging change should be in a separate commit or PR focused on logging improvements rather than being bundled with the Monero address feature.

Also applies to: 185-185

swap/migrations/20250704115958_receive_xmr_to_internal_wallet.sql (1)

7-26: Migration and code updates correctly support a nullable address column

The schema migration and application code already handle address as nullable without issues:

  • In swap/src/database/sqlite.rs, the get_monero_address_pool method treats row.address as Option<monero::Address>:
    let address: Option<monero::Address> = row.address.clone().map(|address| address.parse()).transpose()?;
  • SQLx’s query! macro now infers address as Option<String>, matching the updated schema.
  • All insert and select statements against monero_addresses continue to function with the new nullable column.

No further changes are required.

monero-sys/src/lib.rs (2)

441-441: LGTM! Signature change aligns with optional address feature.

The parameter type change from &[monero::Address] to &[Option<monero::Address>] correctly supports the new feature allowing optional Monero addresses.


446-450: LGTM! Correct implementation of address fallback logic.

The implementation properly handles optional addresses by:

  • Fetching the wallet's main address as a fallback
  • Using map() and unwrap_or() to substitute None values with the primary address
  • Maintaining the original vector length and order

The async call to main_address() is correctly placed before the mapping operation.

src-gui/src/renderer/components/pages/swap/swap/init/InitPage.tsx (4)

15-16: LGTM! Consistent state variable declaration.

The new state variable follows the same pattern as the existing useExternalRefundAddress and is properly initialized.


26-26: LGTM! Correct conditional address passing.

The logic correctly passes redeemAddress only when useExternalRedeemAddress is true, otherwise passing null for internal wallet redemption. This mirrors the existing refund address pattern.


40-69: LGTM! Well-implemented tabbed interface.

The new tabbed interface for redeem address selection:

  • Follows the same pattern as the refund address section for consistency
  • Provides clear tab labels and appropriate helper text
  • Correctly uses conditional rendering based on useExternalRedeemAddress
  • Maintains consistent styling and structure

The implementation enhances user experience by clearly distinguishing between internal and external redemption options.


107-107: LGTM! Consistent validation logic.

The updated validation correctly includes redeem address validation when external address is selected, maintaining the same pattern as the refund address validation.

swap/src/database/sqlite.rs (4)

114-114: LGTM! Correct handling of optional address insertion.

The change from direct .to_string() to .map(|address| address.to_string()) properly handles the optional address type for database insertion.


166-166: LGTM! Proper optional address parsing.

The use of .map() and .transpose() correctly handles parsing optional address strings to optional monero::Address types, maintaining type safety.


170-175: LGTM! Correct constructor selection based on address presence.

The conditional logic properly:

  • Uses with_address() when an address is present
  • Uses with_internal_address() when no address is provided
  • Maintains consistent error handling with descriptive messages
  • Maps constructor errors to anyhow::Error appropriately

This ensures type safety and proper handling of both internal and external address scenarios.


545-550: LGTM! Test code updated for new constructor API.

The test code correctly updates from using .new() to using the explicit .with_address() constructor, maintaining test functionality while adapting to the updated API that distinguishes between internal and external addresses.

swap/src/monero.rs (6)

230-232: LGTM! Clean optional address implementation.

The change to make the address field optional with clear documentation is well-implemented. This enables the "redeem to internal wallet" feature by allowing None to indicate using the internal Monero wallet address.


250-267: Good constructor refactoring with proper validation.

The private new constructor correctly handles the optional address conversion and maintains the existing percentage validation logic. The impl Into<Option<monero::Address>> parameter provides flexibility for both Some(address) and None cases.


269-275: Excellent API design with clear intent.

The two new public constructors provide a clean, intent-revealing API:

  • with_address for explicit external addresses
  • with_internal_address for internal wallet addresses

This design makes the code more readable and prevents confusion about when to use Some vs None.


278-280: Address getter correctly updated for optional addresses.

The getter now properly returns Option<monero::Address> and clones the value, maintaining consistency with the new optional address design.


315-317: MoneroAddressPool correctly adapted for optional addresses.

The addresses() method correctly maps over the addresses and returns a vector of optional addresses, maintaining consistency with the new design.


347-353: Smart network validation handling for optional addresses.

The assert_network method correctly handles optional addresses by only validating the network when an address is present. This prevents validation errors for internal wallet addresses while still ensuring external addresses are on the correct network.

@binarybaron binarybaron force-pushed the feat/redeem-to-internal-xmr-walelt branch from 43f5614 to 46695b1 Compare July 4, 2025 13:32
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
swap/.sqlx/query-1f332be08a5426f3fbcadea4e755d82ff1cdc2690eb464ccc607d3a613fa76a1.json (1)

3-3: Query now filters NULLs – verify index for performance.

SELECT DISTINCT address ... WHERE address IS NOT NULL is functionally correct, but on large tables DISTINCT + IS NOT NULL can trigger full‐table scans unless an index on address exists.

If monero_addresses.address is not already indexed, consider:

CREATE INDEX IF NOT EXISTS idx_monero_addresses_address ON monero_addresses(address);

This keeps the call cheap even as data grows.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43f5614 and 46695b1.

📒 Files selected for processing (20)
  • monero-sys/build.rs (1 hunks)
  • monero-sys/src/lib.rs (1 hunks)
  • src-gui/src/renderer/components/modal/swap/SwapDialog.tsx (0 hunks)
  • src-gui/src/renderer/components/other/TruncatedText.tsx (1 hunks)
  • src-gui/src/renderer/components/pages/swap/swap/in_progress/XmrLockInMempoolPage.tsx (0 hunks)
  • src-gui/src/renderer/components/pages/swap/swap/init/InitPage.tsx (4 hunks)
  • swap/.sqlx/query-081c729a0f1ad6e4ff3e13d6702c946bc4d37d50f40670b4f51d2efcce595aa6.json (1 hunks)
  • swap/.sqlx/query-0d465a17ebbb5761421def759c73cad023c30705d5b41a1399ef79d8d2571d7c.json (1 hunks)
  • swap/.sqlx/query-1f332be08a5426f3fbcadea4e755d82ff1cdc2690eb464ccc607d3a613fa76a1.json (2 hunks)
  • swap/.sqlx/query-5cc61dd0315571bc198401a354cd9431ee68360941f341386cbacf44ea598de8.json (1 hunks)
  • swap/.sqlx/query-6130b6cdd184181f890964eb460741f5cf23b5237fb676faed009106627a4ca6.json (1 hunks)
  • swap/.sqlx/query-88f761a4f7a0429cad1df0b1bebb1c0a27b2a45656549b23076d7542cfa21ecf.json (1 hunks)
  • swap/.sqlx/query-d78acba5eb8563826dd190e0886aa665aae3c6f1e312ee444e65df1c95afe8b2.json (1 hunks)
  • swap/.sqlx/query-dff8b986c3dde27b8121775e48a58564fa346b038866699210a63f8a33b03f0b.json (1 hunks)
  • swap/.sqlx/query-e05620f420f8c1022971eeb66a803323a8cf258cbebb2834e3f7cf8f812fa646.json (1 hunks)
  • swap/.sqlx/query-e9d422daf774d099fcbde6c4cda35821da948bd86cc57798b4d8375baf0b51ae.json (1 hunks)
  • swap/migrations/20250704115958_receive_xmr_to_internal_wallet.sql (1 hunks)
  • swap/src/cli/api/request.rs (2 hunks)
  • swap/src/database/sqlite.rs (3 hunks)
  • swap/src/monero.rs (5 hunks)
💤 Files with no reviewable changes (2)
  • src-gui/src/renderer/components/pages/swap/swap/in_progress/XmrLockInMempoolPage.tsx
  • src-gui/src/renderer/components/modal/swap/SwapDialog.tsx
✅ Files skipped from review due to trivial changes (5)
  • swap/.sqlx/query-5cc61dd0315571bc198401a354cd9431ee68360941f341386cbacf44ea598de8.json
  • swap/.sqlx/query-88f761a4f7a0429cad1df0b1bebb1c0a27b2a45656549b23076d7542cfa21ecf.json
  • swap/.sqlx/query-dff8b986c3dde27b8121775e48a58564fa346b038866699210a63f8a33b03f0b.json
  • swap/.sqlx/query-e05620f420f8c1022971eeb66a803323a8cf258cbebb2834e3f7cf8f812fa646.json
  • swap/.sqlx/query-0d465a17ebbb5761421def759c73cad023c30705d5b41a1399ef79d8d2571d7c.json
🚧 Files skipped from review as they are similar to previous changes (11)
  • swap/.sqlx/query-d78acba5eb8563826dd190e0886aa665aae3c6f1e312ee444e65df1c95afe8b2.json
  • swap/.sqlx/query-e9d422daf774d099fcbde6c4cda35821da948bd86cc57798b4d8375baf0b51ae.json
  • swap/.sqlx/query-6130b6cdd184181f890964eb460741f5cf23b5237fb676faed009106627a4ca6.json
  • swap/src/cli/api/request.rs
  • src-gui/src/renderer/components/other/TruncatedText.tsx
  • swap/.sqlx/query-081c729a0f1ad6e4ff3e13d6702c946bc4d37d50f40670b4f51d2efcce595aa6.json
  • swap/migrations/20250704115958_receive_xmr_to_internal_wallet.sql
  • monero-sys/src/lib.rs
  • src-gui/src/renderer/components/pages/swap/swap/init/InitPage.tsx
  • swap/src/database/sqlite.rs
  • swap/src/monero.rs
🧰 Additional context used
📓 Path-based instructions (2)
`monero-sys/**/*.rs`: Use Rust 2021 edition. Use `unsafe` only for FFI interacti...

monero-sys/**/*.rs: Use Rust 2021 edition.
Use unsafe only for FFI interactions with Monero C++ code.
When using .expect(), the message should be a short description of the assumed invariant in the format of .expect("the invariant to be upheld").

📄 Source: CodeRabbit Inference Engine (monero-sys/CLAUDE.md)

List of files the instruction was applied to:

  • monero-sys/build.rs
`monero-sys/**/build.rs`: In build.rs, compile the Monero C++ code with CMake ta...

monero-sys/**/build.rs: In build.rs, compile the Monero C++ code with CMake targeting wallet_api, set up include paths and library linking, configure CXX, and link required libraries.

📄 Source: CodeRabbit Inference Engine (monero-sys/CLAUDE.md)

List of files the instruction was applied to:

  • monero-sys/build.rs
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: UnstoppableSwap/core#0
File: AGENT.md:0-0
Timestamp: 2025-06-30T08:53:49.168Z
Learning: Pull request titles must use the format `<type>(<scope>): <description>`, for example: `feat(gui): New feature`, `fix(swap): Issue fixed`, or `refactor(ci): Ci changes`.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : In src/lib.rs, provide idiomatic Rust interfaces to the C++ code, using wrapper types (WalletManager, Wallet) with safer interfaces, and handle memory management and safety concerns.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Implement `Send` and `Sync` for wrapper types in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/**/*.rs : Use Rust 2021 edition.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Implement proper deref for wrapper types in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/{src/bridge.rs,src/lib.rs} : When adding a new function to the bridge, copy its definition from monero/src/wallet/api/wallet2_api.h into bridge.rs, then add wrapping logic in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/bridge.rs : In src/bridge.rs, mirror functions from monero/src/wallet/api/wallet2_api.h by copying their definitions and letting CXX generate the bindings.
monero-sys/build.rs (7)
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/**/build.rs : In build.rs, compile the Monero C++ code with CMake targeting wallet_api, set up include paths and library linking, configure CXX, and link required libraries.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/**/*.rs : Use Rust 2021 edition.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/**/*.rs : Use `unsafe` only for FFI interactions with Monero C++ code.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/bridge.rs : In src/bridge.rs, define the FFI interface using the `cxx::bridge` macro, declaring C++ types and functions to be accessed from Rust.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/lib.rs : Use `Pin` for C++ objects that require stable memory addresses in src/lib.rs.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/src/bridge.rs : In src/bridge.rs, mirror functions from monero/src/wallet/api/wallet2_api.h by copying their definitions and letting CXX generate the bindings.
Learnt from: CR
PR: UnstoppableSwap/core#0
File: monero-sys/CLAUDE.md:0-0
Timestamp: 2025-06-30T08:53:46.743Z
Learning: Applies to monero-sys/**/bridge.h : In bridge.h, provide helper functions to work around CXX limitations, including wrappers for static methods and handling string returns with std::unique_ptr.
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Cursor BugBot
  • GitHub Check: build (x86_64-pc-windows-msvc, windows-latest-l)
  • GitHub Check: build (aarch64-apple-darwin, macos-latest)
  • GitHub Check: build (x86_64-apple-darwin, macos-13)
  • GitHub Check: test (macos-latest)
🔇 Additional comments (3)
swap/.sqlx/query-1f332be08a5426f3fbcadea4e755d82ff1cdc2690eb464ccc607d3a613fa76a1.json (2)

15-17: Nullable flag changed – ensure Rust side uses Option<String>.

"nullable": [ true ] means sqlx will now expect Option<_> for this column. Double-check any consumer code of this query was updated accordingly; otherwise it will fail at compile time.


19-19: Prepared statement hash updated – remember to run cargo sqlx prepare.

The hash change implies the offline data has been regenerated locally. Make sure CI runs cargo sqlx prepare --check so that future PRs don’t break the compile-time metadata.

monero-sys/build.rs (1)

82-82: LGTM: Reasonable parallel build configuration.

The fixed -j4 provides a good balance between build performance and resource usage while maintaining predictable behavior across environments.

@binarybaron
Copy link
Copy Markdown
Author

bugbot run

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ BugBot reviewed your changes and found no bugs!


BugBot free trial expires on July 22, 2025
You have used $0.00 of your $0.00 spend limit so far. Manage your spend limit in the Cursor dashboard.

Was this report helpful? Give feedback by reacting with 👍 or 👎

@binarybaron binarybaron merged commit 7b67dce into master Jul 4, 2025
6 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant