diff --git a/openmls/src/group/core_group/mod.rs b/openmls/src/group/core_group/mod.rs index 8837eda493..ef168c9964 100644 --- a/openmls/src/group/core_group/mod.rs +++ b/openmls/src/group/core_group/mod.rs @@ -122,8 +122,8 @@ impl Member { } } -#[derive(Debug, Serialize, Deserialize)] -#[cfg_attr(test, derive(PartialEq, Clone))] +#[derive(Debug, Serialize, Deserialize, Clone)] +#[cfg_attr(test, derive(PartialEq))] pub(crate) struct CoreGroup { public_group: PublicGroup, group_epoch_secrets: GroupEpochSecrets, diff --git a/openmls/src/group/core_group/past_secrets.rs b/openmls/src/group/core_group/past_secrets.rs index 88a794eb45..9be4a3b2aa 100644 --- a/openmls/src/group/core_group/past_secrets.rs +++ b/openmls/src/group/core_group/past_secrets.rs @@ -5,8 +5,8 @@ use crate::schedule::message_secrets::MessageSecrets; use super::*; // Internal helper struct -#[derive(Serialize, Deserialize)] -#[cfg_attr(test, derive(PartialEq, Clone))] +#[derive(Serialize, Deserialize, Clone)] +#[cfg_attr(test, derive(PartialEq))] #[cfg_attr(feature = "crypto-debug", derive(Debug))] struct EpochTree { epoch: u64, @@ -16,8 +16,8 @@ struct EpochTree { /// Can store message secrets for up to `max_epochs`. The trees are added with [`self::add()`] and can be queried /// with [`Self::get_epoch()`]. -#[derive(Serialize, Deserialize)] -#[cfg_attr(test, derive(PartialEq, Clone))] +#[derive(Serialize, Deserialize, Clone)] +#[cfg_attr(test, derive(PartialEq,))] #[cfg_attr(feature = "crypto-debug", derive(Debug))] pub(crate) struct MessageSecretsStore { // Maximum size of the `past_epoch_trees` list. diff --git a/openmls/src/group/core_group/proposals.rs b/openmls/src/group/core_group/proposals.rs index f2b1f1f932..0d8de4e10e 100644 --- a/openmls/src/group/core_group/proposals.rs +++ b/openmls/src/group/core_group/proposals.rs @@ -20,8 +20,7 @@ use crate::{ /// A [ProposalStore] can store the standalone proposals that are received from the DS /// in between two commit messages. -#[derive(Debug, Default, Serialize, Deserialize, PartialEq)] -#[cfg_attr(test, derive(Clone))] +#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Clone)] pub struct ProposalStore { queued_proposals: Vec, } diff --git a/openmls/src/group/mls_group/mod.rs b/openmls/src/group/mls_group/mod.rs index 57e13b6d33..662f93a4f2 100644 --- a/openmls/src/group/mls_group/mod.rs +++ b/openmls/src/group/mls_group/mod.rs @@ -45,7 +45,7 @@ mod test_mls_group; /// Pending Commit state. Differentiates between Commits issued by group members /// and External Commits. -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize, Clone)] pub enum PendingCommitState { /// Commit from a group member Member(StagedCommit), @@ -117,7 +117,7 @@ impl From for StagedCommit { /// state to [`MlsGroupState::PendingCommit`]. For more information on the /// external commit process, see [`MlsGroup::join_by_external_commit()`] or /// Section 11.2.1 of the MLS specification. -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize, Clone)] pub enum MlsGroupState { /// There is currently a pending Commit that hasn't been merged yet. PendingCommit(Box), @@ -151,7 +151,7 @@ pub enum MlsGroupState { /// An `MlsGroup` has an internal state variable determining if it is active or /// inactive, as well as if it has a pending commit. See [`MlsGroupState`] for /// more information. -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct MlsGroup { // The group configuration. See `MlsGroupCongig` for more information. mls_group_config: MlsGroupConfig, diff --git a/openmls/src/group/public_group/mod.rs b/openmls/src/group/public_group/mod.rs index 02160922dd..b3f010ce4d 100644 --- a/openmls/src/group/public_group/mod.rs +++ b/openmls/src/group/public_group/mod.rs @@ -55,8 +55,8 @@ mod tests; mod validation; /// This struct holds all public values of an MLS group. -#[derive(Debug, Serialize, Deserialize)] -#[cfg_attr(test, derive(PartialEq, Clone))] +#[derive(Debug, Serialize, Deserialize, Clone)] +#[cfg_attr(test, derive(PartialEq))] pub struct PublicGroup { treesync: TreeSync, proposal_store: ProposalStore, diff --git a/openmls/src/schedule/psk.rs b/openmls/src/schedule/psk.rs index 2c266b9675..6319ba7f0c 100644 --- a/openmls/src/schedule/psk.rs +++ b/openmls/src/schedule/psk.rs @@ -519,8 +519,8 @@ pub mod store { /// Resumption PSK store. /// /// This is where the resumption PSKs are kept in a rollover list. - #[derive(Debug, Serialize, Deserialize)] - #[cfg_attr(test, derive(PartialEq, Clone))] + #[derive(Debug, Serialize, Deserialize, Clone)] + #[cfg_attr(test, derive(PartialEq))] pub(crate) struct ResumptionPskStore { max_number_of_secrets: usize, resumption_psk: Vec<(GroupEpoch, ResumptionPskSecret)>, diff --git a/openmls/src/treesync/mod.rs b/openmls/src/treesync/mod.rs index 18a983c5b3..45a947c288 100644 --- a/openmls/src/treesync/mod.rs +++ b/openmls/src/treesync/mod.rs @@ -366,8 +366,8 @@ impl std::fmt::Display for RatchetTree { /// [`TreeSync`] instance guarantee a few invariants that are checked upon /// creating a new instance from an imported set of nodes, as well as when /// merging a diff. -#[derive(Debug, Serialize, Deserialize)] -#[cfg_attr(test, derive(PartialEq, Clone))] +#[derive(Debug, Serialize, Deserialize, Clone)] +#[cfg_attr(test, derive(PartialEq))] pub(crate) struct TreeSync { tree: MlsBinaryTree, tree_hash: Vec,