Skip to content

Commit

Permalink
refactor: Change generic order in delegation::Agent and add defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
matheus23 committed Mar 20, 2024
1 parent 254b7f4 commit 0c8a718
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/delegation/agent.rs
@@ -1,5 +1,6 @@
use super::{payload::Payload, policy::Predicate, store::Store, Delegation};
use crate::ability::arguments::Named;
use crate::did;
use crate::{
crypto::{signature::Envelope, varsig, Nonce},
did::Did,
Expand All @@ -19,10 +20,10 @@ use web_time::SystemTime;
/// This is helpful for sessions where more than one delegation will be made.
#[derive(Debug)]
pub struct Agent<
DID: Did,
S: Store<DID, V, Enc>,
V: varsig::Header<Enc>,
Enc: Codec + TryFrom<u64> + Into<u64>,
DID: Did = did::preset::Verifier,
V: varsig::Header<Enc> + Clone = varsig::header::Preset,
Enc: Codec + Into<u64> + TryFrom<u64> = varsig::encoding::Preset,
> {
/// The [`Did`][Did] of the agent.
pub did: DID,
Expand All @@ -35,11 +36,11 @@ pub struct Agent<
}

impl<
DID: Did + Clone,
S: Store<DID, V, Enc> + Clone,
DID: Did + Clone,
V: varsig::Header<Enc> + Clone,
Enc: Codec + TryFrom<u64> + Into<u64>,
> Agent<DID, S, V, Enc>
> Agent<S, DID, V, Enc>
where
Ipld: Encode<Enc>,
Payload<DID>: TryFrom<Named<Ipld>>,
Expand Down

0 comments on commit 0c8a718

Please sign in to comment.