From 28f813149b0b904dfad4f6532145e849580483e0 Mon Sep 17 00:00:00 2001 From: Darius Date: Sat, 21 Dec 2024 11:51:39 -0600 Subject: [PATCH] chore: impl didext on did reference --- 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;