best_path/best_path_calculator/
noop_calculator.rs1#[cfg(not(feature = "std"))]
2use alloc::vec;
3use crate::types::*;
4use crate::*;
5
6pub struct NoBestPathCalculator {}
8impl<C: Currency, A: Amount, P: Provider> BestPathCalculator<C, A, P> for NoBestPathCalculator {
9 fn calc_best_paths(pairs_and_prices: &[(ProviderPair<C, P>, A)]) -> Result<PricePathGraph<C, A, P>, CalculatorError> {
10 Ok(pairs_and_prices.iter().cloned().map(|(pp, price)| (Pair{source: pp.pair.source, target: pp.pair.target}, PricePath{total_cost: price, steps: vec![]})).collect())
11 }
12}