Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add memory wallet #530

Merged

Conversation

thunderbiscuit
Copy link
Member

I almost can't believe we get this for free now that the generic on the Wallet type has been removed.

Don't merge, needs actual testing. My main concern would be that certain methods don't work on the memory wallet, but that should be captured at compile time, so... are we just getting away with it with such simple changes? It's too good to be true.

Changelog notice

Added
  - New memory wallet [#528]

[#528]: https://github.com/bitcoindevkit/bdk-ffi/pull/528

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

Copy link

coderabbitai bot commented May 8, 2024

Walkthrough

The updates across various modules of the Bitcoin Development Kit (BDK) primarily focus on enhancing wallet synchronization and address management. Key changes include the introduction of FullScanRequest and SyncRequest to standardize full scan and sync operations, the replacement of get_address with reveal_next_address for address retrieval, and the addition of error handling improvements. These modifications aim to streamline processes and improve the robustness of the wallet functionalities.

Changes

File Path Change Summary
.../LiveTxBuilderTest.kt, .../LiveWalletTest.kt, .../OfflineWalletTest.kt Introduced FullScanRequest for initiating scans, updated address retrieval to revealNextAddress, and added wallet commit operations after updates.
bdk-ffi/src/..., bdk-jvm/lib/src/test/kotlin/..., bdk-python/tests/..., bdk-swift/Tests/... Added FullScanRequest and SyncRequest, updated method signatures and error handling, and standardized address retrieval across different language bindings.
bdk-ffi/src/error.rs, bdk-ffi/src/wallet.rs Enhanced error handling with new error types and updated method signatures for better clarity and functionality.
bdk-ffi/src/esplora.rs, bdk-jvm/lib/src/test/kotlin/LiveTxBuilderTest.kt Modified full_scan method to take FullScanRequest, and updated synchronization logic. Changed network from TESTNET to SIGNET in JVM tests.

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

Note: Auto-reply has been disabled for this repository by the repository owner. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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

@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

Out of diff range and nitpick comments (2)
bdk-python/tests/test_offline_wallet.py (1)

Line range hint 16-16: The Wallet class is used but not defined or imported in this file, which will cause a runtime error.

+ from bdk import Wallet
bdk-ffi/src/wallet.rs (1)

50-64: Introduced new_no_persist method for creating a wallet without persistence. Ensure that this aligns with the architectural requirements of the system.

@thunderbiscuit thunderbiscuit force-pushed the feature/memory-wallet branch from dc315f2 to 79e7ab7 Compare May 15, 2024 18:11
@thunderbiscuit thunderbiscuit requested a review from reez May 15, 2024 18:16
@thunderbiscuit
Copy link
Member Author

thunderbiscuit commented May 15, 2024

@reez I have tested those locally with all our JVM tests by turning them into memory wallets and all tests passed. Ready for review.

@thunderbiscuit
Copy link
Member Author

@reez this is ready for final review. I rebased #535 onto this one, so if you can review this one first we'll merge that and then look at the electrum client.

Copy link
Collaborator

@reez reez left a comment

Choose a reason for hiding this comment

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

ACK adc1ad8

Good to merge when new Swift test ✅ on CI

@thunderbiscuit thunderbiscuit force-pushed the feature/memory-wallet branch from adc1ad8 to c88b334 Compare May 16, 2024 14:17
@thunderbiscuit thunderbiscuit merged commit c88b334 into bitcoindevkit:master May 16, 2024
25 checks passed
@thunderbiscuit thunderbiscuit deleted the feature/memory-wallet branch May 16, 2024 14:42
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.

2 participants