Skip to content

Commit

Permalink
chore: remove unused request
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 committed Dec 6, 2024
1 parent 13d9617 commit 98fb2ec
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 101 deletions.
1 change: 0 additions & 1 deletion extensions/warp-ipfs/src/shuttle/identity/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ pub enum RegisterError {
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum Synchronized {
PeerRecord { record: Vec<u8> },
Store { package: Cid },
Fetch,
}
Expand Down
100 changes: 0 additions & 100 deletions extensions/warp-ipfs/src/shuttle/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,106 +724,6 @@ impl ShuttleTask {
_ = ipfs.pubsub_publish("/identity/announce/v0", bytes).await;
}
}
identity::protocol::Request::Synchronized(Synchronized::PeerRecord { .. }) => {
// let signed_envelope = match SignedEnvelope::from_protobuf_encoding(record) {
// Ok(signed_envelope) => signed_envelope,
// Err(e) => {
// let payload = payload_message_construct(
// keypair,
// None,
// Response::SynchronizedResponse(
// identity::protocol::SynchronizedResponse::Error(
// SynchronizedError::InvalidPayload {
// msg: e.to_string(),
// },
// ),
// ),
// )
// .expect("Valid payload construction");
// if let (Some(ch), Some(resp)) = (ch.take(), resp.take()) {
// let _ = resp.send((ch, payload));
// }

// return;
// }
// };

// let record = match PeerRecord::from_signed_envelope(signed_envelope) {
// Ok(record) => record,
// Err(e) => {
// let payload = payload_message_construct(
// keypair,
// None,
// Response::SynchronizedResponse(
// identity::protocol::SynchronizedResponse::Error(
// SynchronizedError::InvalodRecord { msg: e.to_string() },
// ),
// ),
// )
// .expect("Valid payload construction");

// if let (Some(ch), Some(resp)) = (ch.take(), resp.take()) {
// let _ = resp.send((ch, payload));
// }

// return;
// }
// };

// let peer_id = record.peer_id();

// let Ok(did) = peer_id.to_did() else {
// tracing::warn!(%peer_id, "Could not convert to did key");
// let payload = payload_message_construct(
// keypair,
// None,
// Response::SynchronizedResponse(
// identity::protocol::SynchronizedResponse::Error(
// SynchronizedError::Invalid,
// ),
// ),
// )
// .expect("Valid payload construction");

// if let (Some(ch), Some(resp)) = (ch.take(), resp.take()) {
// let _ = resp.send((ch, payload));
// }

// return;
// };

// if !identity_storage.contains(&did).await {
// let payload = payload_message_construct(
// keypair,
// None,
// Response::SynchronizedResponse(
// identity::protocol::SynchronizedResponse::Error(
// SynchronizedError::NotRegistered,
// ),
// ),
// )
// .expect("Valid payload construction");

// if let (Some(ch), Some(resp)) = (ch.take(), resp.take()) {
// let _ = resp.send((ch, payload));
// }

// return;
// }

// _ = self.precord_tx.send(record).await;

// let payload = payload_message_construct(
// keypair,
// None,
// Response::SynchronizedResponse(SynchronizedResponse::RecordStored),
// )
// .expect("Valid payload construction");

// if let (Some(ch), Some(resp)) = (ch.take(), resp.take()) {
// let _ = resp.send((ch, payload));
// }
}
identity::protocol::Request::Synchronized(Synchronized::Fetch) => {
let did = match payload.sender().to_did() {
Ok(did) => did,
Expand Down

0 comments on commit 98fb2ec

Please sign in to comment.