feat: Simplify StrategyEncoders and RouterEncoder
No more SingleSwapStrategyEncoder or SequentialStrategyEncoder No more batch routing (so no need for batch permits as well). If multiple solutions are found, return multiple Transactions --- don't change below this line --- ENG-4076 <#DTT#>
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
use crate::encoding::{
|
||||
evm::strategy_encoder::encoder::{
|
||||
SequentialStrategyEncoder, SingleSwapStrategyEncoder, SplitSwapStrategyEncoder,
|
||||
StraightToPoolStrategyEncoder,
|
||||
},
|
||||
evm::strategy_encoder::encoder::{SplitSwapStrategyEncoder, StraightToPoolStrategyEncoder},
|
||||
models::Solution,
|
||||
strategy_encoder::{StrategyEncoder, StrategySelector},
|
||||
};
|
||||
@@ -13,14 +10,6 @@ impl StrategySelector for EVMStrategySelector {
|
||||
fn select_strategy(&self, solution: &Solution) -> Box<dyn StrategyEncoder> {
|
||||
if solution.straight_to_pool {
|
||||
Box::new(StraightToPoolStrategyEncoder {})
|
||||
} else if solution.swaps.len() == 1 {
|
||||
Box::new(SingleSwapStrategyEncoder {})
|
||||
} else if solution
|
||||
.swaps
|
||||
.iter()
|
||||
.all(|s| s.split == 0.0)
|
||||
{
|
||||
Box::new(SequentialStrategyEncoder {})
|
||||
} else {
|
||||
Box::new(SplitSwapStrategyEncoder {})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user