node
node copied to clipboard
Unable to use floats to check rates are below threshold
In file DataHighway-com/node/packages/mining/mining-speed-boosts/rates/token-mining/src/lib.rs. How to use floats to check these values aren't too large without gettging error
the trait std::str::FromStr is not implemented for <T as Trait>::MiningSpeedBoostRatesTokenMiningMaxToken
This will require changing relevant types from u64 to f64 and u32 to f32 and getting it to compile.
// if token_token_mxc > "1.2".parse().unwrap() || token_token_iota > "1.2".parse().unwrap() || token_token_dot > "1.2".parse().unwrap() || token_max_token > "1.6".parse().unwrap() || token_max_loyalty > "1.2".parse().unwrap() {
// debug::info!("Token rate cannot be this large");
// return Ok(());
// }
Use fixed point arithmetic instead of floats. See https://substrate.dev/recipes/fixed-point.html