Skip to content

Commit

Permalink
Remove unnecessary change
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhuaaa committed Nov 14, 2023
1 parent be31694 commit 563c6c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion xmtp_mls/src/groups/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ where

mls_group.save(provider.key_store())?;
let group_id = mls_group.group_id().to_vec();
let stored_group = StoredGroup::new(group_id.clone(), now_ns() as i64, membership_state);
let stored_group = StoredGroup::new(group_id.clone(), now_ns(), membership_state);
stored_group.store(&mut conn)?;

Ok(Self::new(client, group_id, stored_group.created_at_ns))
Expand Down
2 changes: 1 addition & 1 deletion xmtp_mls/src/storage/encrypted_store/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ pub(crate) mod tests {
pub fn generate_group(state: Option<GroupMembershipState>) -> StoredGroup {
StoredGroup {
id: rand_vec(),
created_at_ns: now_ns() as i64,
created_at_ns: now_ns(),
membership_state: state.unwrap_or(GroupMembershipState::Allowed),
}
}
Expand Down
4 changes: 2 additions & 2 deletions xmtp_mls/src/utils/time.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::time::{SystemTime, UNIX_EPOCH};

pub fn now_ns() -> u64 {
pub fn now_ns() -> i64 {
let now = SystemTime::now();

now.duration_since(UNIX_EPOCH)
.expect("Time went backwards")
.as_nanos() as u64
.as_nanos() as i64
}

0 comments on commit 563c6c9

Please sign in to comment.