TP renamed bridge_info::BridgeInfo
This commit is contained in:
parent
6a0ff0d8a2
commit
fae8a9a74f
|
@ -7,7 +7,7 @@ use lox_library::{BridgeAuth, BridgeDb};
|
||||||
use sled::IVec;
|
use sled::IVec;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
use troll_patrol::bridge_info::BridgeInfo as TPBridgeInfo;
|
use troll_patrol::bridge_verification_info::BridgeVerificationInfo;
|
||||||
|
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug)]
|
||||||
pub enum LoxDBError {
|
pub enum LoxDBError {
|
||||||
|
@ -80,9 +80,10 @@ impl DB {
|
||||||
ba: Arc::new(Mutex::new(new_ba)),
|
ba: Arc::new(Mutex::new(new_ba)),
|
||||||
extra_bridges: Arc::new(Mutex::new(Vec::new())),
|
extra_bridges: Arc::new(Mutex::new(Vec::new())),
|
||||||
to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())),
|
to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())),
|
||||||
tp_bridge_infos: Arc::new(Mutex::new(
|
tp_bridge_infos: Arc::new(Mutex::new(HashMap::<
|
||||||
HashMap::<[u8; 20], TPBridgeInfo>::new(),
|
[u8; 20],
|
||||||
)),
|
BridgeVerificationInfo,
|
||||||
|
>::new())),
|
||||||
metrics,
|
metrics,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use troll_patrol::{
|
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;
|
use crate::metrics::Metrics;
|
||||||
|
@ -37,7 +37,7 @@ pub struct LoxServerContext {
|
||||||
pub extra_bridges: Arc<Mutex<Vec<BridgeLine>>>,
|
pub extra_bridges: Arc<Mutex<Vec<BridgeLine>>>,
|
||||||
pub to_be_replaced_bridges: Arc<Mutex<Vec<BridgeLine>>>,
|
pub to_be_replaced_bridges: Arc<Mutex<Vec<BridgeLine>>>,
|
||||||
// Map of bridge fingerprint to values needed to verify TP reports
|
// Map of bridge fingerprint to values needed to verify TP reports
|
||||||
pub tp_bridge_infos: Arc<Mutex<HashMap<[u8; 20], TPBridgeInfo>>>,
|
pub tp_bridge_infos: Arc<Mutex<HashMap<[u8; 20], BridgeVerificationInfo>>>,
|
||||||
#[serde(skip)]
|
#[serde(skip)]
|
||||||
pub metrics: Metrics,
|
pub metrics: Metrics,
|
||||||
}
|
}
|
||||||
|
|
|
@ -249,7 +249,7 @@ mod tests {
|
||||||
to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())),
|
to_be_replaced_bridges: Arc::new(Mutex::new(Vec::new())),
|
||||||
tp_bridge_infos: Arc::new(Mutex::new(std::collections::HashMap::<
|
tp_bridge_infos: Arc::new(Mutex::new(std::collections::HashMap::<
|
||||||
[u8; 20],
|
[u8; 20],
|
||||||
troll_patrol::bridge_info::BridgeInfo,
|
troll_patrol::bridge_verification_info::BridgeVerificationInfo,
|
||||||
>::new())),
|
>::new())),
|
||||||
metrics: Metrics::default(),
|
metrics: Metrics::default(),
|
||||||
};
|
};
|
||||||
|
|
|
@ -56,7 +56,7 @@ mod tests {
|
||||||
sync::{Arc, Mutex},
|
sync::{Arc, Mutex},
|
||||||
};
|
};
|
||||||
use troll_patrol::{
|
use troll_patrol::{
|
||||||
bridge_info::BridgeInfo,
|
bridge_verification_info::BridgeVerificationInfo,
|
||||||
negative_report::{NegativeReport, SerializableNegativeReport},
|
negative_report::{NegativeReport, SerializableNegativeReport},
|
||||||
positive_report::{PositiveReport, SerializablePositiveReport},
|
positive_report::{PositiveReport, SerializablePositiveReport},
|
||||||
BridgeDistributor,
|
BridgeDistributor,
|
||||||
|
@ -119,7 +119,9 @@ mod tests {
|
||||||
ba: Arc::new(Mutex::new(lox_auth)),
|
ba: Arc::new(Mutex::new(lox_auth)),
|
||||||
extra_bridges: Arc::new(Mutex::new(Vec::new())),
|
extra_bridges: Arc::new(Mutex::new(Vec::new())),
|
||||||
to_be_replaced_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(),
|
metrics: Metrics::default(),
|
||||||
};
|
};
|
||||||
Self { context }
|
Self { context }
|
||||||
|
@ -164,7 +166,7 @@ mod tests {
|
||||||
buckets.insert(bucket);
|
buckets.insert(bucket);
|
||||||
tp_bridge_infos.insert(
|
tp_bridge_infos.insert(
|
||||||
fingerprint,
|
fingerprint,
|
||||||
BridgeInfo {
|
BridgeVerificationInfo {
|
||||||
bridge_line: *bridge,
|
bridge_line: *bridge,
|
||||||
buckets: buckets,
|
buckets: buckets,
|
||||||
pubkey: None, // TODO: add pubkey for signed bridge tokens
|
pubkey: None, // TODO: add pubkey for signed bridge tokens
|
||||||
|
|
Loading…
Reference in New Issue