Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
keks committed Jan 25, 2024
1 parent cd91f6c commit 305b761
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion openmls/src/extensions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ impl Extensions {
})
}

/// Get a reference to the mutable [`Metadata`] if there is any.
pub fn metadata(&self) -> Option<&Metadata> {
self.find_by_type(ExtensionType::Metadata)
.and_then(|e| match e {
Expand Down Expand Up @@ -515,7 +516,7 @@ impl Extension {
/// Get a reference to this extension as immutable [`Metadata`].
/// Returns an [`ExtensionError::InvalidExtensionType`] error if called on
/// an [`Extension`] that's not an immutable [`Metadata`] extension.
pub fn as_protected_metadata_extension(&self) -> Result<&Metadata, ExtensionError> {
pub fn as_immutable_metadata_extension(&self) -> Result<&Metadata, ExtensionError> {
match self {
Self::ImmutableMetadata(e) => Ok(e),
_ => Err(ExtensionError::InvalidExtensionType(
Expand Down
4 changes: 2 additions & 2 deletions openmls/src/group/mls_group/test_mls_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ fn immutable_metadata(ciphersuite: Ciphersuite, provider: &impl OpenMlsProvider)
Extensions::single(Extension::ImmutableMetadata(metadata.clone()));

// === Create a Group with Metadata ===
let var_name = Capabilities::new(
let capabilities = Capabilities::new(
None,
None,
Some(&[ExtensionType::ImmutableMetadata]),
Expand All @@ -1027,7 +1027,7 @@ fn immutable_metadata(ciphersuite: Ciphersuite, provider: &impl OpenMlsProvider)
let mut group_with_metadata = MlsGroup::builder()
.with_group_context_extensions(extensions_with_metadata.clone())
.expect("error when setting initial metadata group extension")
.with_capabilities(var_name)
.with_capabilities(capabilities)
.build(provider, &alice_signer, alice_credential_with_key.clone())
.expect("error creating group using builder");

Expand Down

0 comments on commit 305b761

Please sign in to comment.