Skip to content

Commit

Permalink
removed references to orb_commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Quinn committed Dec 30, 2024
1 parent 2806412 commit 5761f99
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 24 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ git = "https://github.com/worldcoin/orb-relay-messages.git"
rev = "6de97229c26d46eb600b1dd288b5325830ed816b"
features = ["client"]
# Uncomment for local development
[patch."https://github.com/worldcoin/orb-relay-messages.git"]
orb-relay-messages = { path = "../orb-relay-messages/rust" }
# [patch."https://github.com/worldcoin/orb-relay-messages.git"]
# orb-relay-messages = { path = "../orb-relay-messages/rust" }

[workspace.dependencies.nusb]
git = "https://github.com/kevinmehall/nusb"
Expand Down
23 changes: 1 addition & 22 deletions relay-client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//! Orb-Relay crate
use orb_relay_messages::{
common, orb_commands, prost::Name, prost_types::Any, self_serve,
};
use orb_relay_messages::{common, prost::Name, prost_types::Any, self_serve};

pub mod client;

Expand Down Expand Up @@ -68,14 +66,6 @@ impl PayloadMatcher for self_serve::orb::v1::SignupEnded {
}
}

impl PayloadMatcher for orb_commands::v1::OrbCommand {
type Output = orb_commands::v1::OrbCommand;

fn matches(payload: &Any) -> Option<Self::Output> {
unpack_any::<Self>(payload)
}
}

pub trait IntoPayload {
fn into_payload(self) -> Any;
}
Expand Down Expand Up @@ -163,15 +153,6 @@ impl IntoPayload for common::v1::NoState {
}
}

impl IntoPayload for orb_commands::v1::OrbCommand {
fn into_payload(self) -> Any {
Any::from_msg(&orb_commands::v1::OrbCommand {
commands: self.commands,
})
.unwrap()
}
}

/// Debug any message
pub fn debug_any(any: &Option<Any>) -> String {
let Some(any) = any else {
Expand All @@ -183,8 +164,6 @@ pub fn debug_any(any: &Option<Any>) -> String {
format!("{:?}", w)
} else if let Some(w) = unpack_any::<common::v1::W>(any) {
format!("{:?}", w)
} else if let Some(w) = unpack_any::<orb_commands::v1::OrbCommand>(any) {
format!("{:?}", w)
} else {
"Error".to_string()
}
Expand Down

0 comments on commit 5761f99

Please sign in to comment.