Skip to content

Commit

Permalink
chore: impl didext on did reference
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 committed Dec 21, 2024
1 parent 5b24793 commit 28f8131
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion extensions/warp-ipfs/src/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ pub(super) mod topics {
}

pub(super) mod ds_key {

use rust_ipfs::{Ipfs, Keypair, PeerId, PublicKey};

pub trait DataStoreKey {
Expand Down Expand Up @@ -258,6 +257,20 @@ impl DidExt for DID {
}
}

impl DidExt for &DID {
fn to_public_key(&self) -> Result<PublicKey, anyhow::Error> {
(*self).to_public_key()
}

fn to_peer_id(&self) -> Result<PeerId, anyhow::Error> {
(*self).to_peer_id()
}

fn to_keypair(&self) -> Result<Keypair, anyhow::Error> {
(*self).to_keypair()
}
}

pub trait VecExt<T: Eq> {
fn insert_item(&mut self, item: T) -> bool;
fn remove_item(&mut self, item: &T) -> bool;
Expand Down

0 comments on commit 28f8131

Please sign in to comment.