diff --git a/Cargo.lock b/Cargo.lock index 6a771511e..00c9a4968 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1593,18 +1593,6 @@ dependencies = [ "triggered", ] -[[package]] -name = "boosting-oracles" -version = "0.1.0" -dependencies = [ - "anyhow", - "helium-proto", - "hextree", - "rust_decimal", - "rust_decimal_macros", - "sqlx", -] - [[package]] name = "borsh" version = "0.9.3" @@ -3502,6 +3490,18 @@ dependencies = [ "serde", ] +[[package]] +name = "hex-assignments" +version = "0.1.0" +dependencies = [ + "anyhow", + "helium-proto", + "hextree", + "rust_decimal", + "rust_decimal_macros", + "sqlx", +] + [[package]] name = "hex-literal" version = "0.3.4" @@ -4684,7 +4684,6 @@ dependencies = [ "async-trait", "backon", "base64 0.21.7", - "boosting-oracles", "chrono", "clap 4.4.8", "config", @@ -4696,6 +4695,7 @@ dependencies = [ "h3o", "helium-crypto", "helium-proto", + "hex-assignments", "hextree", "http-serde", "humantime", diff --git a/Cargo.toml b/Cargo.toml index 2841d39d6..559208b7a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ members = [ "reward_scheduler", "solana", "task_manager", - "boosting_oracles", + "hex_assignments", ] resolver = "2" diff --git a/boosting_oracles/Cargo.toml b/hex_assignments/Cargo.toml similarity index 85% rename from boosting_oracles/Cargo.toml rename to hex_assignments/Cargo.toml index 5a592901c..9b29cc7e5 100644 --- a/boosting_oracles/Cargo.toml +++ b/hex_assignments/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "boosting-oracles" +name = "hex-assignments" version = "0.1.0" -description = "Boosting Oracles" +description = "Hex Assignments" edition.workspace = true authors.workspace = true license.workspace = true diff --git a/boosting_oracles/src/assignment.rs b/hex_assignments/src/assignment.rs similarity index 100% rename from boosting_oracles/src/assignment.rs rename to hex_assignments/src/assignment.rs diff --git a/boosting_oracles/src/lib.rs b/hex_assignments/src/lib.rs similarity index 100% rename from boosting_oracles/src/lib.rs rename to hex_assignments/src/lib.rs diff --git a/mobile_verifier/Cargo.toml b/mobile_verifier/Cargo.toml index e0ec8836d..124d6f564 100644 --- a/mobile_verifier/Cargo.toml +++ b/mobile_verifier/Cargo.toml @@ -50,7 +50,7 @@ async-trait = {workspace = true} retainer = {workspace = true} uuid = {workspace = true} task-manager = {path = "../task_manager"} -boosting-oracles = {path = "../boosting_oracles"} +hex-assignments = {path = "../hex_assignments"} solana-sdk = {workspace = true} [dev-dependencies] diff --git a/mobile_verifier/src/cli/server.rs b/mobile_verifier/src/cli/server.rs index 31c0418e8..10287490a 100644 --- a/mobile_verifier/src/cli/server.rs +++ b/mobile_verifier/src/cli/server.rs @@ -10,13 +10,13 @@ use crate::{ telemetry, Settings, }; use anyhow::Result; -use boosting_oracles; use chrono::Duration; use file_store::{ file_sink, file_upload::{self}, FileStore, FileType, }; +use hex_assignments; use mobile_config::client::{ entity_client::EntityClient, hex_boosting_client::HexBoostingClient, AuthorizationClient, @@ -148,7 +148,7 @@ impl Cmd { file_upload.clone(), report_ingest.clone(), auth_client.clone(), - boosting_oracles::make_hex_boost_data( + hex_assignments::make_hex_boost_data( &settings.urbanization_data_set, &settings.footfall_data_set, &settings.landtype_data_set, diff --git a/mobile_verifier/src/cli/verify_disktree.rs b/mobile_verifier/src/cli/verify_disktree.rs index ee4e14a0a..12ad8d768 100644 --- a/mobile_verifier/src/cli/verify_disktree.rs +++ b/mobile_verifier/src/cli/verify_disktree.rs @@ -3,7 +3,7 @@ use std::{collections::HashMap, path::PathBuf}; use hextree::disktree::DiskTreeMap; use crate::Settings; -use boosting_oracles::{Assignment, Landtype}; +use hex_assignments::{Assignment, Landtype}; #[derive(Debug, clap::Args)] pub struct Cmd { diff --git a/mobile_verifier/src/coverage.rs b/mobile_verifier/src/coverage.rs index 1c9317946..41b378da8 100644 --- a/mobile_verifier/src/coverage.rs +++ b/mobile_verifier/src/coverage.rs @@ -2,7 +2,7 @@ use crate::{ heartbeats::{HbType, KeyType, OwnedKeyType}, IsAuthorized, Settings, }; -use boosting_oracles::{BoostedHexAssignments, HexAssignments, HexBoostData}; +use hex_assignments::{BoostedHexAssignments, HexAssignments, HexBoostData}; use chrono::{DateTime, Duration, Utc}; use file_store::{ @@ -121,7 +121,6 @@ impl CoverageDaemon { .create() .await?; - // let hex_boost_data = boosting_oracles::make_hex_boost_data(settings, geofence)?; let coverage_daemon = CoverageDaemon::new( pool, auth_client, @@ -1097,12 +1096,12 @@ mod test { use std::str::FromStr; use super::*; - use boosting_oracles::Assignment; use chrono::NaiveDate; use futures::stream::iter; + use hex_assignments::Assignment; use hextree::Cell; - fn boosting_oracles_assignments_mock() -> HexAssignments { + fn hex_assignments_mock() -> HexAssignments { HexAssignments { footfall: Assignment::A, urbanized: Assignment::A, @@ -1143,7 +1142,7 @@ mod test { points: CoverageRewardPoints { coverage_points: dec!(400), boost_multiplier: NonZeroU32::new(1).unwrap(), - hex_assignments: boosting_oracles_assignments_mock(), + hex_assignments: hex_assignments_mock(), rank: None }, boosted_hex_info: BoostedHex { @@ -1177,7 +1176,7 @@ mod test { signal_power: 0, coverage_claim_time, inserted_at: DateTime::::MIN_UTC, - assignments: boosting_oracles_assignments_mock(), + assignments: hex_assignments_mock(), } } @@ -1259,7 +1258,7 @@ mod test { points: CoverageRewardPoints { coverage_points: dec!(400), boost_multiplier: NonZeroU32::new(1).unwrap(), - hex_assignments: boosting_oracles_assignments_mock(), + hex_assignments: hex_assignments_mock(), rank: None }, boosted_hex_info: BoostedHex { @@ -1303,7 +1302,7 @@ mod test { coverage_points: dec!(16), rank: Some(dec!(1.0)), boost_multiplier: NonZeroU32::new(1).unwrap(), - hex_assignments: boosting_oracles_assignments_mock(), + hex_assignments: hex_assignments_mock(), }, boosted_hex_info: BoostedHex { location: Cell::from_raw(0x8a1fb46622dffff).expect("valid h3 cell"), @@ -1317,7 +1316,7 @@ mod test { coverage_points: dec!(16), rank: Some(dec!(0.50)), boost_multiplier: NonZeroU32::new(1).unwrap(), - hex_assignments: boosting_oracles_assignments_mock(), + hex_assignments: hex_assignments_mock(), }, boosted_hex_info: BoostedHex { location: Cell::from_raw(0x8a1fb46622dffff).expect("valid h3 cell"), @@ -1331,7 +1330,7 @@ mod test { coverage_points: dec!(16), rank: Some(dec!(0.25)), boost_multiplier: NonZeroU32::new(1).unwrap(), - hex_assignments: boosting_oracles_assignments_mock(), + hex_assignments: hex_assignments_mock(), }, boosted_hex_info: BoostedHex { location: Cell::from_raw(0x8a1fb46622dffff).expect("valid h3 cell"), @@ -1602,7 +1601,7 @@ mod test { signal_power: 0, coverage_claim_time: coverage_claim_time.unwrap_or(DateTime::::MIN_UTC), inserted_at: DateTime::::MIN_UTC, - assignments: boosting_oracles_assignments_mock(), + assignments: hex_assignments_mock(), } } @@ -1620,7 +1619,7 @@ mod test { signal_level: SignalLevel::High, coverage_claim_time, inserted_at: DateTime::::MIN_UTC, - assignments: boosting_oracles_assignments_mock(), + assignments: hex_assignments_mock(), } } @@ -1638,7 +1637,7 @@ mod test { signal_level: SignalLevel::High, coverage_claim_time, inserted_at: DateTime::::MIN_UTC, - assignments: boosting_oracles_assignments_mock(), + assignments: hex_assignments_mock(), } } @@ -1656,7 +1655,7 @@ mod test { signal_level, coverage_claim_time, inserted_at: DateTime::::MIN_UTC, - assignments: boosting_oracles_assignments_mock(), + assignments: hex_assignments_mock(), } } } diff --git a/mobile_verifier/src/reward_shares.rs b/mobile_verifier/src/reward_shares.rs index 6229ed3c1..f79605bd5 100644 --- a/mobile_verifier/src/reward_shares.rs +++ b/mobile_verifier/src/reward_shares.rs @@ -706,7 +706,7 @@ mod test { speedtests_average::SpeedtestAverage, subscriber_location::SubscriberValidatedLocations, }; - use boosting_oracles::{assignment::HexAssignments, Assignment}; + use hex_assignments::{assignment::HexAssignments, Assignment}; use chrono::{Duration, Utc}; use file_store::speedtest::CellSpeedtest; @@ -719,7 +719,7 @@ mod test { use std::collections::HashMap; use uuid::Uuid; - fn boosting_oracles_assignments_mock() -> HexAssignments { + fn hex_assignments_mock() -> HexAssignments { HexAssignments { footfall: Assignment::A, urbanized: Assignment::A, @@ -1015,7 +1015,7 @@ mod test { signal_power: 0, coverage_claim_time: DateTime::::MIN_UTC, inserted_at: DateTime::::MIN_UTC, - assignments: boosting_oracles_assignments_mock(), + assignments: hex_assignments_mock(), }] } @@ -1900,7 +1900,7 @@ mod test { coverage_points: CoverageRewardPoints { boost_multiplier: NonZeroU32::new(1).unwrap(), coverage_points: dec!(10.0), - hex_assignments: boosting_oracles_assignments_mock(), + hex_assignments: hex_assignments_mock(), rank: None, }, boosted_hex: BoostedHex { diff --git a/mobile_verifier/tests/integrations/boosting_oracles.rs b/mobile_verifier/tests/integrations/boosting_oracles.rs index 44a83142a..87b1e9bc4 100644 --- a/mobile_verifier/tests/integrations/boosting_oracles.rs +++ b/mobile_verifier/tests/integrations/boosting_oracles.rs @@ -1,6 +1,5 @@ use crate::common; use anyhow::Context; -use boosting_oracles::Assignment; use chrono::{DateTime, Duration, Utc}; use file_store::{ coverage::RadioHexSignalLevel, @@ -13,6 +12,7 @@ use helium_crypto::PublicKeyBinary; use helium_proto::services::poc_mobile::{ CoverageObjectValidity, OracleBoostingHexAssignment, SignalLevel, }; +use hex_assignments::Assignment; use mobile_config::boosted_hex_info::BoostedHexes; use mobile_verifier::{ coverage::{ diff --git a/mobile_verifier/tests/integrations/common/mod.rs b/mobile_verifier/tests/integrations/common/mod.rs index 9b950c824..c8b3f4c4a 100644 --- a/mobile_verifier/tests/integrations/common/mod.rs +++ b/mobile_verifier/tests/integrations/common/mod.rs @@ -1,4 +1,3 @@ -use boosting_oracles::{Assignment, BoostedHexAssignments, HexAssignments}; use chrono::{DateTime, Utc}; use file_store::file_sink::{FileSinkClient, Message as SinkMessage}; use futures::{stream, StreamExt}; @@ -9,6 +8,7 @@ use helium_proto::{ }, Message, }; +use hex_assignments::{Assignment, BoostedHexAssignments, HexAssignments}; use mobile_config::{ boosted_hex_info::{BoostedHexInfo, BoostedHexInfoStream}, client::{hex_boosting_client::HexBoostingInfoResolver, ClientError},