Skip to content

Commit

Permalink
forgot something :)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgwilym committed Jan 20, 2025
1 parent 4ba1bce commit e657365
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
32 changes: 16 additions & 16 deletions meadowcap/src/communal_capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use ufotofu_codec::{
use willow_data_model::grouping::Area;

use crate::{
AccessMode, Delegation, FailedDelegationError, InvalidDelegationError, McNamespaceId,
McSubspaceId,
AccessMode, Delegation, FailedDelegationError, InvalidDelegationError, McNamespacePublicKey,
McPublicUserKey,
};

/// Returned when [`is_communal`](https://willowprotocol.org/specs/meadowcap/index.html#is_communal) unexpectedly mapped a given [`namespace`](https://willowprotocol.org/specs/data-model/index.html#namespace) to `false`.
Expand Down Expand Up @@ -39,8 +39,8 @@ pub struct CommunalCapability<
UserPublicKey,
UserSignature,
> where
NamespacePublicKey: McNamespaceId,
UserPublicKey: McSubspaceId<UserSignature>,
NamespacePublicKey: McNamespacePublicKey,
UserPublicKey: McPublicUserKey<UserSignature>,
UserSignature: EncodableSync + EncodableKnownSize,
{
access_mode: AccessMode,
Expand All @@ -58,8 +58,8 @@ impl<
UserSignature,
> CommunalCapability<MCL, MCC, MPL, NamespacePublicKey, UserPublicKey, UserSignature>
where
NamespacePublicKey: McNamespaceId,
UserPublicKey: McSubspaceId<UserSignature>,
NamespacePublicKey: McNamespacePublicKey,
UserPublicKey: McPublicUserKey<UserSignature>,
UserSignature: EncodableSync + EncodableKnownSize + Clone,
{
/// Creates a new communal capability granting access to the [`SubspaceId`] corresponding to the given `UserPublicKey`.
Expand Down Expand Up @@ -252,8 +252,8 @@ pub struct CommunalHandover<
UserPublicKey,
UserSignature,
> where
NamespacePublicKey: McNamespaceId,
UserPublicKey: McSubspaceId<UserSignature>,
NamespacePublicKey: McNamespacePublicKey,
UserPublicKey: McPublicUserKey<UserSignature>,
UserSignature: EncodableSync + EncodableKnownSize,
{
cap: &'a CommunalCapability<MCL, MCC, MPL, NamespacePublicKey, UserPublicKey, UserSignature>,
Expand All @@ -272,8 +272,8 @@ impl<
> Encodable
for CommunalHandover<'a, MCL, MCC, MPL, NamespacePublicKey, UserPublicKey, UserSignature>
where
NamespacePublicKey: McNamespaceId,
UserPublicKey: McSubspaceId<UserSignature>,
NamespacePublicKey: McNamespacePublicKey,
UserPublicKey: McPublicUserKey<UserSignature>,
UserSignature: EncodableSync + EncodableKnownSize,
{
async fn encode<C>(&self, consumer: &mut C) -> Result<(), C::Error>
Expand Down Expand Up @@ -323,8 +323,8 @@ impl<
> EncodableKnownSize
for CommunalHandover<'a, MCL, MCC, MPL, NamespacePublicKey, UserPublicKey, UserSignature>
where
NamespacePublicKey: McNamespaceId,
UserPublicKey: McSubspaceId<UserSignature>,
NamespacePublicKey: McNamespacePublicKey,
UserPublicKey: McPublicUserKey<UserSignature>,
UserSignature: EncodableSync + EncodableKnownSize,
{
fn len_of_encoding(&self) -> usize {
Expand Down Expand Up @@ -363,8 +363,8 @@ impl<
> EncodableSync
for CommunalHandover<'a, MCL, MCC, MPL, NamespacePublicKey, UserPublicKey, UserSignature>
where
NamespacePublicKey: McNamespaceId,
UserPublicKey: McSubspaceId<UserSignature>,
NamespacePublicKey: McNamespacePublicKey,
UserPublicKey: McPublicUserKey<UserSignature>,
UserSignature: EncodableSync + EncodableKnownSize,
{
}
Expand All @@ -384,8 +384,8 @@ impl<
> Arbitrary<'a>
for CommunalCapability<MCL, MCC, MPL, NamespacePublicKey, UserPublicKey, UserSignature>
where
NamespacePublicKey: McNamespaceId + Arbitrary<'a>,
UserPublicKey: McSubspaceId<UserSignature> + Arbitrary<'a>,
NamespacePublicKey: McNamespacePublicKey + Arbitrary<'a>,
UserPublicKey: McPublicUserKey<UserSignature> + Arbitrary<'a>,
UserSignature: EncodableSync + EncodableKnownSize + Clone,
{
fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result<Self> {
Expand Down
4 changes: 2 additions & 2 deletions meadowcap/src/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ use willow_data_model::{NamespaceId, SubspaceId};
use crate::IsCommunal;

/// An extension of [`NamespaceId`] augmented with traits required by Meadowcap.
pub trait McNamespaceId:
pub trait McNamespacePublicKey:
NamespaceId + EncodableSync + EncodableKnownSize + DecodableCanonic + IsCommunal
{
}

/// An extension of [`SubspaceId`] augmented with traits required by Meadowcap.
pub trait McSubspaceId<UserSignature>:
pub trait McPublicUserKey<UserSignature>:
SubspaceId + EncodableSync + EncodableKnownSize + DecodableCanonic + Verifier<UserSignature>
{
}

0 comments on commit e657365

Please sign in to comment.