Formatting changes from cargo fmt
This commit is contained in:
parent
82e63284ce
commit
5f34f49d17
|
@ -188,7 +188,7 @@ mod tests {
|
||||||
"123.456.789.100".to_owned(),
|
"123.456.789.100".to_owned(),
|
||||||
3002,
|
3002,
|
||||||
"BE84A97D02130470A1C77839954392BA979F7EE1".to_owned(),
|
"BE84A97D02130470A1C77839954392BA979F7EE1".to_owned(),
|
||||||
ACCEPTED_HOURS_OF_FAILURE-1,
|
ACCEPTED_HOURS_OF_FAILURE - 1,
|
||||||
);
|
);
|
||||||
let resource_two = make_resource(
|
let resource_two = make_resource(
|
||||||
"https".to_owned(),
|
"https".to_owned(),
|
||||||
|
@ -202,7 +202,7 @@ mod tests {
|
||||||
"123.222.333.444".to_owned(),
|
"123.222.333.444".to_owned(),
|
||||||
6002,
|
6002,
|
||||||
"C56B9EF202130470A1C77839954392BA979F7FF9".to_owned(),
|
"C56B9EF202130470A1C77839954392BA979F7FF9".to_owned(),
|
||||||
ACCEPTED_HOURS_OF_FAILURE+2,
|
ACCEPTED_HOURS_OF_FAILURE + 2,
|
||||||
);
|
);
|
||||||
let resource_three = make_resource(
|
let resource_three = make_resource(
|
||||||
"scramblesuit".to_owned(),
|
"scramblesuit".to_owned(),
|
||||||
|
@ -216,7 +216,7 @@ mod tests {
|
||||||
"443.288.222.100".to_owned(),
|
"443.288.222.100".to_owned(),
|
||||||
3042,
|
3042,
|
||||||
"5E3A8BD902130470A1C77839954392BA979F7B46".to_owned(),
|
"5E3A8BD902130470A1C77839954392BA979F7B46".to_owned(),
|
||||||
ACCEPTED_HOURS_OF_FAILURE+1,
|
ACCEPTED_HOURS_OF_FAILURE + 1,
|
||||||
);
|
);
|
||||||
let resource_four = make_resource(
|
let resource_four = make_resource(
|
||||||
"https".to_owned(),
|
"https".to_owned(),
|
||||||
|
|
|
@ -1065,7 +1065,10 @@ fn test_bridge_replace() {
|
||||||
// Case zero: bridge to be replaced is not in the bridgetable
|
// Case zero: bridge to be replaced is not in the bridgetable
|
||||||
let random_bridgeline = BridgeLine::random();
|
let random_bridgeline = BridgeLine::random();
|
||||||
assert!(
|
assert!(
|
||||||
!th.ba.bridge_table.reachable.contains_key(&random_bridgeline),
|
!th.ba
|
||||||
|
.bridge_table
|
||||||
|
.reachable
|
||||||
|
.contains_key(&random_bridgeline),
|
||||||
"Random bridgeline happens to be in the bridge_table (and should not be)"
|
"Random bridgeline happens to be in the bridge_table (and should not be)"
|
||||||
);
|
);
|
||||||
assert!(
|
assert!(
|
||||||
|
|
|
@ -831,8 +831,9 @@ pub fn get_next_unlock(constants_str: String, lox_cred_str: String) -> Result<St
|
||||||
days_to_next_level + constants.level_interval[trust_level as usize + 1];
|
days_to_next_level + constants.level_interval[trust_level as usize + 1];
|
||||||
invitations_at_next_level = constants.level_invitations[trust_level as usize + 1];
|
invitations_at_next_level = constants.level_invitations[trust_level as usize + 1];
|
||||||
}
|
}
|
||||||
let days_to_blockage_migration_unlock =
|
let days_to_blockage_migration_unlock = match trust_level
|
||||||
match trust_level < constants.min_blockage_migration_trust_level {
|
< constants.min_blockage_migration_trust_level
|
||||||
|
{
|
||||||
// If the credential is greater than the minimum level that enables
|
// If the credential is greater than the minimum level that enables
|
||||||
// migrating after a blockage, the time to unlock is 0, otherwise we
|
// migrating after a blockage, the time to unlock is 0, otherwise we
|
||||||
// add the time to upgrade until that level
|
// add the time to upgrade until that level
|
||||||
|
@ -853,7 +854,9 @@ pub fn get_next_unlock(constants_str: String, lox_cred_str: String) -> Result<St
|
||||||
let day_of_invite_unlock =
|
let day_of_invite_unlock =
|
||||||
(scalar_u32(&lox_cred.lox_credential.level_since).unwrap() + days_to_invite_inc) as i32;
|
(scalar_u32(&lox_cred.lox_credential.level_since).unwrap() + days_to_invite_inc) as i32;
|
||||||
let invite_unlock_date = JulianDay::new(day_of_invite_unlock).to_date();
|
let invite_unlock_date = JulianDay::new(day_of_invite_unlock).to_date();
|
||||||
let day_of_blockage_migration_unlock = (scalar_u32(&lox_cred.lox_credential.level_since).unwrap() + days_to_blockage_migration_unlock) as i32;
|
let day_of_blockage_migration_unlock = (scalar_u32(&lox_cred.lox_credential.level_since)
|
||||||
|
.unwrap()
|
||||||
|
+ days_to_blockage_migration_unlock) as i32;
|
||||||
let blockage_migration_unlock_date =
|
let blockage_migration_unlock_date =
|
||||||
JulianDay::new(day_of_blockage_migration_unlock as i32).to_date();
|
JulianDay::new(day_of_blockage_migration_unlock as i32).to_date();
|
||||||
let next_unlock: lox_utils::LoxNextUnlock = lox_utils::LoxNextUnlock {
|
let next_unlock: lox_utils::LoxNextUnlock = lox_utils::LoxNextUnlock {
|
||||||
|
|
Loading…
Reference in New Issue