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

Try fix aad #26

Closed
wants to merge 1 commit into from
Closed

Try fix aad #26

wants to merge 1 commit into from

Conversation

insipx
Copy link

@insipx insipx commented May 10, 2024

  • Import ByteWrapper trait as _ to avoid name conflicts
  • implement From<&[u8]>/Vec<u8> for ByteWrapper
  • use impl Trait in return position for fn aad

@tuddman and I worked out the errors for the ByteWrapper trait on aad. However, using a generic for ByteWrapper eventually requires that a generic be added to MlsGroup which could create more complication than necessary. There are a few ways forward, but I wanted to gather some context for aad before continuing.

aad is present on MlsGroup in the load method:

    /// Loads the state of the group with given id from persisted state.
    pub fn load<Storage: crate::storage::StorageProvider>(
        storage: &Storage,
        group_id: &GroupId,
    ) -> Result<Option<MlsGroup>, Storage::Error> {
        let group_config = storage.mls_group_join_config(group_id)?;
        let core_group = CoreGroup::load(storage, group_id)?;
        let proposals: Vec<(ProposalRef, QueuedProposal)> = storage.queued_proposals(group_id)?;
        let own_leaf_nodes = storage.own_leaf_nodes(group_id)?;
        let aad = storage.aad(group_id)?;
        let group_state = storage.group_state(group_id)?;
        let mut proposal_store = ProposalStore::new();

        for (_ref, proposal) in proposals {
            proposal_store.add(proposal);
        }

        let build = || -> Option<Self> {
            Some(Self {
                mls_group_config: group_config?,
                group: core_group?,
                proposal_store,
                own_leaf_nodes,
                aad, // <----- this is the last error, but requires MlsGroup<ByteWrapper>
                group_state: group_state?,
            })
        };

        Ok(build())
    }

a simple solution is having a to_vec fn on ByteWrapper but then ByteWrapper itself seems redundant.

Base automatically changed from openmls-main to main May 12, 2024 17:13
@insipx insipx closed this May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant