Skip to content

Commit

Permalink
Make boosting_oracles as separate create
Browse files Browse the repository at this point in the history
  • Loading branch information
kurotych committed May 8, 2024
1 parent 2531d93 commit 140f36f
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 13 deletions.
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ members = [
"reward_scheduler",
"solana",
"task_manager",
"boosting_oracles",
]
resolver = "2"

Expand Down
15 changes: 15 additions & 0 deletions boosting_oracles/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "boosting-oracles"
version = "0.1.0"
description = "Boosting Oracles"
edition.workspace = true
authors.workspace = true
license.workspace = true

[dependencies]
anyhow = { workspace = true }
hextree = { workspace = true }
sqlx = {version = "*", features = ["runtime-tokio-rustls"]}
rust_decimal = { workspace = true}
rust_decimal_macros = { workspace = true}
helium-proto = {workspace = true}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pub mod assignment;

use crate::Settings;
use std::path::PathBuf;

pub use assignment::{Assignment, HexAssignments};
use hextree::disktree::DiskTreeMap;

Expand All @@ -14,10 +15,14 @@ pub struct HexBoostData {
landtype: DiskTreeMap,
}

pub fn make_hex_boost_data(settings: &Settings) -> anyhow::Result<HexBoostData> {
let urban_disktree = DiskTreeMap::open(&settings.urbanization_data_set)?;
let footfall_disktree = DiskTreeMap::open(&settings.footfall_data_set)?;
let landtype_disktree = DiskTreeMap::open(&settings.landtype_data_set)?;
pub fn make_hex_boost_data(
urbanization_data_set: &PathBuf,
footfall_data_set: &PathBuf,
landtype_data_set: &PathBuf,
) -> anyhow::Result<HexBoostData> {
let urban_disktree = DiskTreeMap::open(urbanization_data_set)?;
let footfall_disktree = DiskTreeMap::open(footfall_data_set)?;
let landtype_disktree = DiskTreeMap::open(landtype_data_set)?;

let hex_boost_data = HexBoostData {
urbanized: urban_disktree,
Expand Down
1 change: 1 addition & 0 deletions mobile_verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ async-trait = {workspace = true}
retainer = {workspace = true}
uuid = {workspace = true}
task-manager = {path = "../task_manager"}
boosting-oracles = {path = "../boosting_oracles"}
solana-sdk = {workspace = true}

[dev-dependencies]
Expand Down
8 changes: 6 additions & 2 deletions mobile_verifier/src/cli/server.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{
boosting_oracles,
coverage::CoverageDaemon,
data_session::DataSessionIngestor,
geofence::Geofence,
Expand All @@ -11,6 +10,7 @@ use crate::{
telemetry, Settings,
};
use anyhow::Result;
use boosting_oracles;
use chrono::Duration;
use file_store::{
file_sink,
Expand Down Expand Up @@ -148,7 +148,11 @@ impl Cmd {
file_upload.clone(),
report_ingest.clone(),
auth_client.clone(),
boosting_oracles::make_hex_boost_data(settings)?,
boosting_oracles::make_hex_boost_data(
&settings.urbanization_data_set,
&settings.footfall_data_set,
&settings.landtype_data_set,
)?,
)
.await?,
)
Expand Down
6 changes: 2 additions & 4 deletions mobile_verifier/src/cli/verify_disktree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ use std::{collections::HashMap, path::PathBuf};

use hextree::disktree::DiskTreeMap;

use crate::{
boosting_oracles::{Assignment, Landtype},
Settings,
};
use crate::Settings;
use boosting_oracles::{Assignment, Landtype};

#[derive(Debug, clap::Args)]
pub struct Cmd {
Expand Down
3 changes: 2 additions & 1 deletion mobile_verifier/src/coverage.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use crate::{
boosting_oracles::{BoostedHexAssignments, HexAssignments, HexBoostData},
heartbeats::{HbType, KeyType, OwnedKeyType},
IsAuthorized, Settings,
};
use boosting_oracles::{BoostedHexAssignments, HexAssignments, HexBoostData};

use chrono::{DateTime, Duration, Utc};
use file_store::{
coverage::{self, CoverageObjectIngestReport},
Expand Down
1 change: 0 additions & 1 deletion mobile_verifier/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pub mod boosting_oracles;
pub mod cell_type;
pub mod cli;
pub mod coverage;
Expand Down

0 comments on commit 140f36f

Please sign in to comment.