Compare commits

..
Author SHA1 Message Date
Alex Emmet
4b371463ea Merge branch 'main' of ssh://git.methanium.net/tensamin/omikron 2026-04-08 21:16:36 +02:00
Alex Emmet
ba1d29466f [Fix] Iota Registration 2026-04-08 21:00:32 +02:00
3 changed files with 35 additions and 8 deletions

12
Cargo.lock generated
View file

@ -770,9 +770,9 @@ dependencies = [
[[package]] [[package]]
name = "fastrand" name = "fastrand"
version = "2.4.0" version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a043dc74da1e37d6afe657061213aa6f425f855399a11d3463c6ecccc4dfda1f" checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6"
[[package]] [[package]]
name = "ff" name = "ff"
@ -2987,9 +2987,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.51.0" version = "1.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bd1c4c0fc4a7ab90fc15ef6daaa3ec3b893f004f915f2392557ed23237820cd" checksum = "f66bf9585cda4b724d3e78ab34b73fb2bbaba9011b9bfdf69dc836382ea13b8c"
dependencies = [ dependencies = [
"bytes", "bytes",
"libc", "libc",
@ -3133,7 +3133,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]] [[package]]
name = "ttp-core" name = "ttp-core"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.methanium.net/Tensamin/TTP.git#bacbcb0e38791cf1a38cf5851beb20d5645002ba" source = "git+https://github.com/Tensamin/TTP.git#e246d1af6a42c71514d0ccc06fef94d71e4ad167"
dependencies = [ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"byteorder", "byteorder",
@ -3145,7 +3145,7 @@ dependencies = [
[[package]] [[package]]
name = "ttp-native" name = "ttp-native"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.methanium.net/Tensamin/TTP.git#bacbcb0e38791cf1a38cf5851beb20d5645002ba" source = "git+https://github.com/Tensamin/TTP.git#e246d1af6a42c71514d0ccc06fef94d71e4ad167"
dependencies = [ dependencies = [
"quinn", "quinn",
"rustls", "rustls",

View file

@ -4,8 +4,8 @@ version = "0.1.0"
edition = "2024" edition = "2024"
[dependencies] [dependencies]
ttp-core = { git = "https://git.methanium.net/Tensamin/TTP.git", package = "ttp-core" } ttp-core = { git = "https://github.com/Tensamin/TTP.git", package = "ttp-core" }
ttp-native = { git = "https://git.methanium.net/Tensamin/TTP.git", package = "ttp-native" } ttp-native = { git = "https://github.com/Tensamin/TTP.git", package = "ttp-native" }
ansi_term = "*" ansi_term = "*"
uuid = { version = "*", features = ["v4"] } uuid = { version = "*", features = ["v4"] }

View file

@ -96,6 +96,33 @@ impl GeneralConnection {
log_out!(0, PrintType::General, "General connection handler stopped"); log_out!(0, PrintType::General, "General connection handler stopped");
} }
async fn handle_identification(self: &Arc<Self>, cv: CommunicationValue) { async fn handle_identification(self: &Arc<Self>, cv: CommunicationValue) {
if cv.is_type(CommunicationType::register_iota) {
if let DataValue::Str(pub_key) = cv.get_data(DataTypes::public_key) {
let msg = CommunicationValue::new(CommunicationType::complete_register_iota)
.add_data(DataTypes::public_key, DataValue::Str(pub_key.clone()));
let response = get_omega_connection()
.await_response(&msg, Some(Duration::from_secs(20)))
.await;
if let Ok(response_cv) = response {
if let DataValue::Number(iota_id) = response_cv.get_data(DataTypes::iota_id) {
let success_msg = CommunicationValue::new(CommunicationType::success)
.with_id(cv.get_id())
.add_data(DataTypes::iota_id, DataValue::Number(*iota_id));
log_cv_out!(success_msg);
let _ = self.sender.send(&success_msg).await;
} else {
let err_msg =
CommunicationValue::new(CommunicationType::error).with_id(cv.get_id());
let _ = self.sender.send(&err_msg).await;
}
}
}
return;
}
if !cv.is_type(CommunicationType::identification) { if !cv.is_type(CommunicationType::identification) {
return; return;
} }