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

RgbResolver: add Send trait bound #243

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

zoedberg
Copy link
Contributor

@zoedberg zoedberg commented Sep 4, 2024

This PR adds the Send trait bound to the inner field of the AnyResolver struct.

Without this change when trying to create an rgb-lib wallet (which contains an instance of AnyResolver) in tokio::task::spawn_blocking we receive an error, saying that

`(dyn rgb::indexers::any::RgbResolver + 'static)` cannot be sent between threads safely

This was not happening with beta 5, where AnyResolver was an enum

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 3.1%. Comparing base (ab825ab) to head (af4c130).
Report is 2 commits behind head on master.

Additional details and impacted files
@@          Coverage Diff          @@
##           master   #243   +/-   ##
=====================================
  Coverage     3.1%   3.1%           
=====================================
  Files          14     14           
  Lines        1729   1729           
=====================================
  Hits           53     53           
  Misses       1676   1676           
Flag Coverage Δ
rust 3.1% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

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

I think Send has to be added as a generic bound to the RgbResolver trait itself.

@zoedberg zoedberg changed the title add Send trait bound to AnyResolver's inner RgbResolver: add Send trait bound Sep 4, 2024
@zoedberg
Copy link
Contributor Author

zoedberg commented Sep 4, 2024

I think Send has to be added as a generic bound to the RgbResolver trait itself.

It makes sense. Done

@dr-orlovsky dr-orlovsky merged commit 3bce0f2 into RGB-WG:master Sep 4, 2024
25 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants