From b412cf50ec2ef9e08355e94a98faaf34b1ecde3f Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Mon, 27 Jul 2026 01:22:41 +0200 Subject: [PATCH] Fix cooldown display --- Cargo.lock | 1 + Cargo.toml | 17 +++++++++++++---- pulse-wire/src/lib.rs | 2 ++ src/engine/engine/plugin.rs | 4 +--- src/engine/main.rs | 2 +- src/terminal/formatting.rs | 2 +- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 288a837..48d222b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3882,6 +3882,7 @@ dependencies = [ name = "pulse-trader" version = "0.1.0-alpha.0" dependencies = [ + "anyhow", "chrono", "crossterm", "hypersdk", diff --git a/Cargo.toml b/Cargo.toml index 79ece7b..5371dc0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,15 +6,23 @@ edition = "2024" [dependencies] pulse-ui = { workspace = true } pulse-wire = { workspace = true } - -chrono = "0.4.45" -tokio = { workspace = true, features = ["rt-multi-thread", "macros", "net", "fs", "io-util", "time", "process"] } crossterm = { workspace = true } hypersdk = { workspace = true } +serde = { workspace = true } +anyhow = { workspace = true } +tokio = { workspace = true, features = [ + "rt-multi-thread", + "macros", + "net", + "fs", + "io-util", + "time", + "process", +] } +chrono = "0.4.45" serde_json = "1" rand = "0.8.7" toml = "1.1.3" -serde = { workspace = true } [workspace] members = ["pulse-macros", "pulse-ui", "pulse-wire"] @@ -27,6 +35,7 @@ hypersdk = "0.2.14" tokio = "1.52.3" crossterm = "0.29.0" serde = { version = "1.0.229", features = ["serde_derive"] } +anyhow = "1.0.104" [[bin]] name = "pulse-trader" diff --git a/pulse-wire/src/lib.rs b/pulse-wire/src/lib.rs index be1a05a..0ff2c32 100644 --- a/pulse-wire/src/lib.rs +++ b/pulse-wire/src/lib.rs @@ -6,6 +6,7 @@ mod hyper_types; pub mod plugin; pub mod terminal; pub mod units; +pub use hypersdk; pub mod prelude { pub use crate::PulseWire; @@ -14,6 +15,7 @@ pub mod prelude { pub use crate::server_path; pub use crate::terminal::*; pub use crate::units::*; + pub use hypersdk; } pub fn server_path() -> PathBuf { diff --git a/src/engine/engine/plugin.rs b/src/engine/engine/plugin.rs index de38592..51ebbcd 100644 --- a/src/engine/engine/plugin.rs +++ b/src/engine/engine/plugin.rs @@ -59,7 +59,7 @@ impl StrategyEngine { Arc::new(self) } - pub async fn run_strategy(&self) -> tokio::io::Result<()> { + pub async fn run_strategy(&self) -> anyhow::Result<()> { let engine = self .engine .upgrade() @@ -157,8 +157,6 @@ impl StrategyEngine { Some(RiskMessage::Reject { reason }) => {} } } - - Ok(()) } pub async fn spawn(self: &Arc) { diff --git a/src/engine/main.rs b/src/engine/main.rs index c3c6dc6..7555ce1 100644 --- a/src/engine/main.rs +++ b/src/engine/main.rs @@ -4,7 +4,7 @@ pub mod store; pub mod terminal; #[tokio::main] -async fn main() -> tokio::io::Result<()> { +async fn main() -> anyhow::Result<()> { let engine = engine::Engine::new().await?; let terminal_server = engine.spawn_terminal_server().await; diff --git a/src/terminal/formatting.rs b/src/terminal/formatting.rs index b46ef22..504ff42 100644 --- a/src/terminal/formatting.rs +++ b/src/terminal/formatting.rs @@ -259,7 +259,7 @@ impl Formatted for Strategy { ), Triple( &format!( - "\x1b[96m{:?}\x1b[0m (\x1b[90m{:?} rec\x1b[0m)", + "\x1b[96m{}\x1b[0m (\x1b[90m{} rec\x1b[0m)", self.cooldown, self.risk.cooldown ), &format!("\x1b[96m{:?}\x1b[0m", self.strategy.author),