From 3f24307101a952d774df8f10dd98ed12ca2b9c50 Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Mon, 30 Sep 2024 11:37:22 -0700 Subject: [PATCH] update proto branch and use new types --- Cargo.lock | 50 +++++++++++++++++---------- Cargo.toml | 4 +-- mobile_verifier/src/heartbeats/mod.rs | 2 +- mobile_verifier/src/speedtests.rs | 4 ++- 4 files changed, 37 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a06e8f3ae..42af2d56a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1617,17 +1617,17 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "beacon" version = "0.1.0" -source = "git+https://github.com/helium/proto?branch=master#376765fe006051d6dcccf709def58e7ed291b845" +source = "git+https://github.com/helium/proto?branch=mj/do-device-type#fcb0512e55f6bad4d6830a2ae2836502eac9bfb2" dependencies = [ "base64 0.21.7", "byteorder", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "prost", "rand 0.8.5", "rand_chacha 0.3.0", "rust_decimal", "serde", - "sha2 0.10.8", + "sha2 0.9.9", "thiserror", ] @@ -1776,7 +1776,7 @@ dependencies = [ "futures", "futures-util", "helium-crypto", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "http 0.2.11", "http-serde", "humantime-serde", @@ -2618,7 +2618,7 @@ dependencies = [ "axum 0.7.4", "bs58 0.4.0", "helium-crypto", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "http 0.2.11", "notify", "serde", @@ -3200,7 +3200,7 @@ dependencies = [ "futures-util", "h3o", "helium-crypto", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "hex-literal", "http 0.2.11", "lazy_static", @@ -3776,7 +3776,7 @@ dependencies = [ "h3o", "helium-anchor-gen", "helium-crypto", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=master)", "hex", "itertools", "jsonrpc_client", @@ -3802,6 +3802,18 @@ dependencies = [ name = "helium-proto" version = "0.1.0" source = "git+https://github.com/helium/proto?branch=master#376765fe006051d6dcccf709def58e7ed291b845" +dependencies = [ + "bytes", + "prost", + "prost-build", + "serde", + "serde_json", +] + +[[package]] +name = "helium-proto" +version = "0.1.0" +source = "git+https://github.com/helium/proto?branch=mj/do-device-type#fcb0512e55f6bad4d6830a2ae2836502eac9bfb2" dependencies = [ "bytes", "prost", @@ -3853,7 +3865,7 @@ dependencies = [ "async-trait", "chrono", "derive_builder", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "hextree", "rust_decimal", "rust_decimal_macros", @@ -4269,7 +4281,7 @@ dependencies = [ "futures", "futures-util", "helium-crypto", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "http 0.2.11", "humantime-serde", "metrics", @@ -4338,7 +4350,7 @@ dependencies = [ "futures", "futures-util", "helium-crypto", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "hextree", "http 0.2.11", "http-serde", @@ -4380,7 +4392,7 @@ dependencies = [ "futures", "futures-util", "helium-crypto", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "http 0.2.11", "http-serde", "humantime-serde", @@ -4422,7 +4434,7 @@ dependencies = [ "futures-util", "h3o", "helium-crypto", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "http-serde", "humantime-serde", "iot-config", @@ -5010,7 +5022,7 @@ dependencies = [ "futures", "futures-util", "helium-crypto", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "hextree", "http 0.2.11", "http-serde", @@ -5050,7 +5062,7 @@ dependencies = [ "futures", "h3o", "helium-crypto", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "mobile-config", "prost", "rand 0.8.5", @@ -5086,7 +5098,7 @@ dependencies = [ "futures", "futures-util", "helium-crypto", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "http 0.2.11", "http-serde", "humantime-serde", @@ -5130,7 +5142,7 @@ dependencies = [ "futures-util", "h3o", "helium-crypto", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "hex-assignments", "hextree", "http-serde", @@ -5813,7 +5825,7 @@ dependencies = [ "futures", "futures-util", "helium-crypto", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "http 0.2.11", "hyper 0.14.28", "jsonrpsee", @@ -5896,7 +5908,7 @@ dependencies = [ "futures-util", "helium-anchor-gen", "helium-lib", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "humantime-serde", "metrics", "metrics-exporter-prometheus", @@ -6503,7 +6515,7 @@ dependencies = [ "futures", "futures-util", "helium-crypto", - "helium-proto", + "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=mj/do-device-type)", "humantime-serde", "lazy_static", "metrics", diff --git a/Cargo.toml b/Cargo.toml index a45355a99..52b77e3c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,10 +70,10 @@ helium-lib = { git = "https://github.com/helium/helium-wallet-rs.git", branch = hextree = { git = "https://github.com/jaykickliter/HexTree", branch = "main", features = [ "disktree", ] } -helium-proto = { git = "https://github.com/helium/proto", branch = "master", features = [ +helium-proto = { git = "https://github.com/helium/proto", branch = "mj/do-device-type", features = [ "services", ] } -beacon = { git = "https://github.com/helium/proto", branch = "master" } +beacon = { git = "https://github.com/helium/proto", branch = "mj/do-device-type" } solana-client = "1.18" solana-sdk = "1.18" solana-program = "1.18" diff --git a/mobile_verifier/src/heartbeats/mod.rs b/mobile_verifier/src/heartbeats/mod.rs index 838c66929..b72b47526 100644 --- a/mobile_verifier/src/heartbeats/mod.rs +++ b/mobile_verifier/src/heartbeats/mod.rs @@ -494,7 +494,7 @@ impl ValidatedHeartbeat { dec!(0), None, Some(coverage_object.meta), - proto::HeartbeatValidity::DataOnly, + proto::HeartbeatValidity::InvalidDeviceType, )), GatewayResolution::GatewayNotFound => Ok(Self::new( heartbeat, diff --git a/mobile_verifier/src/speedtests.rs b/mobile_verifier/src/speedtests.rs index d3218d4a0..5ed549c47 100644 --- a/mobile_verifier/src/speedtests.rs +++ b/mobile_verifier/src/speedtests.rs @@ -184,7 +184,9 @@ where .resolve_gateway_info(&pubkey) .await? { - Some(gw_info) if gw_info.is_data_only() => Ok(SpeedtestResult::SpeedtestDataOnly), + Some(gw_info) if gw_info.is_data_only() => { + Ok(SpeedtestResult::SpeedtestInvalidDeviceType) + } Some(_) => Ok(SpeedtestResult::SpeedtestValid), None => Ok(SpeedtestResult::SpeedtestGatewayNotFound), }