From 84ed223e557f2ba7fe7686bb65c94d5dc50522cd Mon Sep 17 00:00:00 2001 From: Darius Clark Date: Sun, 22 Dec 2024 11:26:07 -0600 Subject: [PATCH] chore: impl didext on did reference (#654) --- extensions/warp-ipfs/src/store/mod.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/extensions/warp-ipfs/src/store/mod.rs b/extensions/warp-ipfs/src/store/mod.rs index cbc30a34a..5ca8e00a9 100644 --- a/extensions/warp-ipfs/src/store/mod.rs +++ b/extensions/warp-ipfs/src/store/mod.rs @@ -128,7 +128,6 @@ pub(super) mod topics { } pub(super) mod ds_key { - use rust_ipfs::{Ipfs, Keypair, PeerId, PublicKey}; pub trait DataStoreKey { @@ -258,6 +257,20 @@ impl DidExt for DID { } } +impl DidExt for &DID { + fn to_public_key(&self) -> Result { + (*self).to_public_key() + } + + fn to_peer_id(&self) -> Result { + (*self).to_peer_id() + } + + fn to_keypair(&self) -> Result { + (*self).to_keypair() + } +} + pub trait VecExt { fn insert_item(&mut self, item: T) -> bool; fn remove_item(&mut self, item: &T) -> bool;