Skip to content

Commit

Permalink
fix: Send/Sync handling for async validations
Browse files Browse the repository at this point in the history
  • Loading branch information
OtaK committed Jan 30, 2024
1 parent 1f8b4d3 commit 8d00599
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions openmls/src/treesync/node/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ impl ValidatableLeafNode for VerifiableCommitLeafNode {
}
}

#[async_trait::async_trait(?Send)]
#[cfg_attr(target_family = "wasm", async_trait::async_trait(?Send))]
#[cfg_attr(not(target_family = "wasm"), async_trait::async_trait)]
impl ValidatableLeafNode for VerifiableUpdateLeafNode {
async fn validate(
self,
Expand Down Expand Up @@ -87,8 +88,8 @@ impl VerifiableUpdateLeafNode {
}
}

#[async_trait::async_trait(?Send)]

#[cfg_attr(target_family = "wasm", async_trait::async_trait(?Send))]
#[cfg_attr(not(target_family = "wasm"), async_trait::async_trait)]
impl ValidatableLeafNode for VerifiableKeyPackageLeafNode {
async fn validate(
self,
Expand Down Expand Up @@ -132,8 +133,9 @@ impl VerifiableKeyPackageLeafNode {
}
}

#[async_trait::async_trait(?Send)]
pub(crate) trait ValidatableLeafNode: Verifiable + Sized
#[cfg_attr(target_family = "wasm", async_trait::async_trait(?Send))]
#[cfg_attr(not(target_family = "wasm"), async_trait::async_trait)]
pub(crate) trait ValidatableLeafNode: Verifiable + Send + Sync + Sized
where
LeafNode: VerifiedStruct<Self>,
{
Expand Down

0 comments on commit 8d00599

Please sign in to comment.