diff --git a/src/utils/mobility_data.rs b/src/utils/mobility_data.rs index 8589aecc003f11da3fc13b792ded751c0907b00b..4ce2d0bb4e2a3075caf3600a8a6ed77a3b770512 100644 --- a/src/utils/mobility_data.rs +++ b/src/utils/mobility_data.rs @@ -121,15 +121,21 @@ pub fn compute_stretched_relative_start_time( } /// Provide differents fake quantities depending on mobility e.g. BIKE that will be use for rewards calculation +/// Coefficients per km from https://nosgestesclimat.fr/actions/plus/transport/voiture-5km pub fn quantify_mobility(service: String) -> U256 { + // let base_vdf_divider = + let base_vdf_divider = + // U256::from(1_000_000_000_000_000_000_000_000_000_u128); + U256::from("0x0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffff"); if service == "BIKE_SHARING" { - U256::from(1000000000000000000_u128) + // 0.129/0.0001 = 1290 + base_vdf_divider.saturating_mul(U256::from(1290_u128)) } else if service == "BIKE_RENTAL" { - U256::from(500000000000000000_u128) + base_vdf_divider.saturating_mul(U256::from(1290_u128)) } else if service == "PUBLIC_TRANSPORT" { - U256::from(10000000000000000_u128) + base_vdf_divider.saturating_mul(U256::from(1_u128)) } else { - U256::from(1) + base_vdf_divider } } @@ -283,6 +289,6 @@ mod tests { // ACT let result = quantify_mobility(String::from("BIKE_SHARING")); // ASSERT - assert_eq!(U256::from(1000000000000000000_u128), result); + assert_eq!(U256::from(1290000000000000000000_u128), result); } }