diff --git a/crates/lox-distributor/src/db_handler.rs b/crates/lox-distributor/src/db_handler.rs index 310c28b..4b46b6c 100644 --- a/crates/lox-distributor/src/db_handler.rs +++ b/crates/lox-distributor/src/db_handler.rs @@ -7,7 +7,7 @@ use lox_library::{BridgeAuth, BridgeDb}; use sled::IVec; use std::collections::HashMap; use thiserror::Error; -use troll_patrol::bridge_info::BridgeInfo as TPBridgeInfo; +use troll_patrol::bridge_verification_info::BridgeVerificationInfo; #[derive(Error, Debug)] pub enum LoxDBError { @@ -80,9 +80,10 @@ impl DB { ba: Arc::new(Mutex::new(new_ba)), extra_bridges: Arc::new(Mutex::new(Vec::new())), to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())), - tp_bridge_infos: Arc::new(Mutex::new( - HashMap::<[u8; 20], TPBridgeInfo>::new(), - )), + tp_bridge_infos: Arc::new(Mutex::new(HashMap::< + [u8; 20], + BridgeVerificationInfo, + >::new())), metrics, }; } diff --git a/crates/lox-distributor/src/lox_context.rs b/crates/lox-distributor/src/lox_context.rs index 0c0161c..744fd60 100644 --- a/crates/lox-distributor/src/lox_context.rs +++ b/crates/lox-distributor/src/lox_context.rs @@ -24,7 +24,7 @@ use std::{ }; use troll_patrol::{ - self, bridge_info::BridgeInfo as TPBridgeInfo, negative_report::*, positive_report::*, + self, bridge_verification_info::BridgeVerificationInfo, negative_report::*, positive_report::*, }; use crate::metrics::Metrics; @@ -37,7 +37,7 @@ pub struct LoxServerContext { pub extra_bridges: Arc>>, pub to_be_replaced_bridges: Arc>>, // Map of bridge fingerprint to values needed to verify TP reports - pub tp_bridge_infos: Arc>>, + pub tp_bridge_infos: Arc>>, #[serde(skip)] pub metrics: Metrics, } diff --git a/crates/lox-distributor/src/request_handler.rs b/crates/lox-distributor/src/request_handler.rs index 510ea92..3f9a8ed 100644 --- a/crates/lox-distributor/src/request_handler.rs +++ b/crates/lox-distributor/src/request_handler.rs @@ -249,7 +249,7 @@ mod tests { to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())), tp_bridge_infos: Arc::new(Mutex::new(std::collections::HashMap::< [u8; 20], - troll_patrol::bridge_info::BridgeInfo, + troll_patrol::bridge_verification_info::BridgeVerificationInfo, >::new())), metrics: Metrics::default(), }; diff --git a/crates/lox-distributor/src/troll_patrol_handler.rs b/crates/lox-distributor/src/troll_patrol_handler.rs index b88a411..7e467b2 100644 --- a/crates/lox-distributor/src/troll_patrol_handler.rs +++ b/crates/lox-distributor/src/troll_patrol_handler.rs @@ -56,7 +56,7 @@ mod tests { sync::{Arc, Mutex}, }; use troll_patrol::{ - bridge_info::BridgeInfo, + bridge_verification_info::BridgeVerificationInfo, negative_report::{NegativeReport, SerializableNegativeReport}, positive_report::{PositiveReport, SerializablePositiveReport}, BridgeDistributor, @@ -119,7 +119,9 @@ mod tests { ba: Arc::new(Mutex::new(lox_auth)), extra_bridges: Arc::new(Mutex::new(Vec::new())), to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())), - tp_bridge_infos: Arc::new(Mutex::new(HashMap::<[u8; 20], BridgeInfo>::new())), + tp_bridge_infos: Arc::new(Mutex::new( + HashMap::<[u8; 20], BridgeVerificationInfo>::new(), + )), metrics: Metrics::default(), }; Self { context } @@ -164,7 +166,7 @@ mod tests { buckets.insert(bucket); tp_bridge_infos.insert( fingerprint, - BridgeInfo { + BridgeVerificationInfo { bridge_line: *bridge, buckets: buckets, pubkey: None, // TODO: add pubkey for signed bridge tokens