Skip to content

test(wallet): add thread safety test#1417

Merged
evanlinjin merged 1 commit intobitcoindevkit:masterfrom
rustaceanrob:thread-safety
May 4, 2024
Merged

test(wallet): add thread safety test#1417
evanlinjin merged 1 commit intobitcoindevkit:masterfrom
rustaceanrob:thread-safety

Conversation

@rustaceanrob
Copy link
Copy Markdown
Contributor

Description

Wallet auto-implements Send and Sync after removing the generic. This test is a compile time error if there are changes to Wallet in the future that make it unsafe to send between threads. See #1387 for discussion.

Checklists

All Submissions:

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

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

Copy link
Copy Markdown

@storopoli storopoli left a comment

Choose a reason for hiding this comment

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

Concept ACK, these tiny but powerful tests are really a nice addition.

Copy link
Copy Markdown
Member

@evanlinjin evanlinjin left a comment

Choose a reason for hiding this comment

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

ACK ac18525

Good idea, thanks for doing this.

Comment thread crates/bdk/tests/wallet.rs Outdated
Copy link
Copy Markdown
Member

@evanlinjin evanlinjin left a comment

Choose a reason for hiding this comment

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

ACK db47347

@evanlinjin evanlinjin merged commit 2703cc6 into bitcoindevkit:master May 4, 2024
@rustaceanrob rustaceanrob deleted the thread-safety branch May 4, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants