Fix bug
This commit is contained in:
Generated
+2
@@ -3947,6 +3947,7 @@ version = "0.1.0-alpha.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"hypersdk",
|
"hypersdk",
|
||||||
"postcard",
|
"postcard",
|
||||||
|
"rust_decimal",
|
||||||
"serde",
|
"serde",
|
||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
@@ -3963,6 +3964,7 @@ dependencies = [
|
|||||||
"pulse-sdk",
|
"pulse-sdk",
|
||||||
"pulse-ui",
|
"pulse-ui",
|
||||||
"rand 0.8.7",
|
"rand 0.8.7",
|
||||||
|
"rust_decimal",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ hypersdk = { workspace = true }
|
|||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
anyhow = { workspace = true }
|
anyhow = { workspace = true }
|
||||||
postcard = { workspace = true }
|
postcard = { workspace = true }
|
||||||
|
rust_decimal = { workspace = true }
|
||||||
tokio = { workspace = true, features = [
|
tokio = { workspace = true, features = [
|
||||||
"rt-multi-thread",
|
"rt-multi-thread",
|
||||||
"macros",
|
"macros",
|
||||||
@@ -29,6 +30,7 @@ toml = "1.1.3"
|
|||||||
members = ["pulse-ui", "pulse-sdk"]
|
members = ["pulse-ui", "pulse-sdk"]
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
|
rust_decimal = { version = "1.39", features = ["serde-str"] }
|
||||||
postcard = { version = "1.1.3", features = ["alloc"] }
|
postcard = { version = "1.1.3", features = ["alloc"] }
|
||||||
pulse-ui = { path = "pulse-ui", version = "0.1.0-alpha.0" }
|
pulse-ui = { path = "pulse-ui", version = "0.1.0-alpha.0" }
|
||||||
pulse-sdk = { path = "pulse-sdk", version = "0.1.0-alpha.0" }
|
pulse-sdk = { path = "pulse-sdk", version = "0.1.0-alpha.0" }
|
||||||
|
|||||||
@@ -8,3 +8,4 @@ serde = { workspace = true }
|
|||||||
hypersdk = { workspace = true }
|
hypersdk = { workspace = true }
|
||||||
postcard = { workspace = true }
|
postcard = { workspace = true }
|
||||||
tokio = { workspace = true, features = ["io-std"] }
|
tokio = { workspace = true, features = ["io-std"] }
|
||||||
|
rust_decimal = { workspace = true }
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use hypersdk::Decimal;
|
use rust_decimal::Decimal;
|
||||||
|
|
||||||
use crate::units::{Direction, Symbol, USD};
|
use crate::units::{Direction, Symbol, USD};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use hypersdk::Decimal;
|
use rust_decimal::Decimal;
|
||||||
|
|
||||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||||
pub struct Symbol(pub String);
|
pub struct Symbol(pub String);
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
use hypersdk::Decimal;
|
use rust_decimal::Decimal;
|
||||||
use pulse_sdk::prelude::*;
|
use pulse_sdk::prelude::*;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|||||||
@@ -53,7 +53,8 @@ impl TerminalClient {
|
|||||||
let status = app.status.clone();
|
let status = app.status.clone();
|
||||||
let inspect = app.inspect.clone();
|
let inspect = app.inspect.clone();
|
||||||
|
|
||||||
tokio::spawn(Self::run_client(
|
tokio::spawn(async {
|
||||||
|
if let Err(v) = Self::run_client(
|
||||||
reader,
|
reader,
|
||||||
watch_list,
|
watch_list,
|
||||||
active_positions,
|
active_positions,
|
||||||
@@ -62,7 +63,12 @@ impl TerminalClient {
|
|||||||
market_overview,
|
market_overview,
|
||||||
status,
|
status,
|
||||||
inspect,
|
inspect,
|
||||||
));
|
)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
panic!("{v}")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
app.sock = Some(self);
|
app.sock = Some(self);
|
||||||
|
|
||||||
@@ -80,6 +86,7 @@ impl TerminalClient {
|
|||||||
status: State<Option<Status>>,
|
status: State<Option<Status>>,
|
||||||
inspect: State<InspectTarget>,
|
inspect: State<InspectTarget>,
|
||||||
) -> tokio::io::Result<()> {
|
) -> tokio::io::Result<()> {
|
||||||
|
loop {
|
||||||
let mut len_buf = [0u8; size_of::<usize>()];
|
let mut len_buf = [0u8; size_of::<usize>()];
|
||||||
reader
|
reader
|
||||||
.read_exact(&mut len_buf)
|
.read_exact(&mut len_buf)
|
||||||
@@ -128,7 +135,6 @@ impl TerminalClient {
|
|||||||
logs.lock().await.push(v);
|
logs.lock().await.push(v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user