Skip to content

Commit

Permalink
feat: switch linux to zeromq
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielides committed Nov 19, 2024
1 parent 67f8e61 commit 5e402dc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ aes-gcm = "0.10" # For AES-256-GCM encryption
crossbeam-channel = "0.5.13"
regex = "1.11"

[target.'cfg(not(target_os = "windows"))'.dependencies]
[target.'cfg(not(any(target_os = "windows", target_os = "linux")))'.dependencies]
zmq = "0.10"

[target.'cfg(target_os = "windows")'.dependencies]
[target.'cfg(any(target_os = "windows", target_os = "linux"))'.dependencies]
zeromq = "0.4.1"
22 changes: 11 additions & 11 deletions src/components/core_zmq_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ use std::sync::{
use std::thread;
use std::time::Duration;

#[cfg(not(target_os = "windows"))]
#[cfg(not(any(target_os = "windows", target_os = "linux")))]
use image::EncodableLayout;
#[cfg(not(target_os = "windows"))]
#[cfg(not(any(target_os = "windows", target_os = "linux")))]
use zmq::Context;

#[cfg(target_os = "windows")]
#[cfg(any(target_os = "windows", target_os = "linux"))]
use futures::StreamExt;
#[cfg(target_os = "windows")]
#[cfg(any(target_os = "windows", target_os = "linux"))]
use tokio::runtime::Runtime;
#[cfg(target_os = "windows")]
#[cfg(any(target_os = "windows", target_os = "linux"))]
use zeromq::{Socket, SocketRecv, SubSocket};

pub struct CoreZMQListener {
Expand All @@ -40,18 +40,18 @@ pub enum ZMQConnectionEvent {
Disconnected,
}

#[cfg(not(target_os = "windows"))]
#[cfg(not(any(target_os = "windows", target_os = "linux")))]
pub const IS_LOCK_SIG_MSG: &[u8; 12] = b"rawtxlocksig";
#[cfg(not(target_os = "windows"))]
#[cfg(not(any(target_os = "windows", target_os = "linux")))]
pub const CHAIN_LOCKED_BLOCK_MSG: &[u8; 12] = b"rawchainlock";

#[cfg(target_os = "windows")]
#[cfg(any(target_os = "windows", target_os = "linux"))]
pub const IS_LOCK_SIG_MSG: &str = "rawtxlocksig";
#[cfg(target_os = "windows")]
#[cfg(any(target_os = "windows", target_os = "linux"))]
pub const CHAIN_LOCKED_BLOCK_MSG: &str = "rawchainlock";

impl CoreZMQListener {
#[cfg(not(target_os = "windows"))]
#[cfg(not(any(target_os = "windows", target_os = "linux")))]
pub fn spawn_listener(
network: Network,
endpoint: &str,
Expand Down Expand Up @@ -274,7 +274,7 @@ impl CoreZMQListener {
})
}

#[cfg(target_os = "windows")]
#[cfg(any(target_os = "windows", target_os = "linux"))]
pub fn spawn_listener(
network: Network,
endpoint: &str,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/top_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub fn add_top_panel(
.exact_height(50.0)
.show(ctx, |ui| {
egui::menu::bar(ui, |ui| {
#[cfg(not(target_os = "windows"))]
#[cfg(not(any(target_os = "windows", target_os = "linux")))]
{
action |= add_connection_indicator(ui, app_context);
}
Expand Down

0 comments on commit 5e402dc

Please sign in to comment.