Skip to content

Commit

Permalink
try this
Browse files Browse the repository at this point in the history
  • Loading branch information
codabrink committed Dec 12, 2024
1 parent b359ac6 commit f2fdbba
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
12 changes: 1 addition & 11 deletions xmtp_mls/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub struct Client<ApiClient, V = RemoteSignatureVerifier<ApiClient>> {
pub(crate) scw_verifier: Arc<V>,

#[cfg(feature = "test-utils")]
sync_worker_handle: Arc<parking_lot::Mutex<Option<Arc<WorkerHandle>>>>,
pub(crate) sync_worker_handle: Arc<parking_lot::Mutex<Option<Arc<WorkerHandle>>>>,
}

// most of these things are `Arc`'s
Expand Down Expand Up @@ -258,16 +258,6 @@ where
pub fn scw_verifier(&self) -> &V {
&self.scw_verifier
}

#[cfg(feature = "test-utils")]
pub fn sync_worker_handle(&self) -> Option<Arc<WorkerHandle>> {
self.sync_worker_handle.lock().clone()
}

#[cfg(feature = "test-utils")]
pub(crate) fn set_sync_worker_handle(&self, handle: Arc<WorkerHandle>) {
*self.sync_worker_handle.lock() = Some(handle);
}
}

impl<ApiClient, V> Client<ApiClient, V>
Expand Down
11 changes: 11 additions & 0 deletions xmtp_mls/src/groups/device_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ impl RetryableError for DeviceSyncError {
}
}

#[cfg(feature = "test-utils")]
impl<ApiClient, V> Client<ApiClient, V> {
pub fn sync_worker_handle(&self) -> Option<Arc<WorkerHandle>> {
self.sync_worker_handle.lock().clone()
}

pub(crate) fn set_sync_worker_handle(&self, handle: Arc<WorkerHandle>) {
*self.sync_worker_handle.lock() = Some(handle);
}
}

impl<ApiClient, V> Client<ApiClient, V>
where
ApiClient: XmtpApi + Send + Sync + 'static,
Expand Down
2 changes: 1 addition & 1 deletion xmtp_mls/src/groups/device_sync/message_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub(crate) mod tests {
groups::GroupMetadataOptions,
utils::test::{wait_for_min_intents, HISTORY_SYNC_URL},
};
use xmtp_common::{assert_err, assert_ok, wait_for_some};
use xmtp_common::{assert_ok, wait_for_some};
use xmtp_cryptography::utils::generate_local_wallet;
use xmtp_id::InboxOwner;

Expand Down

0 comments on commit f2fdbba

Please sign in to comment.